X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fcommon%2Fwindow-impl.h;h=8b4bc283345c54720c9ae6acb2b23cb71864410a;hb=c5af3e859011ad7e3d2f5e40a10b2416da4e7469;hp=428244c25afbce4cf15367574722ccb3479f2f35;hpb=6c48d965d1eca249b71488ab4193bf6dcdd74bcd;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/common/window-impl.h b/adaptors/common/window-impl.h index 428244c..8b4bc28 100644 --- a/adaptors/common/window-impl.h +++ b/adaptors/common/window-impl.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_WINDOW_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,20 +21,21 @@ // EXTERNAL INCLUDES #include #include -#include -#include -#include -#include // INTERNAL INCLUDES #include +#include #include -#include - +#include +#include +#include +#include +#include namespace Dali { class Adaptor; +class RenderSurface; namespace Integration { @@ -45,8 +46,6 @@ namespace Internal { namespace Adaptor { -class RenderSurface; -class Indicator; class Orientation; class Window; @@ -56,17 +55,22 @@ typedef IntrusivePtr OrientationPtr; /** * Window provides a surface to render onto with orientation & indicator properties. */ -class Window : public Dali::BaseObject, public Indicator::Observer, public LifeCycleObserver +class Window : public Dali::BaseObject, public IndicatorInterface::Observer, public LifeCycleObserver { public: + typedef Dali::Window::IndicatorSignalType IndicatorSignalType; + typedef Dali::DevelWindow::FocusSignalType FocusSignalType; + typedef Signal< void () > SignalType; + /** * Create a new Window. This should only be called once by the Application class * @param[in] windowPosition The position and size of the window * @param[in] name The window title + * @param[in] className The window class name * @param[in] isTransparent Whether window is transparent * @return A newly allocated Window */ - static Window* New(const PositionSize& posSize, const std::string& name, bool isTransparent = false); + static Window* New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent = false); /** * Pass the adaptor back to the overlay. This allows the window to access Core's overlay. @@ -81,16 +85,6 @@ public: RenderSurface* GetSurface(); /** - * @copydoc Dali::Window::SetIndicatorStyle() - */ - void SetIndicatorStyle( Dali::Window::IndicatorStyle style ); - - /** - * @copydoc Dali::Window::ShowIndicator() - */ - void ShowIndicator( bool show ); - - /** * @copydoc Dali::Window::ShowIndicator() */ void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode ); @@ -126,11 +120,6 @@ public: void Activate(); /** - * @copydoc Dali::Window::GetOrientation() - */ - OrientationPtr GetOrientation(); - - /** * @copydoc Dali::Window::AddAvailableOrientation() */ void AddAvailableOrientation(Dali::Window::WindowOrientation orientation); @@ -166,11 +155,30 @@ public: Dali::DragAndDropDetector GetDragAndDropDetector() const; /** + * @copydoc Dali::Window::GetNativeHandle() const + */ + Dali::Any GetNativeHandle() const; + + /** + * @brief Sets whether window accepts focus or not. + * + * @param[in] accept If focus is accepted or not. Default is true. + */ + void SetAcceptFocus( bool accept ); + + /** + * @brief Returns whether window accepts focus or not. + * + * @param[in] window The window to accept focus + * @return True if the window accept focus, false otherwise + */ + bool IsFocusAcceptable(); + + /** * Called from Orientation after the Change signal has been sent */ void RotationDone( int orientation, int width, int height ); - private: /** * Private constructor. @@ -186,7 +194,7 @@ private: /** * Second stage initialization */ - void Initialize(const PositionSize& posSize, const std::string& name); + void Initialize(const PositionSize& posSize, const std::string& name, const std::string& className); /** * Shows / hides the indicator bar. @@ -210,17 +218,22 @@ private: */ void SetIndicatorProperties( bool isShown, Dali::Window::WindowOrientation lastOrientation ); -private: // Indicator::Observer interface +private: // IndicatorInterface::Observer interface + + /** + * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorTypeChanged() + */ + virtual void IndicatorTypeChanged( IndicatorInterface::Type type ); /** - * @copydoc Dali::Internal::Adaptor::Indicator::Observer::IndicatorTypeChanged() + * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorClosed() */ - virtual void IndicatorTypeChanged( Indicator::Type type ); + virtual void IndicatorClosed( IndicatorInterface* indicator); /** - * @copydoc Dali::Internal::Adaptor::Indicator::Observer::IndicatorClosed() + * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorVisibilityChanged() */ - virtual void IndicatorClosed(Indicator* indicator); + virtual void IndicatorVisibilityChanged( bool isVisible ); private: // Adaptor::Observer interface @@ -249,19 +262,37 @@ private: // Adaptor::Observer interface */ virtual void OnDestroy(); +public: // Signals + + /** + * The user should connect to this signal to get a timing when indicator was shown / hidden. + */ + IndicatorSignalType& IndicatorVisibilityChangedSignal() { return mIndicatorVisibilityChangedSignal; } + + /** + * The user should connect to this signal to get a timing when window gains focus or loses focus. + */ + FocusSignalType& FocusChangedSignal() { return mFocusChangedSignal; } + + /** + * This signal is emitted when the window is requesting to be deleted + */ + SignalType& DeleteRequestSignal() { return mDeleteRequestSignal; } + private: - typedef std::vector DiscardedIndicators; + typedef std::vector< IndicatorInterface * > DiscardedIndicators; RenderSurface* mSurface; - Dali::Window::IndicatorStyle mIndicatorStyle; ///< indicator style Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state bool mIndicatorIsShown:1; ///< private state bool mShowRotatedIndicatorOnClose:1; bool mStarted:1; bool mIsTransparent:1; bool mWMRotationAppSet:1; - Indicator* mIndicator; + bool mEcoreEventHander:1; + bool mIsFocusAcceptable:1; + IndicatorInterface* mIndicator; Dali::Window::WindowOrientation mIndicatorOrientation; Dali::Window::WindowOrientation mNextIndicatorOrientation; Dali::Window::IndicatorBgOpacity mIndicatorOpacityMode; @@ -275,6 +306,11 @@ private: OrientationPtr mOrientation; std::vector mAvailableOrientations; Dali::Window::WindowOrientation mPreferredOrientation; + + // Signals + IndicatorSignalType mIndicatorVisibilityChangedSignal; + FocusSignalType mFocusChangedSignal; + SignalType mDeleteRequestSignal; }; } // namespace Adaptor