#include <thememanager.h>
Collaboration diagram for ThemeManager:
Public Types | |
enum | LoadScheme { lsOnAppStart, lsOnActivate } |
Public Member Functions | |
DECLSPEC | ThemeManager (LoadScheme ls) |
DECLSPEC bool | setActiveTheme (UiTheme *t, bool hidden) |
DECLSPEC void | setLoadScheme (LoadScheme ls) |
UiTheme * | getActiveTheme () |
DECLSPEC UiTheme * | getThemeByName (const char *name) |
Static Public Member Functions | |
static DECLSPEC ThemeManager * | getThe () |
Static Public Attributes | |
static ThemeManager * | the |
Friends | |
class | UiTheme |
Using themes makes it easier to change the look and feel of an application. ThemeManager is the central for all used themes. Every variable of a class derved from UiTheme will be registered here and can become active when required.
This class can only be used in one variable at a time. So do not initialize it more than once, but it is required once, if you use themes.
lsOnAppStart: Theme will be loaded, when it is created (usually at app-start), so starting the app will take longer lsOnActivate: Theme will be loaded, directly before it becomes active, so activating a theme will take longer
ThemeManager::ThemeManager | ( | LoadScheme | ls | ) |
Constructor
ls | specifies, when to load the themes' data |
bool ThemeManager::setActiveTheme | ( | UiTheme * | t, | |
bool | hidden | |||
) |
Activates a theme
t | The theme to activate | |
hidden | if true, there is no progress shown to the user; if false, a progressbar may be shown |
void ThemeManager::setLoadScheme | ( | LoadScheme | ls | ) |
Change the load scheme of themes
ls | specifies, when to load the themes' data, if ls is lsOnAppStart, then all themes will be loaded immediatelly if it is lsOnActivate, there will be probably no changes, because all themes have already been loaded; this makes sense only, if a theme is created afterwards |
UiTheme* ThemeManager::getActiveTheme | ( | ) | [inline] |
Use this function in GUI or UI classes, to get the look and feel for your element
UiTheme * ThemeManager::getThemeByName | ( | const char * | name | ) |
name | the name of the theme as returned by UiTheme::getName() |
ThemeManager * ThemeManager::getThe | ( | ) | [static] |
ThemeManager * ThemeManager::the [static] |
only accessible in Linux, and equals the result of getThe()