X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fstyling%2Fstyle-manager-impl.h;h=7ca7535d01dc689695dc457ba49a0df78127f93a;hp=294e601502689753a67eac468517387903872032;hb=b694e7e2ae624e206e1548b1a863c554eb9cd4d7;hpb=8e3247866b55d0a5fbc361169eec6d40228e4fdf diff --git a/dali-toolkit/internal/styling/style-manager-impl.h b/dali-toolkit/internal/styling/style-manager-impl.h index 294e601..7ca7535 100644 --- a/dali-toolkit/internal/styling/style-manager-impl.h +++ b/dali-toolkit/internal/styling/style-manager-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H__ -#define __DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H__ +#ifndef DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H +#define DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -27,8 +27,9 @@ #include // INTERNAL INCLUDES -#include +#include #include +#include namespace Dali { @@ -68,29 +69,19 @@ protected: public: // Public API /** - * @copydoc Toolkit::StyleManager::SetOrientationValue + * @copydoc Toolkit::StyleManager::ApplyTheme */ - void SetOrientationValue( int orientation ); + void ApplyTheme( const std::string& themeFile ); /** - * @copydoc Toolkit::StyleManager::GetOrientationValue + * @copydoc Toolkit::StyleManager::ApplyDefaultTheme */ - int GetOrientationValue(); - - /** - * @copydoc Toolkit::StyleManager::SetOrientation( Orientation orientation ) - */ - void SetOrientation( Orientation orientation ); - - /** - * @copydoc Toolkit::StyleManager::GetOrientation - */ - Orientation GetOrientation(); + void ApplyDefaultTheme(); /** * @copydoc Toolkit::StyleManager::GetDefaultFontFamily */ - std::string GetDefaultFontFamily() const; + const std::string& GetDefaultFontFamily() const; /** * @copydoc Toolkit::StyleManager::SetStyleConstant @@ -103,14 +94,9 @@ public: // Public API bool GetStyleConstant( const std::string& key, Property::Value& valueOut ); /** - * @copydoc Toolkit::StyleManager::RequestThemeChange - */ - void RequestThemeChange( const std::string& themeFile ); - - /** - * @copydoc Toolkit::StyleManager::RequestDefaultTheme + * @copydoc Toolkit::StyleManager::GetConfigurations */ - void RequestDefaultTheme(); + const Property::Map GetConfigurations(); /** * @brief Apply the theme style to a control. @@ -131,13 +117,28 @@ public: // Public API */ void ApplyStyle( Toolkit::Control control, const std::string& jsonFileName, const std::string& styleName ); + /** + * Get the state/style information for the given control + * @param[in] control The control to get state information for + * @return The style information (or empty ptr if not found) + */ + const StylePtr GetRecordedStyle( Toolkit::Control control ); + public: // SIGNALS /** * @copydoc Toolkit::StyleManager::StyleChangeSignal + * This signal is sent after all the controls have been updated + * due to style change + */ + Toolkit::StyleManager::StyleChangedSignalType& StyleChangedSignal(); + + /** + * This signal is sent to the controls following a style change. + * It should not be exposed in the public API */ - Toolkit::StyleManager::StyleChangeSignalType& StyleChangeSignal(); + Toolkit::StyleManager::StyleChangedSignalType& ControlStyleChangeSignal(); private: typedef std::vector StringList; @@ -176,24 +177,6 @@ private: bool LoadJSON( Toolkit::Builder builder, const std::string& jsonFileName ); /** - * @brief Collect qualifiers (e.g. Landscape, portrait etc) for a given style - * - * @param[in,out] qualifiersOut The list to populate with qualifiers - */ - void CollectQualifiers( StringList& qualifiersOut ); - - /** - * @brief Construct a qualified style name out of qualifiers - * - * A qualifed style name will be in the format: style-qualifier0-qualifier1-qualifierN - * - * @param[in] styleName The root name of the style - * @param[in] qualifiers List of qualifier names - * @param[out] qualifiedStyleOut The qualified style name - */ - void BuildQualifiedStyleName( const std::string& styleName, const StringList& qualifiers, std::string& qualifiedStyleOut ); - - /** * @brief Apply a style to the control using the given builder * * @param[in] builder The builder to apply the style from @@ -202,13 +185,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 @@ -232,6 +208,12 @@ private: */ void StyleMonitorChange( StyleMonitor styleMonitor, StyleChange::Type styleChange ); + /** + * Emit signals to controls first, app second + */ + void EmitStyleChangeSignals( StyleChange::Type styleChange ); + + // Undefined StyleManager(const StyleManager&); @@ -245,9 +227,6 @@ private: Toolkit::Builder mThemeBuilder; ///< Builder for all default theme properties StyleMonitor mStyleMonitor; ///< Style monitor handle - Orientation mOrientation; ///< Handle to application orientation object - int mOrientationDegrees; ///< Directly set value of orientation - int mDefaultFontSize; ///< Logical size, not a point-size std::string mDefaultFontFamily; std::string mThemeFile; ///< The full path of the current theme file @@ -260,7 +239,8 @@ private: 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 @@ -287,4 +267,4 @@ inline const Internal::StyleManager& GetImpl( const Dali::Toolkit::StyleManager& } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H__ +#endif // DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H