#include <uifiletheme.h>
Inheritance diagram for UiFileTheme:
Public Member Functions | |
DECLSPEC | UiFileTheme (const char *fn, const char *name=0) |
virtual DECLSPEC const char * | getString (const char *usage, int *length=0) |
virtual DECLSPEC Uint32 | getUint32 (const char *usage, bool *found=0) |
virtual DECLSPEC bool | getBool (const char *usage, bool *found=0) |
virtual DECLSPEC SDL_Rect | getRect (const char *usage) |
virtual DECLSPEC const char * | translate (const char *text) |
Protected Member Functions | |
virtual DECLSPEC Uint32 | onLoad (bool hidden) |
virtual DECLSPEC Uint32 | onActivate () |
virtual DECLSPEC Uint32 | onDeactivate () |
virtual bool | isLoaded () |
Classes | |
struct | FONTINFO |
struct | INFO |
This class makes it very easy to use and edit themes, because it loads the data for look and feel from a text based file. This can easily be configured with any text editor.
Also translating text is done by a text based file, using UiFileTranslator.
UiFileTheme::UiFileTheme | ( | const char * | fn, | |
const char * | name = 0 | |||
) |
Constructor.
fn | the filename of the theme's configuration data | |
name | the theme's name |
const char * UiFileTheme::getString | ( | const char * | usage, | |
int * | length = 0 | |||
) | [virtual] |
Get a theme-specific string.
usage | a string that says what for the result is needed. | |
length | if not NULL, the length of the string will be copied there or zero, if the usage-string is invalid |
Implements UiTheme.
Uint32 UiFileTheme::getUint32 | ( | const char * | usage, | |
bool * | found = 0 | |||
) | [virtual] |
Get a theme-specific number.
usage | a string that says what for the result is needed. | |
found | if not NULL, it's content will become true, if the "usage" could be found and false, if it could not be found |
Implements UiTheme.
bool UiFileTheme::getBool | ( | const char * | usage, | |
bool * | found = 0 | |||
) | [virtual] |
Get a theme-specific boolean value.
usage | a string that says what for the result is needed. | |
found | if not NULL, it's content will become true, if the "usage" could be found and false, if it could not be found |
Implements UiTheme.
SDL_Rect UiFileTheme::getRect | ( | const char * | usage | ) | [virtual] |
Get a theme-specific rect.
usage | a string that says what for the result is needed. |
Implements UiTheme.
const char * UiFileTheme::translate | ( | const char * | text | ) | [virtual] |
Translates a text-string to the theme's language.
text | the string to translate (NULL not allowed!) |
Implements UiTheme.
Uint32 UiFileTheme::onLoad | ( | bool | hidden | ) | [protected, virtual] |
This event will be called, when the theme should load it's data.
hidden | if true, the screen is not used to display a progressbar/...; if false the progress may be shown by the loading theme |
Implements UiTheme.
Uint32 UiFileTheme::onActivate | ( | ) | [protected, virtual] |
This event will be called, before the theme becomes active.
Implements UiTheme.
Uint32 UiFileTheme::onDeactivate | ( | ) | [protected, virtual] |
This event will be called, when the theme becomes inactive.
Implements UiTheme.
virtual bool UiFileTheme::isLoaded | ( | ) | [inline, protected, virtual] |