X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fstyling%2Fstyle-manager-impl.h;h=f0c217c1d2ea51d17ea88366432b93694105bbe1;hb=406208364fe0ee31f31f475ba7ee7709e56d3e27;hp=09d0c13d1b4675e7cb649838520425a8ba62f3c1;hpb=d04c5bdbb95cc98f90848c7a98b0b2804df6e5b8;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/styling/style-manager-impl.h b/dali-toolkit/internal/styling/style-manager-impl.h index 09d0c13..f0c217c 100644 --- a/dali-toolkit/internal/styling/style-manager-impl.h +++ b/dali-toolkit/internal/styling/style-manager-impl.h @@ -19,16 +19,16 @@ // EXTERNAL INCLUDES #include -#include -#include -#include +#include +#include +#include #include #include #include // INTERNAL INCLUDES #include -#include +#include namespace Dali { @@ -38,13 +38,15 @@ namespace Toolkit namespace Internal { + +class FeedbackStyle; + /** * @copydoc Toolkit::StyleManager */ class StyleManager : public Dali::BaseObject, public ConnectionTracker { public: - /** * Singleton access * @@ -57,25 +59,28 @@ public: */ StyleManager(); +protected: /** - * @copydoc Toolkit::StyleManager::SetOrientationValue + * @brief Destructor */ - void SetOrientationValue( int orientation ); + virtual ~StyleManager(); - /** - * @copydoc Toolkit::StyleManager::GetOrientationValue +public: // Public API + +/** + * @copydoc Toolkit::StyleManager::ApplyTheme */ - int GetOrientationValue(); + void ApplyTheme( const std::string& themeFile ); /** - * @copydoc Toolkit::StyleManager::SetOrientation( Orientation orientation ) + * @copydoc Toolkit::StyleManager::ApplyDefaultTheme */ - void SetOrientation( Orientation orientation ); + void ApplyDefaultTheme(); /** - * @copydoc Toolkit::StyleManager::GetOrientation + * @copydoc Toolkit::StyleManager::GetDefaultFontFamily */ - Orientation GetOrientation(); + const std::string& GetDefaultFontFamily() const; /** * @copydoc Toolkit::StyleManager::SetStyleConstant @@ -88,27 +93,18 @@ public: bool GetStyleConstant( const std::string& key, Property::Value& valueOut ); /** - * @copydoc Toolkit::StyleManager::RequestThemeChange - */ - void RequestThemeChange( const std::string& themeFile ); - - /** - * @copydoc Toolkit::StyleManager::RequestDefaultTheme - */ - void RequestDefaultTheme(); - - /** - * Determine if a theme change has been requested - * @return Whether a theme request is pending + * @brief Apply the theme style to a control. + * + * @param[in] control The control to apply style. */ - bool IsThemeRequestPending(); + void ApplyThemeStyle( Toolkit::Control control ); /** - * @brief Apply the theme style to a control. + * @brief Apply the theme style to a control at initialization. * * @param[in] control The control to apply style. */ - void ApplyThemeStyle( Toolkit::Control control ); + void ApplyThemeStyleAtInit( Toolkit::Control control ); /** * @copydoc Toolkit::StyleManager::ApplyStyle @@ -120,27 +116,25 @@ public: /** * @copydoc Toolkit::StyleManager::StyleChangeSignal + * This signal is sent after all the controls have been updated + * due to style change */ - Toolkit::StyleManager::StyleChangeSignalType& StyleChangeSignal(); - -protected: + Toolkit::StyleManager::StyleChangedSignalType& StyleChangedSignal(); /** - * @brief Destructor + * This signal is sent to the controls following a style change. + * It should not be exposed in the public API */ - virtual ~StyleManager(); + Toolkit::StyleManager::StyleChangedSignalType& ControlStyleChangeSignal(); - -public: +private: + typedef std::vector StringList; /** * @brief Set the current theme. Called only once per event processing cycle. + * @param[in] themeFile The name of the theme file to read. */ - void SetTheme(); - -private: - - typedef std::list StringList; + void SetTheme( const std::string& themeFile ); /** * @brief Internal helper method to read a file from file system. @@ -196,13 +190,6 @@ private: void ApplyStyle( Toolkit::Builder builder, Toolkit::Control control ); /** - * @brief Callback for orientation changes - * - * @param[in] orientation The orientation object - */ - void OnOrientationChanged( Orientation orientation ); - - /** * Search for a builder in the cache * * @param[in] key The key the builder was cached under @@ -222,9 +209,15 @@ private: * Callback for when style monitor raises a signal * * @param[in] styleMonitor The style monitor object - * @param[in] styleChange The style change data + * @param[in] styleChange The style change type + */ + void StyleMonitorChange( StyleMonitor styleMonitor, StyleChange::Type styleChange ); + + /** + * Emit signals to controls first, app second */ - void StyleMonitorChange( StyleMonitor styleMonitor, StyleChange styleChange ); + void EmitStyleChangeSignals( StyleChange::Type styleChange ); + // Undefined StyleManager(const StyleManager&); @@ -237,12 +230,10 @@ private: typedef std::map< std::string, Toolkit::Builder > BuilderMap; Toolkit::Builder mThemeBuilder; ///< Builder for all default theme properties - - Orientation mOrientation; ///< Handle to application orientation object - int mOrientationDegrees; ///< Directly set value of orientation + StyleMonitor mStyleMonitor; ///< Style monitor handle int mDefaultFontSize; ///< Logical size, not a point-size - + std::string mDefaultFontFamily; std::string mThemeFile; ///< The full path of the current theme file Property::Map mThemeBuilderConstants; ///< Contants to give the theme builder @@ -250,8 +241,11 @@ private: BuilderMap mBuilderCache; ///< Cache of builders keyed by JSON file name + Toolkit::Internal::FeedbackStyle* mFeedbackStyle; ///< Feedback style + // Signals - Toolkit::StyleManager::StyleChangeSignalType mStyleChangeSignal; ///< Emitted when the style( theme/font ) changes + Toolkit::StyleManager::StyleChangedSignalType mControlStyleChangeSignal; ///< Emitted when the style( theme/font ) changes for the controls to style themselves + Toolkit::StyleManager::StyleChangedSignalType mStyleChangedSignal; ///< Emitted after the controls have been styled }; } // namespace Internal @@ -279,4 +273,3 @@ inline const Internal::StyleManager& GetImpl( const Dali::Toolkit::StyleManager& } // namespace Dali #endif // __DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H__ -