X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-impl.h;h=0d4a4e10e689b38e97d2a13e9575ee1837ee074c;hb=6e77f2f2c059b23e19ee8387397192431a88232a;hp=be1a6400e639ac9397ff3bb910ad7318c2180faa;hpb=0885e9f94bfce21125909f53af293360ff59c0b0;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index be1a640..0d4a4e1 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -23,6 +23,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -67,7 +68,7 @@ public: typedef Signal< void () > SignalType; /** - * Create a new Window. This should only be called once by the Application class + * @brief Create a new Window. This should only be called once by the Application class * @param[in] positionSize The position and size of the window * @param[in] name The window title * @param[in] className The window class name @@ -77,6 +78,17 @@ public: static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false); /** + * @brief Create a new Window. This should only be called once by the Application class + * @param[in] surface The surface used to render on. + * @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(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false); + + /** * @copydoc Dali::Window::ShowIndicator() */ void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode ); @@ -143,16 +155,6 @@ public: void RemoveAvailableOrientation(Dali::Window::WindowOrientation orientation); /** - * @copydoc Dali::Window::SetAvailableOrientations() - */ - void SetAvailableOrientations(const std::vector& orientations); - - /** - * @copydoc Dali::Window::GetAvailableOrientations() - */ - const std::vector& GetAvailableOrientations(); - - /** * @copydoc Dali::Window::SetPreferredOrientation() */ void SetPreferredOrientation(Dali::Window::WindowOrientation orientation); @@ -347,6 +349,16 @@ public: */ Dali::Window GetParent(); + /** + * @copydoc Dali::DevelWindow::GetCurrentOrientation() + */ + Dali::Window::WindowOrientation GetCurrentOrientation() const; + + /** + * @copydoc Dali::DevelWindow::SetAvailableOrientations() + */ + void SetAvailableOrientations( const Dali::Vector& orientations ); + public: // Dali::Internal::Adaptor::SceneHolder /** @@ -362,6 +374,18 @@ public: // Dali::Internal::Adaptor::SceneHolder private: /** + * @brief Enumeration for orietation mode. + * The Orientation Mode is related to screen size. + * If screen width is longer than height, the Orientation Mode will have LANDSCAPE. + * Otherwise screen width is shorter than height or same, the Orientation Mode will have PORTRAIT. + */ + enum class OrientationMode + { + PORTRAIT = 0, + LANDSCAPE + }; + + /** * Private constructor. * @sa Window::New() */ @@ -375,7 +399,7 @@ private: /** * Second stage initialization */ - void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className); + void Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className); /** * Called when the window becomes iconified or deiconified. @@ -402,6 +426,26 @@ private: */ void OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type ); + /** + * @brief Set available orientation to window base. + */ + void SetAvailableAnlges( const std::vector< int >& angles ); + + /** + * @brief Convert from window orientation to angle using OrientationMode. + */ + int ConvertToAngle( Dali::Window::WindowOrientation orientation ); + + /** + * @brief Convert from angle to window orientation using OrientationMode. + */ + Dali::Window::WindowOrientation ConvertToOrientation( int angle ) const; + + /** + * @brief Check available window orientation for Available orientation. + */ + bool IsOrientationAvailable( Dali::Window::WindowOrientation orientation ) const; + private: // Dali::Internal::Adaptor::SceneHolder /** @@ -511,9 +555,9 @@ private: Dali::Window::Type mType; Dali::Window mParentWindow; - OrientationPtr mOrientation; - std::vector mAvailableOrientations; - Dali::Window::WindowOrientation mPreferredOrientation; + OrientationPtr mOrientation; + std::vector< int > mAvailableAngles; + int mPreferredAngle; int mRotationAngle; ///< The angle of the rotation int mWindowWidth; ///< The width of the window @@ -521,6 +565,10 @@ private: EventHandlerPtr mEventHandler; ///< The window events handler + OrientationMode mOrientationMode; + + int mNativeWindowId; ///< The Native Window Id + // Signals IndicatorSignalType mIndicatorVisibilityChangedSignal; FocusSignalType mFocusChangedSignal;