X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fstyling%2Fstyle-manager.h;h=c2d14a374839da37d0c1fc778322c785c6e161f4;hp=7b8efbb3215374e12bacdcd86db0352f443101de;hb=HEAD;hpb=315b80da193f3ce70ffc07d3502af970ed1146b5 diff --git a/dali-toolkit/public-api/styling/style-manager.h b/dali-toolkit/public-api/styling/style-manager.h index 7b8efbb..c2d14a3 100644 --- a/dali-toolkit/public-api/styling/style-manager.h +++ b/dali-toolkit/public-api/styling/style-manager.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_STYLE_MANAGER_H__ -#define __DALI_TOOLKIT_STYLE_MANAGER_H__ +#ifndef DALI_TOOLKIT_STYLE_MANAGER_H +#define DALI_TOOLKIT_STYLE_MANAGER_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -25,10 +25,8 @@ namespace Dali { - namespace Toolkit { - namespace Internal DALI_INTERNAL { class StyleManager; @@ -54,29 +52,33 @@ class StyleManager; * If the application wants to customize the theme, RequestThemeChange * needs to be called. * + * To supply resource paths ( in json ) the following constant is available: APPLICATION_RESOURCE_PATH. + * It provides the path to the application resource root folder, from there the filename can an be specified along with + * any sub folders, e.g Images, Models etc. + * The APPLICATION_RESOURCE_PATH can be retrieved using Application::GetResourcePath() + * * Signals * | %Signal Name | Method | * |------------------------------------------------------------| * | styleChanged | @ref StyleChangedSignal() | * @SINCE_1_1.32 */ -class DALI_IMPORT_API StyleManager : public BaseHandle +class DALI_TOOLKIT_API StyleManager : public BaseHandle { public: - - /// @brief Style Changed signal. Emitted after controls have been updated - typedef Signal< void ( StyleManager, StyleChange::Type ) > StyleChangedSignalType; + /// @brief Style Changed signal. Emitted after controls have been updated. + typedef Signal StyleChangedSignalType; /** - * @brief Create a StyleManager handle; this can be initialised with StyleManager::Get() + * @brief Creates a StyleManager handle; this can be initialized with StyleManager::Get(). * - * Calling member functions with an uninitialised handle is not allowed. + * Calling member functions with an uninitialized handle is not allowed. * @SINCE_1_1.32 */ StyleManager(); /** - * @brief Destructor + * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. * @SINCE_1_1.32 @@ -84,15 +86,15 @@ public: ~StyleManager(); /** - * @brief Get the singleton of StyleManager object. + * @brief Gets the singleton of StyleManager object. * * @SINCE_1_1.32 - * @return A handle to the StyleManager control. + * @return A handle to the StyleManager control */ static StyleManager Get(); /** - * @brief Apply a new theme to the application. This will be merged + * @brief Applies a new theme to the application. This will be merged * on top of the default Toolkit theme. * * If the application theme file doesn't style all controls that the @@ -102,16 +104,16 @@ public: * On application startup, it is suggested that the theme file name is * passed to Application::New instead of using this API to prevent * controls being styled more than once. - * @sa Application::New() + * @sa Application::New(). * * @SINCE_1_1.32 * @param[in] themeFile If a relative path is specified, then this is relative - * to the directory returned by app_get_resource_path(). + * to the directory returned by Application::GetResourcePath() */ - void ApplyTheme( const std::string& themeFile ); + void ApplyTheme(const std::string& themeFile); /** - * @brief Apply the default Toolkit theme. + * @brief Applies the default Toolkit theme. * * Request that any application specific styling is removed * and that the default Toolkit theme is re-applied. @@ -121,7 +123,7 @@ public: void ApplyDefaultTheme(); /** - * @brief Set a constant for use when building styles + * @brief Sets a constant for use when building styles. * * A constant is used in JSON files e.g. "myImage":"{RELATIVE_PATH}/image.jpg" * where the string "{RELATIVE_PATH}" is substituted with the value. @@ -130,33 +132,32 @@ public: * @param[in] key The key of the constant * @param[in] value The value of the constant */ - void SetStyleConstant( const std::string& key, const Property::Value& value ); + void SetStyleConstant(const std::string& key, const Property::Value& value); /** - * @brief Return the style constant set for a specific key + * @brief Returns the style constant set for a specific key. * * @SINCE_1_1.32 * @param[in] key The key of the constant * @param[out] valueOut The value of the constant if it exists * - * @return If the constant for key exists then return the constant in valueOut and return true + * @return If the constant for key exists, then return the constant in valueOut and return true */ - bool GetStyleConstant( const std::string& key, Property::Value& valueOut ); + bool GetStyleConstant(const std::string& key, Property::Value& valueOut); /** - * @brief Apply the specified style to the control. + * @brief Applies the specified style to the control. * * @SINCE_1_1.32 - * @param[in] control The control to which to apply the style. + * @param[in] control The control to which to apply the style * @param[in] jsonFileName The name of the JSON style file to apply. If a * relative path is specified, then this is relative to the directory - * returned by app_get_resource_path(). - * @param[in] styleName The name of the style within the JSON file to apply. + * returned by Application::GetResourcePath() + * @param[in] styleName The name of the style within the JSON file to apply */ - void ApplyStyle( Toolkit::Control control, const std::string& jsonFileName, const std::string& styleName ); + void ApplyStyle(Toolkit::Control control, const std::string& jsonFileName, const std::string& styleName); public: // Signals - /** * @brief This signal is emitted after the style (e.g. theme/font change) has changed * and the controls have been informed. @@ -166,21 +167,20 @@ public: // Signals * @code * void YourCallbackName( StyleManager styleManager, StyleChange change ); * @endcode - * @return The signal to connect to. + * @return The signal to connect to */ StyleChangedSignalType& StyleChangedSignal(); public: - /// @cond internal /** * @brief Allows the creation of a StyleManager handle from an internal pointer. * * @note Not intended for application developers * @SINCE_1_1.32 - * @param[in] impl A pointer to the object. + * @param[in] impl A pointer to the object */ - explicit DALI_INTERNAL StyleManager( Internal::StyleManager *impl ); + explicit DALI_INTERNAL StyleManager(Internal::StyleManager* impl); /// @endcond }; // class StyleManager @@ -188,9 +188,9 @@ public: /** * @} */ + } // namespace Toolkit } // namespace Dali - -#endif /* __DALI_TOOLKIT_STYLE_MANAGER_H__ */ +#endif // DALI_TOOLKIT_STYLE_MANAGER_H