Crazy Eddie's GUI System  0.8.6
CEGUI::WidgetLookManager Class Reference

Manager class that gives top-level access to widget data based "look and feel" specifications loaded into the system. More...

+ Inheritance diagram for CEGUI::WidgetLookManager:
+ Collaboration diagram for CEGUI::WidgetLookManager:

Public Types

typedef std::set< String, StringFastLessCompare CEGUI_SET_ALLOC(String)> WidgetLookNameSet
 
typedef std::map< String, WidgetLookFeel *, StringFastLessCompare CEGUI_MAP_ALLOC(String, WidgetLookFeel *)> WidgetLookPointerMap
 Typedef for a map of Strings to WidgetLookFeel objects.
 
typedef ConstMapIterator< WidgetLookList > WidgetLookIterator
 

Public Member Functions

 WidgetLookManager ()
 Constructor.
 
 ~WidgetLookManager ()
 Destructor.
 
void parseLookNFeelSpecificationFromContainer (const RawDataContainer &source)
 Parses a file containing window look & feel specifications (in the form of XML). More...
 
void parseLookNFeelSpecificationFromFile (const String &filename, const String &resourceGroup="")
 
void parseLookNFeelSpecificationFromString (const String &source)
 
bool isWidgetLookAvailable (const String &widget) const
 Return whether a WidgetLookFeel has been created with the specified name. More...
 
const WidgetLookFeelgetWidgetLook (const String &widget) const
 Return a const reference to a WidgetLookFeel object which has the specified name. More...
 
void eraseWidgetLook (const String &widget)
 Erase the WidgetLookFeel that has the specified name. More...
 
void eraseAllWidgetLooks ()
 erase all defined WidgetLookFeel.
 
void addWidgetLook (const WidgetLookFeel &look)
 Add the given WidgetLookFeel. More...
 
void writeWidgetLookToStream (const String &widgetLookName, OutStream &out_stream) const
 Writes a complete WidgetLookFeel to a stream. Note that XML file header and Falagard opening/closing tags will also be written. More...
 
String getWidgetLookAsString (const String &widgetLookName) const
 Writes a complete WidgetLookFeel to a string. Note that XML file header and Falagard opening/closing tags will also be written. More...
 
String getWidgetLookSetAsString (const WidgetLookNameSet &widgetLookNameSet) const
 Writes a set WidgetLookFeels to a string. Note that XML file header and Falagard opening/closing tags will also be written. More...
 
void writeWidgetLookSeriesToStream (const String &prefix, OutStream &out_stream) const
 Writes a series of complete WidgetLook objects to a stream. Note that XML file header and Falagard opening/closing tags will also be written. More...
 
void writeWidgetLookSetToStream (const WidgetLookNameSet &widgetLookNameSet, OutStream &out_stream) const
 Writes a series of complete WidgetLook objects to a stream. Note that XML file header and Falagard opening/closing tags will also be written. More...
 
WidgetLookPointerMap getWidgetLookPointerMap ()
 Returns a map containing Strings to WidgetLookFeel pointers. The map contains pointers to the WidgetLookFeels that were added to this Manager. More...
 
WidgetLookIterator getWidgetLookIterator () const
 

Static Public Member Functions

static WidgetLookManagergetSingleton (void)
 Return singleton WidgetLookManager object. More...
 
static WidgetLookManagergetSingletonPtr (void)
 Return pointer to singleton WidgetLookManager object. More...
 
static const StringgetDefaultResourceGroup ()
 Returns the default resource group currently set for LookNFeels. More...
 
static void setDefaultResourceGroup (const String &resourceGroup)
 Sets the default resource group to be used when loading LookNFeel data. More...
 
- Static Public Member Functions inherited from CEGUI::Singleton< WidgetLookManager >
static WidgetLookManagergetSingleton (void)
 
static WidgetLookManagergetSingletonPtr (void)
 

Additional Inherited Members

- Static Protected Attributes inherited from CEGUI::Singleton< WidgetLookManager >
static WidgetLookManagerms_Singleton
 

Detailed Description

Manager class that gives top-level access to widget data based "look and feel" specifications loaded into the system.

Member Typedef Documentation

Deprecated:
Use WidgetLookPointerMap instead, which provides direct access to the added elements.

Typedef for a set of WidgetLookFeel names.

Member Function Documentation

void CEGUI::WidgetLookManager::addWidgetLook ( const WidgetLookFeel look)

Add the given WidgetLookFeel.

Note
If the WidgetLookFeel specification uses a name that already exists within the system, it is not an error; the previous definition is overwritten by the new data. An entry will appear in the log each time any look & feel component is overwritten.
Parameters
lookWidgetLookFeel object to be added to the system. NB: The WidgetLookFeel is copied, no change of ownership of the input object occurrs.
Returns
Nothing.
void CEGUI::WidgetLookManager::eraseWidgetLook ( const String widget)

Erase the WidgetLookFeel that has the specified name.

Parameters
widgetString object holding the name of a widget look to be erased. If no such WidgetLookFeel exists, nothing happens.
Returns
Nothing.
static const String& CEGUI::WidgetLookManager::getDefaultResourceGroup ( )
inlinestatic

Returns the default resource group currently set for LookNFeels.

Returns
String describing the default resource group identifier that will be used when loading LookNFeel data.
static WidgetLookManager& CEGUI::WidgetLookManager::getSingleton ( void  )
static

Return singleton WidgetLookManager object.

Returns
Singleton WidgetLookManager object
static WidgetLookManager* CEGUI::WidgetLookManager::getSingletonPtr ( void  )
static

Return pointer to singleton WidgetLookManager object.

Returns
Pointer to singleton WidgetLookManager object
const WidgetLookFeel& CEGUI::WidgetLookManager::getWidgetLook ( const String widget) const

Return a const reference to a WidgetLookFeel object which has the specified name.

Parameters
widgetString object holding the name of a widget look that is to be returned.
Returns
const reference to the requested WidgetLookFeel object.
Exceptions
UnknownObjectExceptionthrown if no WidgetLookFeel is available with the requested name.
String CEGUI::WidgetLookManager::getWidgetLookAsString ( const String widgetLookName) const

Writes a complete WidgetLookFeel to a string. Note that XML file header and Falagard opening/closing tags will also be written.

Parameters
nameString holding the name of the WidgetLookFeel to be output to the string.
Returns
String containing the WidgetLook parsed to XML.
WidgetLookIterator CEGUI::WidgetLookManager::getWidgetLookIterator ( ) const
Deprecated:
Use getWidgetLookPointerMap instead, which provides direct access to the added elements. In the next version getWidgetLookMap will be added to replace the const-ness.
WidgetLookPointerMap CEGUI::WidgetLookManager::getWidgetLookPointerMap ( )

Returns a map containing Strings to WidgetLookFeel pointers. The map contains pointers to the WidgetLookFeels that were added to this Manager.

Returns
A map of Strings to WidgetLookFeel pointers.
String CEGUI::WidgetLookManager::getWidgetLookSetAsString ( const WidgetLookNameSet widgetLookNameSet) const

Writes a set WidgetLookFeels to a string. Note that XML file header and Falagard opening/closing tags will also be written.

Parameters
widgetLookNameSetSet of strings containing the WidgetLookFeel names to be output to the string.
Returns
String containing the set of WidgetLookFeels parsed to XML.
bool CEGUI::WidgetLookManager::isWidgetLookAvailable ( const String widget) const

Return whether a WidgetLookFeel has been created with the specified name.

Parameters
widgetString object holding the name of a widget look to test for.
Returns
void CEGUI::WidgetLookManager::parseLookNFeelSpecificationFromContainer ( const RawDataContainer source)

Parses a file containing window look & feel specifications (in the form of XML).

Note
If the new file contains specifications for widget types that are already specified, it is not an error; the previous definitions are overwritten by the new data. An entry will appear in the log each time any look & feel component is overwritten.
Parameters
sourceRawDataContainer containing the source code that will be parsed
resourceGroupResource group identifier to pass to the resource provider when loading the file.
Returns
Nothing.
Exceptions
FileIOExceptionthrown if there was some problem accessing or parsing the file filename
InvalidRequestExceptionthrown if an invalid filename was provided.
void CEGUI::WidgetLookManager::parseLookNFeelSpecificationFromFile ( const String filename,
const String resourceGroup = "" 
)
void CEGUI::WidgetLookManager::parseLookNFeelSpecificationFromString ( const String source)
static void CEGUI::WidgetLookManager::setDefaultResourceGroup ( const String resourceGroup)
inlinestatic

Sets the default resource group to be used when loading LookNFeel data.

Parameters
resourceGroupString describing the default resource group identifier to be used.
Returns
Nothing.
void CEGUI::WidgetLookManager::writeWidgetLookSeriesToStream ( const String prefix,
OutStream out_stream 
) const

Writes a series of complete WidgetLook objects to a stream. Note that XML file header and Falagard opening/closing tags will also be written.

The prefix specifies a name prefix common to all widget looks to be written, you could specify this as "TaharezLook/" and then any defined widget look starting with that prefix, such as "TaharezLook/Button" and "TaharezLook/Listbox" will be written to the stream.

Parameters
prefixString holding the widget look name prefix, which will be used when searching for the widget looks to be output to the stream.
out_streamOutStream where XML data should be sent.
void CEGUI::WidgetLookManager::writeWidgetLookSetToStream ( const WidgetLookNameSet widgetLookNameSet,
OutStream out_stream 
) const

Writes a series of complete WidgetLook objects to a stream. Note that XML file header and Falagard opening/closing tags will also be written.

The widgetLookSet specifies a set of strings containing the names of the WidgetLookFeels to be written to the stream.

Parameters
widgetLookNameSetSet of strings containing the WidgetLookFeel names to be added to be written to the stream.
out_streamOutStream where XML data should be sent.
void CEGUI::WidgetLookManager::writeWidgetLookToStream ( const String widgetLookName,
OutStream out_stream 
) const

Writes a complete WidgetLookFeel to a stream. Note that XML file header and Falagard opening/closing tags will also be written.

Parameters
nameString holding the name of the WidgetLookFeel to be output to the stream.
out_streamOutStream where XML data should be sent.