Manages the CGUIStandardFactory and user factories. More...
#include <GUIFactoryManager.h>
Public Member Functions | |
void | AddUserFactory (CGUIFactory *pkFactory, const eC_Bool &bDelete=true) |
const eC_Bool | CurrentlyStreamingObjectExists () const |
eC_Bool | DialogHasSkippedElements () const |
eC_Bool | DialogLoadingError () const |
const eC_String & | GetCurrentFileName () const |
const CGUIObject * | GetCurrentlyStreamingObject () const |
FileType_t | GetDefaultStreamingMode () const |
eC_Bool | GetSkipCorruptedData () const |
CGUIAnimation * | LoadAnimationFromStream () |
CGUIBehaviourDecorator * | LoadBehaviourFromStream () |
CGUICommandPtr | LoadCommandFromStream () |
CGUIObject * | LoadDialogFromFile (const eC_String &rkPath) |
CGUIObject * | LoadDialogFromFile (eC_File *pkFile) |
CGUILayouter * | LoadLayouterFromStream () |
CGUIText * | LoadTextFromStream () |
void | SetCurrentFileName (const eC_String &kFilename) |
void | SetDefaultStreamingMode (const FileType_t &eStreamingMode) |
void | SetSkipCorruptedData (const eC_Bool &bSkipCorruptedData) |
Static Public Member Functions | |
static void | CreateInstance () |
Creates the singleton instance of this class. | |
static void | DeleteInstance () |
Deletes the singleton instance of this class. | |
Friends | |
class | CGUIComponentManager |
class | CGUICompositeObject |
Manages the CGUIStandardFactory and user factories.
When reading GUI definitions from streaming files, an instance of this class has to be created (CreateInstance()). It can then be used for reading streaming files, usually by calling LoadDialogFromFile().
This class uses implementations of CGUIFactory for creating the objects as required. It keeps an object of CGUIStandardFactory for creating standard Guiliani objects. If user-defined objects (like derived controls, commands etc.) have to be created, appropriate user factories must be implemented in the application. They can be added here by calling AddUserFactory().
Skip corrupted data: By using SetSkipCorruptedData you can specify, if the factory-manager should try to load dialogs, even if they contain corrupted data. The corrupted data is skipped by reading out every data from the stream until the ending tag of the block has been reached.
As the result of the skipping-process, the damaged object will not be present in the loaded dialog.
The following errors can be skipped:
Exception: Missing start- or ending tags can't be repaired.
void CGUIFactoryManager::AddUserFactory | ( | CGUIFactory * | pkFactory, |
const eC_Bool & | bDelete = true |
||
) |
Adds a user factory.
pkFactory | Pointer to the factory to be added. |
bDelete | if true the factory gets deleted when the manager is destroyed |
|
inline |
Return true if the currently streamed object exists
|
inline |
Returns if the last loaded dialog has skipped elements
|
inline |
Returns the error state of the last LoadDialog operation.
|
inline |
Returns the name of the file which is currently being streamed.
|
inline |
Returns the pointer to the object that is currently reading from the stream.
|
inline |
Returns the default streaming-mode for dialogs
|
inline |
Returns, if corrupted data is currently skipped
CGUIAnimation * CGUIFactoryManager::LoadAnimationFromStream | ( | ) |
Loads a CGUIAnimation from the current streaming file. Uses the current instance of CGUIStreamReader to read the animation class ID. Calls CGUIFactory::CreateAnimation() to create an animation object, then calls ReadFromStream on the new object.
CGUIBehaviourDecorator * CGUIFactoryManager::LoadBehaviourFromStream | ( | ) |
Loads a CGUIBehaviour from the current streaming file. Uses the current instance of CGUIStreamReader to read the behaviour class ID. Calls CGUIFactory::CreateBehaviour() to create a behaviour object, then calls ReadFromStream on the new object.
CGUICommandPtr CGUIFactoryManager::LoadCommandFromStream | ( | ) |
Loads a CGUICommand from the current streaming file. Uses the current instance of CGUIStreamReader to read the command class ID. Calls CGUIFactory::CreateCommand() to create a command object, then calls ReadFromStream on the new object.
CGUIObject * CGUIFactoryManager::LoadDialogFromFile | ( | const eC_String & | rkPath | ) |
Reads a GUI definition from streaming file. This method uses the CGUIResourceFileHandler to open the file. This means that the file name is prefixed with the resource path prefix.
rkPath | path to the streaming file. |
CGUIObject * CGUIFactoryManager::LoadDialogFromFile | ( | eC_File * | pkFile | ) |
Reads a GUI definition from streaming file. Use this method only if you really need to load files that are located outside of the path that is used as the resource prefix (see CGUIResourceFileHandler). Normally you should use LoadDialogFromFile(const eC_String&).
pkFile | Pointer to an already opened file. This method does not close or delete the file. It is up to the caller of this method to clean up. |
CGUILayouter * CGUIFactoryManager::LoadLayouterFromStream | ( | ) |
Loads a CGUILayouter from the current streaming file. Uses the current instance of CGUIStreamReader to read the layouter class ID. Calls CGUIFactory::CreateLayouter() to create a layouter object, then calls ReadFromStream on the new object.
CGUIText * CGUIFactoryManager::LoadTextFromStream | ( | ) |
Loads a CGUIText from the current streaming file. Uses the current instance of CGUIStreamReader to read the text type ID. Calls CGUIFactory::CreateText() to create a text object, then calls ReadFromStream on the new object.
|
inline |
Set the currently processed filename. This can be usefull, if the file is residing in memory, but should be identified for more information.
kFilename | file-name |
|
inline |
Sets the default streaming-mode for dialogs
eStreamingMode | xml or binary |
|
inline |
Specify, if the factory-manager should try to skip corrupted blocks during load.
bSkipCorruptedData | skip |
|
friend |
|
friend |