X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fcommon%2Fwindow-impl.h;h=72d0b72ed9bf697a82922a4846764a0bf5b8eabc;hb=1f2153d4febc92138f74ee6b51f2007255fb90b4;hp=c4d4cf2d6c08a2312f36b5ab0494e9624188dccc;hpb=01b9a681cea72fcc4d461b4cba8e7fe08f86e856;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/common/window-impl.h b/adaptors/common/window-impl.h index c4d4cf2..72d0b72 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,20 +55,23 @@ 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 Dali::DevelWindow::ResizedSignalType ResizedSignalType; + 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] positionSize 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, const std::string& className, bool isTransparent = false); + static Window* New(const PositionSize& positionSize, 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. @@ -158,10 +161,155 @@ public: Dali::Any GetNativeHandle() const; /** + * @copydoc Dali::DevelWindow::SetAcceptFocus() + */ + void SetAcceptFocus( bool accept ); + + /** + * @copydoc Dali::DevelWindow::IsFocusAcceptable() + */ + bool IsFocusAcceptable(); + + /** + * @copydoc Dali::DevelWindow::Show() + */ + void Show(); + + /** + * @copydoc Dali::DevelWindow::Hide() + */ + void Hide(); + + /** + * @copydoc Dali::DevelWindow::IsVisible() const + */ + bool IsVisible() const; + + /** + * @copydoc Dali::DevelWindow::GetSupportedAuxiliaryHintCount() + */ + unsigned int GetSupportedAuxiliaryHintCount(); + + /** + * @copydoc Dali::DevelWindow::GetSupportedAuxiliaryHint() + */ + std::string GetSupportedAuxiliaryHint( unsigned int index ); + + /** + * @copydoc Dali::DevelWindow::AddAuxiliaryHint() + */ + unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ); + + /** + * @copydoc Dali::DevelWindow::RemoveAuxiliaryHint() + */ + bool RemoveAuxiliaryHint( unsigned int id ); + + /** + * @copydoc Dali::DevelWindow::SetAuxiliaryHintValue() + */ + bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ); + + /** + * @copydoc Dali::DevelWindow::GetAuxiliaryHintValue() + */ + std::string GetAuxiliaryHintValue( unsigned int id ) const; + + /** + * @copydoc Dali::DevelWindow::GetAuxiliaryHintId() + */ + unsigned int GetAuxiliaryHintId( const std::string& hint ) const; + + /** + * @copydoc Dali::DevelWindow::SetInputRegion() + */ + void SetInputRegion( const Rect< int >& inputRegion ); + + /** + * @copydoc Dali::DevelWindow::SetType() + */ + void SetType( Dali::DevelWindow::Type type ); + + /** + * @copydoc Dali::DevelWindow::GetType() const + */ + Dali::DevelWindow::Type GetType() const; + + /** + * @copydoc Dali::DevelWindow::SetNotificationLevel() + */ + bool SetNotificationLevel( Dali::DevelWindow::NotificationLevel::Type level ); + + /** + * @copydoc Dali::DevelWindow::GetNotificationLevel() + */ + Dali::DevelWindow::NotificationLevel::Type GetNotificationLevel(); + + /** + * @copydoc Dali::DevelWindow::SetOpaqueState() + */ + void SetOpaqueState( bool opaque ); + + /** + * @copydoc Dali::DevelWindow::IsOpaqueState() + */ + bool IsOpaqueState(); + + /** + * @copydoc Dali::DevelWindow::SetScreenMode() + */ + bool SetScreenMode( Dali::DevelWindow::ScreenMode::Type screenMode ); + + /** + * @copydoc Dali::DevelWindow::GetScreenMode() + */ + Dali::DevelWindow::ScreenMode::Type GetScreenMode(); + + /** + * @copydoc Dali::DevelWindow::SetBrightness() + */ + bool SetBrightness( int brightness ); + + /** + * @copydoc Dali::DevelWindow::GetBrightness() + */ + int GetBrightness(); + + /** + * @copydoc Dali::DevelWindow::SetSize() + */ + void SetSize( Dali::DevelWindow::WindowSize size ); + + /** + * @copydoc Dali::DevelWindow::GetSize() + */ + Dali::DevelWindow::WindowSize GetSize(); + + /** + * @copydoc Dali::DevelWindow::SetPosition() + */ + void SetPosition( Dali::DevelWindow::WindowPosition position ); + + /** + * @copydoc Dali::DevelWindow::GetPosition() + */ + Dali::DevelWindow::WindowPosition GetPosition(); + + /** + * @copydoc Dali::DevelWindow::SetTransparency() + */ + void SetTransparency( bool transparent ); + + /** * Called from Orientation after the Change signal has been sent */ void RotationDone( int orientation, int width, int height ); + /** + * Set the indicator visible mode + */ + void SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode ); + private: /** * Private constructor. @@ -177,7 +325,7 @@ private: /** * Second stage initialization */ - void Initialize(const PositionSize& posSize, const std::string& name, const std::string& className); + void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className); /** * Shows / hides the indicator bar. @@ -201,20 +349,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 ); @@ -246,14 +394,30 @@ 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; } + /** + * @copydoc Dali::DevelWindow::FocusChangedSignal() + */ + FocusSignalType& FocusChangedSignal() { return mFocusChangedSignal; } + + /** + * @copydoc Dali::DevelWindow::ResizedSignal() + */ + ResizedSignalType& ResizedSignal() { return mResizedSignal; } + + /** + * This signal is emitted when the window is requesting to be deleted + */ + SignalType& DeleteRequestSignal() { return mDeleteRequestSignal; } + private: - typedef std::vector DiscardedIndicators; + typedef std::vector< std::pair< std::string, std::string > > AuxiliaryHints; RenderSurface* mSurface; Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state @@ -263,13 +427,18 @@ private: bool mIsTransparent:1; bool mWMRotationAppSet:1; bool mEcoreEventHander:1; - Indicator* mIndicator; + bool mIsFocusAcceptable:1; + bool mVisible:1; + bool mOpaqueState:1; + bool mResizeEnabled:1; + IndicatorInterface* mIndicator; Dali::Window::WindowOrientation mIndicatorOrientation; Dali::Window::WindowOrientation mNextIndicatorOrientation; Dali::Window::IndicatorBgOpacity mIndicatorOpacityMode; Integration::SystemOverlay* mOverlay; Adaptor* mAdaptor; Dali::DragAndDropDetector mDragAndDropDetector; + Dali::DevelWindow::Type mType; struct EventHandler; EventHandler* mEventHandler; @@ -278,8 +447,14 @@ private: std::vector mAvailableOrientations; Dali::Window::WindowOrientation mPreferredOrientation; + std::vector< std::string > mSupportedAuxiliaryHints; + AuxiliaryHints mAuxiliaryHints; + // Signals IndicatorSignalType mIndicatorVisibilityChangedSignal; + FocusSignalType mFocusChangedSignal; + ResizedSignalType mResizedSignal; + SignalType mDeleteRequestSignal; }; } // namespace Adaptor