X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fcommon%2Fwindow-impl.h;h=0cf251bcc1025f73cfb0eaa4ab52981dbb2468bd;hb=f1cdfb2f2d85972113d8bb16a775e84aed03d669;hp=d1403b58f271b8484ebf1d59b2dc13c0102f2de8;hpb=7f3341b2da0e085639752b68e41a4230428ac737;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/common/window-impl.h b/adaptors/common/window-impl.h index d1403b5..0cf251b 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. @@ -24,12 +24,13 @@ // INTERNAL INCLUDES #include +#include #include -#include #include #include #include #include +#include namespace Dali { @@ -45,7 +46,6 @@ namespace Internal { namespace Adaptor { -class Indicator; class Orientation; class Window; @@ -55,10 +55,11 @@ 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; /** @@ -159,6 +160,37 @@ public: 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(); + + /** + * @brief Shows the window if it is hidden. + */ + void Show(); + + /** + * @brief Hides the window if it is showing. + */ + void Hide(); + + /** + * @brief Returns whether the window is showing or not. + * @return True if the window is showing, false otherwise. + */ + bool IsVisible() const; + + /** * Called from Orientation after the Change signal has been sent */ void RotationDone( int orientation, int width, int height ); @@ -202,20 +234,20 @@ private: */ void SetIndicatorProperties( bool isShown, Dali::Window::WindowOrientation lastOrientation ); -private: // Indicator::Observer interface +private: // IndicatorInterface::Observer interface /** - * @copydoc Dali::Internal::Adaptor::Indicator::Observer::IndicatorTypeChanged() + * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorTypeChanged() */ - virtual void IndicatorTypeChanged( Indicator::Type type ); + virtual void IndicatorTypeChanged( IndicatorInterface::Type type ); /** - * @copydoc Dali::Internal::Adaptor::Indicator::Observer::IndicatorClosed() + * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorClosed() */ - virtual void IndicatorClosed(Indicator* indicator); + virtual void IndicatorClosed( IndicatorInterface* indicator); /** - * @copydoc Dali::Internal::Adaptor::Indicator::Observer::IndicatorVisibilityChanged() + * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorVisibilityChanged() */ virtual void IndicatorVisibilityChanged( bool isVisible ); @@ -254,13 +286,18 @@ public: // Signals 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::IndicatorVisibleMode mIndicatorVisible; ///< public state @@ -270,7 +307,9 @@ private: bool mIsTransparent:1; bool mWMRotationAppSet:1; bool mEcoreEventHander:1; - Indicator* mIndicator; + bool mIsFocusAcceptable:1; + bool mVisible:1; + IndicatorInterface* mIndicator; Dali::Window::WindowOrientation mIndicatorOrientation; Dali::Window::WindowOrientation mNextIndicatorOrientation; Dali::Window::IndicatorBgOpacity mIndicatorOpacityMode; @@ -287,6 +326,7 @@ private: // Signals IndicatorSignalType mIndicatorVisibilityChangedSignal; + FocusSignalType mFocusChangedSignal; SignalType mDeleteRequestSignal; };