Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CEGUI::WindowFactoryManager Class Reference

Class that manages WindowFactory objects. More...

#include <CEGUIWindowFactoryManager.h>

Inheritance diagram for CEGUI::WindowFactoryManager:

Inheritance graph
[legend]
Collaboration diagram for CEGUI::WindowFactoryManager:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ConstBaseIterator<
WindowFactoryRegistry > 
WindowFactoryIterator
typedef ConstBaseIterator<
TypeAliasRegistry > 
TypeAliasIterator
typedef ConstBaseIterator<
FalagardMapRegistry > 
FalagardMappingIterator

Public Member Functions

 WindowFactoryManager (void)
 Constructs a new WindowFactoryManager object.
 ~WindowFactoryManager (void)
 Destructor for WindowFactoryManager objects.
void addFactory (WindowFactory *factory)
 Adds a new WindowFactory to the list of registered factories.
void removeFactory (const String &name)
 Removes a WindowFactory from the list of registered factories.
void removeFactory (WindowFactory *factory)
 Removes a WindowFactory from the list of registered factories.
void removeAllFactories (void)
 Remove all WindowFactory objects from the list.
WindowFactorygetFactory (const String &type) const
 Return a pointer to the specified WindowFactory object.
bool isFactoryPresent (const String &name) const
 Checks the list of registered WindowFactory objects for one which creates Window objects of the specified type.
void addWindowTypeAlias (const String &aliasName, const String &targetType)
 Adds an alias for a current window type.
void removeWindowTypeAlias (const String &aliasName, const String &targetType)
 Remove the specified alias mapping. If the alias mapping does not exist, nothing happens.
void addFalagardWindowMapping (const String &newType, const String &targetType, const String &lookName)
 Add a mapping for a falagard based window.
void removeFalagardWindowMapping (const String &type)
 Remove the specified falagard type mapping if it exists.
bool isFalagardMappedType (const String &type) const
 Return whether the given type is a falagard mapped type.
const StringgetMappedLookForType (const String &type) const
 Return the name of the LookN'Feel assigned to the specified window mapping.
WindowFactoryIterator getIterator (void) const
 Return a WindowFactoryManager::WindowFactoryIterator object to iterate over the available WindowFactory types.
TypeAliasIterator getAliasIterator (void) const
 Return a WindowFactoryManager::TypeAliasIterator object to iterate over the defined aliases for window types.
FalagardMappingIterator getFalagardMappingIterator () const
 Return a WindowFactoryManager::FalagardMappingIterator object to iterate over the defined falagard window mappings.
 Singleton (void)

Static Public Member Functions

static WindowFactoryManagergetSingleton (void)
 Return singleton WindowFactoryManager object.
static WindowFactoryManagergetSingletonPtr (void)
 Return pointer to singleton WindowFactoryManager object.

Static Protected Attributes

static WindowFactoryManagerms_Singleton = NULL

Classes

class  AliasTargetStack
struct  FalagardWindowMapping
 struct used to hold mapping information required to create a falagard based window. More...

Detailed Description

Class that manages WindowFactory objects.

Definition at line 51 of file CEGUIWindowFactoryManager.h.


Member Typedef Documentation

typedef ConstBaseIterator<FalagardMapRegistry> CEGUI::WindowFactoryManager::FalagardMappingIterator
 

Definition at line 374 of file CEGUIWindowFactoryManager.h.

typedef ConstBaseIterator<TypeAliasRegistry> CEGUI::WindowFactoryManager::TypeAliasIterator
 

Definition at line 373 of file CEGUIWindowFactoryManager.h.

typedef ConstBaseIterator<WindowFactoryRegistry> CEGUI::WindowFactoryManager::WindowFactoryIterator
 

Definition at line 372 of file CEGUIWindowFactoryManager.h.


Constructor & Destructor Documentation

CEGUI::WindowFactoryManager::WindowFactoryManager void   )  [inline]
 

Constructs a new WindowFactoryManager object.

Definition at line 119 of file CEGUIWindowFactoryManager.h.

References CEGUI::Logger::getSingleton(), and CEGUI::Logger::logEvent().

CEGUI::WindowFactoryManager::~WindowFactoryManager void   )  [inline]
 

Destructor for WindowFactoryManager objects.

Definition at line 129 of file CEGUIWindowFactoryManager.h.

References CEGUI::Logger::getSingleton(), and CEGUI::Logger::logEvent().


Member Function Documentation

void CEGUI::WindowFactoryManager::addFactory WindowFactory factory  ) 
 

Adds a new WindowFactory to the list of registered factories.

Parameters:
factory Pointer to the WindowFactory to be added to the WindowManager.
Returns:
Nothing
Exceptions:
NullObjectException factory was null.
AlreadyExistsException factory provided a Window type name which is in use by another registered WindowFactory.

Definition at line 44 of file CEGUIWindowFactoryManager.cpp.

References CEGUI::Logger::getSingleton(), CEGUI::WindowFactory::getTypeName(), and CEGUI::Logger::logEvent().

void CEGUI::WindowFactoryManager::addFalagardWindowMapping const String newType,
const String targetType,
const String lookName
 

Add a mapping for a falagard based window.

This function creates maps a target window type and target 'look' name onto a registered window type, thus allowing the ususal window creation interface to be used to create windows that require extra information to full initialise themselves.

Note:
These mappings support 'late binding' to the target window type, as such the type indicated by targetType need not exist in the system until attempting to create a Window using the type.
Also note that creating a mapping for an existing type will replace any previous mapping for that same type.
Parameters:
newType The type name that will be used to create windows using the target type and look.
targetType The base window type.
lookName The name of the 'look' that will be used by windows of this type.
Returns:
Nothing.

Definition at line 250 of file CEGUIWindowFactoryManager.cpp.

References CEGUI::WindowFactoryManager::FalagardWindowMapping::d_baseType, CEGUI::WindowFactoryManager::FalagardWindowMapping::d_lookName, CEGUI::WindowFactoryManager::FalagardWindowMapping::d_windowType, CEGUI::Logger::getSingleton(), and CEGUI::Logger::logEvent().

Referenced by CEGUI::Scheme::loadResources().

void CEGUI::WindowFactoryManager::addWindowTypeAlias const String aliasName,
const String targetType
 

Adds an alias for a current window type.

This method allows you to create an alias for a specified window type. This means that you can then use either name as the type parameter when creating a window.

Note:
You need to be careful using this system. Creating an alias using a name that already exists will replace the previous mapping for that alias. Each alias name maintains a stack, which means that it is possible to remove an alias and have the previous alias restored. The windows created via an alias use the real type, so removing an alias after window creation is always safe (i.e. it is not the same as removing a real factory, which would cause an exception when trying to destroy a window with a missing factory).
Parameters:
aliasName String object holding the alias name. That is the name that targetType will also be known as from no on.
targetType String object holding the type window type name that is to be aliased. This type must already exist.
Returns:
Nothing.
Exceptions:
UnknownObjectException thrown if targetType is not known within the system.

Definition at line 189 of file CEGUIWindowFactoryManager.cpp.

References CEGUI::Logger::getSingleton(), isFactoryPresent(), and CEGUI::Logger::logEvent().

Referenced by CEGUI::Scheme::loadResources().

WindowFactoryManager::TypeAliasIterator CEGUI::WindowFactoryManager::getAliasIterator void   )  const
 

Return a WindowFactoryManager::TypeAliasIterator object to iterate over the defined aliases for window types.

Definition at line 180 of file CEGUIWindowFactoryManager.cpp.

Referenced by CEGUI::Scheme::loadResources(), CEGUI::Scheme::resourcesLoaded(), and CEGUI::Scheme::unloadResources().

WindowFactory * CEGUI::WindowFactoryManager::getFactory const String type  )  const
 

Return a pointer to the specified WindowFactory object.

Parameters:
type String holding the Window object type to return the WindowFactory for.
Returns:
Pointer to the WindowFactory object that creates Windows of the type type.
Exceptions:
UnknownObjectException No WindowFactory object for Window objects of type type was found.

Definition at line 92 of file CEGUIWindowFactoryManager.cpp.

Referenced by CEGUI::WindowManager::cleanDeadPool(), CEGUI::WindowManager::createWindow(), and CEGUI::System::~System().

WindowFactoryManager::FalagardMappingIterator CEGUI::WindowFactoryManager::getFalagardMappingIterator  )  const
 

Return a WindowFactoryManager::FalagardMappingIterator object to iterate over the defined falagard window mappings.

Definition at line 280 of file CEGUIWindowFactoryManager.cpp.

Referenced by CEGUI::Scheme::loadResources(), and CEGUI::Scheme::unloadResources().

WindowFactoryManager::WindowFactoryIterator CEGUI::WindowFactoryManager::getIterator void   )  const
 

Return a WindowFactoryManager::WindowFactoryIterator object to iterate over the available WindowFactory types.

Definition at line 170 of file CEGUIWindowFactoryManager.cpp.

const String & CEGUI::WindowFactoryManager::getMappedLookForType const String type  )  const
 

Return the name of the LookN'Feel assigned to the specified window mapping.

Parameters:
type Name of a window type. The window type referenced should be a falagard mapped type.
Returns:
String object holding the name of the look mapped for the requested type.
Exceptions:
InvalidRequestException thrown if type is not a falagard mapping type (or maybe the type didn't exist).

Definition at line 290 of file CEGUIWindowFactoryManager.cpp.

Referenced by CEGUI::WindowManager::createWindow().

WindowFactoryManager & CEGUI::WindowFactoryManager::getSingleton void   )  [static]
 

Return singleton WindowFactoryManager object.

Returns:
Singleton WindowFactoryManager object

Reimplemented from CEGUI::Singleton< WindowFactoryManager >.

Definition at line 154 of file CEGUIWindowFactoryManager.cpp.

Referenced by CEGUI::WindowManager::cleanDeadPool(), CEGUI::WindowManager::createWindow(), CEGUI::Scheme::loadResources(), CEGUI::Scheme::resourcesLoaded(), CEGUI::Scheme::unloadResources(), and CEGUI::System::~System().

WindowFactoryManager * CEGUI::WindowFactoryManager::getSingletonPtr void   )  [static]
 

Return pointer to singleton WindowFactoryManager object.

Returns:
Pointer to singleton WindowFactoryManager object

Reimplemented from CEGUI::Singleton< WindowFactoryManager >.

Definition at line 160 of file CEGUIWindowFactoryManager.cpp.

Referenced by CEGUI::System::~System().

bool CEGUI::WindowFactoryManager::isFactoryPresent const String name  )  const
 

Checks the list of registered WindowFactory objects for one which creates Window objects of the specified type.

Parameters:
name String containing the name (technically, Window type name) of the WindowFactory to check for.
Returns:
true if a WindowFactory that creates Window objects of type name is registered. Else, false.

Definition at line 138 of file CEGUIWindowFactoryManager.cpp.

Referenced by addWindowTypeAlias(), CEGUI::Scheme::loadResources(), and CEGUI::Scheme::resourcesLoaded().

bool CEGUI::WindowFactoryManager::isFalagardMappedType const String type  )  const
 

Return whether the given type is a falagard mapped type.

Parameters:
type Name of a window type.
Returns:
  • true if the requested type is a Falagard mapped window type.
  • false if the requested type is a normal WindowFactory (or alias), or if the type does not exist.

Definition at line 285 of file CEGUIWindowFactoryManager.cpp.

Referenced by CEGUI::WindowManager::createWindow().

void CEGUI::WindowFactoryManager::removeAllFactories void   )  [inline]
 

Remove all WindowFactory objects from the list.

Returns:
Nothing

Definition at line 215 of file CEGUIWindowFactoryManager.h.

Referenced by CEGUI::System::~System().

void CEGUI::WindowFactoryManager::removeFactory WindowFactory factory  ) 
 

Removes a WindowFactory from the list of registered factories.

Note:
The WindowFactory object is not destroyed (since it was created externally), instead it is just removed from the list.
Parameters:
factory Pointer to the factory object to be removed. If factory is null, or if no such WindowFactory is in the list, no error occurs (nothing happens).
Returns:
Nothing

Definition at line 79 of file CEGUIWindowFactoryManager.cpp.

References CEGUI::WindowFactory::getTypeName(), and removeFactory().

void CEGUI::WindowFactoryManager::removeFactory const String name  ) 
 

Removes a WindowFactory from the list of registered factories.

Note:
The WindowFactory object is not destroyed (since it was created externally), instead it is just removed from the list.
Parameters:
name String which holds the name (technically, Window type name) of the WindowFactory to be removed. If name is not in the list, no error occurs (nothing happens).
Returns:
Nothing

Definition at line 68 of file CEGUIWindowFactoryManager.cpp.

References CEGUI::Logger::getSingleton(), and CEGUI::Logger::logEvent().

Referenced by removeFactory(), and CEGUI::Scheme::unloadResources().

void CEGUI::WindowFactoryManager::removeFalagardWindowMapping const String type  ) 
 

Remove the specified falagard type mapping if it exists.

Returns:
Nothing.

Definition at line 269 of file CEGUIWindowFactoryManager.cpp.

References CEGUI::Logger::getSingleton(), and CEGUI::Logger::logEvent().

Referenced by CEGUI::Scheme::unloadResources().

void CEGUI::WindowFactoryManager::removeWindowTypeAlias const String aliasName,
const String targetType
 

Remove the specified alias mapping. If the alias mapping does not exist, nothing happens.

Note:
You are required to supply both the alias and target names because there may exist more than one entry for a given alias - therefore you are required to be explicit about which alias is to be removed.
Parameters:
aliasName String object holding the alias name.
targetType String object holding the type window type name that was aliased.
Returns:
Nothing.

Definition at line 216 of file CEGUIWindowFactoryManager.cpp.

References CEGUI::Logger::getSingleton(), CEGUI::Informative, and CEGUI::Logger::logEvent().

Referenced by CEGUI::Scheme::unloadResources().

CEGUI::Singleton< WindowFactoryManager >::Singleton void   )  [inline, inherited]
 

Definition at line 58 of file CEGUISingleton.h.


Member Data Documentation

WindowFactoryManager * CEGUI::Singleton< WindowFactoryManager >::ms_Singleton = NULL [static, protected, inherited]
 

Definition at line 38 of file CEGUIWindowFactoryManager.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Sep 7 10:07:45 2005 for Crazy Eddies GUI System by  doxygen 1.4.3