Tizen Native API  6.5
Dali::Toolkit::StyleManager Class Reference

StyleManager informs applications of system theme change, and supports application theme change at runtime. More...

Inheritance diagram for Dali::Toolkit::StyleManager:
Dali::BaseHandle

Public Types

typedef Signal< void(StyleManager,
StyleChange::Type) > 
StyleChangedSignalType
 Style Changed signal. Emitted after controls have been updated.

Public Member Functions

 StyleManager ()
 Creates a StyleManager handle; this can be initialized with StyleManager::Get().
 ~StyleManager ()
 Destructor.
void ApplyTheme (const std::string &themeFile)
 Applies a new theme to the application. This will be merged on top of the default Toolkit theme.
void ApplyDefaultTheme ()
 Applies the default Toolkit theme.
void SetStyleConstant (const std::string &key, const Property::Value &value)
 Sets a constant for use when building styles.
bool GetStyleConstant (const std::string &key, Property::Value &valueOut)
 Returns the style constant set for a specific key.
void ApplyStyle (Toolkit::Control control, const std::string &jsonFileName, const std::string &styleName)
 Applies the specified style to the control.
StyleChangedSignalTypeStyleChangedSignal ()
 This signal is emitted after the style (e.g. theme/font change) has changed and the controls have been informed.

Static Public Member Functions

static StyleManager Get ()
 Gets the singleton of StyleManager object.

Detailed Description

StyleManager informs applications of system theme change, and supports application theme change at runtime.

Applies various styles to Controls using the properties system.

On theme change, it automatically updates all controls, then raises a signal to inform the application.

The default theme is automatically loaded and applied, followed by any application specific theme defined in Application::New().

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 | StyleChangedSignal() |

Since:
3.0, DALi version 1.1.32

Constructor & Destructor Documentation

Creates a StyleManager handle; this can be initialized with StyleManager::Get().

Calling member functions with an uninitialized handle is not allowed.

Since:
3.0, DALi version 1.1.32

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since:
3.0, DALi version 1.1.32

Member Function Documentation

Applies the default Toolkit theme.

Request that any application specific styling is removed and that the default Toolkit theme is re-applied.

Since:
3.0, DALi version 1.1.32
void Dali::Toolkit::StyleManager::ApplyStyle ( Toolkit::Control  control,
const std::string &  jsonFileName,
const std::string &  styleName 
)

Applies the specified style to the control.

Since:
3.0, DALi version 1.1.32
Parameters:
[in]controlThe control to which to apply the style
[in]jsonFileNameThe name of the JSON style file to apply. If a relative path is specified, then this is relative to the directory returned by Application::GetResourcePath()
[in]styleNameThe name of the style within the JSON file to apply
void Dali::Toolkit::StyleManager::ApplyTheme ( const std::string &  themeFile)

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 application uses, then the default Toolkit theme will be used instead for those controls.

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.

See also:
Application::New().
Since:
3.0, DALi version 1.1.32
Parameters:
[in]themeFileIf a relative path is specified, then this is relative to the directory returned by Application::GetResourcePath()

Gets the singleton of StyleManager object.

Since:
3.0, DALi version 1.1.32
Returns:
A handle to the StyleManager control
bool Dali::Toolkit::StyleManager::GetStyleConstant ( const std::string &  key,
Property::Value valueOut 
)

Returns the style constant set for a specific key.

Since:
3.0, DALi version 1.1.32
Parameters:
[in]keyThe key of the constant
[out]valueOutThe value of the constant if it exists
Returns:
If the constant for key exists, then return the constant in valueOut and return true
void Dali::Toolkit::StyleManager::SetStyleConstant ( const std::string &  key,
const Property::Value value 
)

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.

Since:
3.0, DALi version 1.1.32
Parameters:
[in]keyThe key of the constant
[in]valueThe value of the constant

This signal is emitted after the style (e.g. theme/font change) has changed and the controls have been informed.

Since:
3.0, DALi version 1.1.32 A callback of the following type may be connected:
   void YourCallbackName( StyleManager styleManager, StyleChange change );
Returns:
The signal to connect to