UiTheme Class Reference
[User interface]

Base class for all themes, used for easy change of look and feel. More...

#include <uitheme.h>

Inheritance diagram for UiTheme:

Inheritance graph
[legend]
List of all members.

Public Member Functions

DECLSPEC UiTheme (const char *name)
virtual const char * getString (const char *usage, int *length=0)=0
virtual Uint32 getUint32 (const char *usage, bool *found=0)=0
virtual bool getBool (const char *usage, bool *found=0)=0
virtual SDL_Rect getRect (const char *usage)=0
virtual const char * translate (const char *text)=0
const char * getName () const

Protected Member Functions

virtual Uint32 onLoad (bool hidden)=0
virtual Uint32 onActivate ()=0
virtual Uint32 onDeactivate ()=0
virtual bool isLoaded ()=0

Friends

class ThemeManager

Detailed Description

Base class for all themes, used for easy change of look and feel.

All classes, derived from UiTheme, are managed by ThemeManager to handle themes.

See also:
ThemeManager


Constructor & Destructor Documentation

UiTheme::UiTheme ( const char *  name  ) 

Constructor. Registers itself in the ThemeManager with it's name.

Parameters:
name The theme's name, that can be used to get the theme by using ThemeManager::getThemeByName


Member Function Documentation

virtual const char* UiTheme::getString ( const char *  usage,
int *  length = 0 
) [pure virtual]

Get a theme-specific string.

Parameters:
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
Returns:
a string with the data or NULL, if the usage-string could not be found

Implemented in UiFileTheme.

virtual Uint32 UiTheme::getUint32 ( const char *  usage,
bool *  found = 0 
) [pure virtual]

Get a theme-specific number.

Parameters:
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
Returns:
the corresponding number to "usage" and zero, if "usage" was not found

Implemented in UiFileTheme.

virtual bool UiTheme::getBool ( const char *  usage,
bool *  found = 0 
) [pure virtual]

Get a theme-specific boolean value.

Parameters:
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
Returns:
the corresponding value to "usage" and always false, if "usage" was not found

Implemented in UiFileTheme.

virtual SDL_Rect UiTheme::getRect ( const char *  usage  )  [pure virtual]

Get a theme-specific rect.

Parameters:
usage a string that says what for the result is needed.
Returns:
the corresponding rect to "usage", or an empty rect, if "usage" was not found

Implemented in UiFileTheme.

virtual const char* UiTheme::translate ( const char *  text  )  [pure virtual]

Translates a text-string to the theme's language.

Parameters:
text the string to translate (NULL not allowed!)
Returns:
the translated string or text, if it could not be translated. Never returns NULL!
See also:
UiTranslator

Implemented in UiFileTheme.

const char* UiTheme::getName (  )  const [inline]

Returns:
the theme's name, with which is was created
See also:
UiTheme( const char * )

virtual Uint32 UiTheme::onLoad ( bool  hidden  )  [protected, pure virtual]

This event will be called, when the theme should load it's data.

Parameters:
hidden if true, the screen is not used to display a progressbar/...; if false the progress may be shown by the loading theme
Returns:
zero, if everything could be loaded successfully, and anything else, if it failed

Implemented in UiFileTheme.

virtual Uint32 UiTheme::onActivate (  )  [protected, pure virtual]

This event will be called, before the theme becomes active.

Returns:
zero, if it can be used now, and anything else, if not

Implemented in UiFileTheme.

virtual Uint32 UiTheme::onDeactivate (  )  [protected, pure virtual]

This event will be called, when the theme becomes inactive.

Returns:
zero (recommended), but the result is currently not used

Implemented in UiFileTheme.

virtual bool UiTheme::isLoaded (  )  [protected, pure virtual]

Returns:
true, if the theme's data is loaded, false if not

Implemented in UiFileTheme.


The documentation for this class was generated from the following files:
Generated on Wed May 9 17:36:37 2007 for netrinjo by  doxygen 1.5.1