Guiliani  Version 2.5 revision 7293 (documentation build 13)
CGUIFactoryManager Class Reference

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 CGUIObjectGetCurrentlyStreamingObject () const
 
FileType_t GetDefaultStreamingMode () const
 
eC_Bool GetSkipCorruptedData () const
 
CGUIAnimationLoadAnimationFromStream ()
 
CGUIBehaviourDecoratorLoadBehaviourFromStream ()
 
CGUICommandPtr LoadCommandFromStream ()
 
CGUIObjectLoadDialogFromFile (const eC_String &rkPath)
 
CGUIObjectLoadDialogFromFile (eC_File *pkFile)
 
CGUILayouterLoadLayouterFromStream ()
 
CGUITextLoadTextFromStream ()
 
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
 

Detailed Description

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:

  • unknown IDs, i.e. missing CustomExtension
  • wrong versions (too low or too high)
  • unexpected data

Exception: Missing start- or ending tags can't be repaired.

Member Function Documentation

◆ AddUserFactory()

void CGUIFactoryManager::AddUserFactory ( CGUIFactory pkFactory,
const eC_Bool &  bDelete = true 
)

Adds a user factory.

Parameters
pkFactoryPointer to the factory to be added.
bDeleteif true the factory gets deleted when the manager is destroyed

◆ CurrentlyStreamingObjectExists()

const eC_Bool CGUIFactoryManager::CurrentlyStreamingObjectExists ( ) const
inline

Return true if the currently streamed object exists

Returns
true if it exists

◆ DialogHasSkippedElements()

eC_Bool CGUIFactoryManager::DialogHasSkippedElements ( ) const
inline

Returns if the last loaded dialog has skipped elements

Returns
true if elements were skipped

◆ DialogLoadingError()

eC_Bool CGUIFactoryManager::DialogLoadingError ( ) const
inline

Returns the error state of the last LoadDialog operation.

Returns
True, in case of an error loading the dialog, False otherwise.

◆ GetCurrentFileName()

const eC_String & CGUIFactoryManager::GetCurrentFileName ( ) const
inline

Returns the name of the file which is currently being streamed.

Returns
The name of the file from which the factory is currently streaming

◆ GetCurrentlyStreamingObject()

const CGUIObject * CGUIFactoryManager::GetCurrentlyStreamingObject ( ) const
inline

Returns the pointer to the object that is currently reading from the stream.

Returns
The object or NULL when currently no object is reading from stream.

◆ GetDefaultStreamingMode()

FileType_t CGUIFactoryManager::GetDefaultStreamingMode ( ) const
inline

Returns the default streaming-mode for dialogs

Returns
XML or BIN

◆ GetSkipCorruptedData()

eC_Bool CGUIFactoryManager::GetSkipCorruptedData ( ) const
inline

Returns, if corrupted data is currently skipped

Returns
true if skipped

◆ LoadAnimationFromStream()

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.

Returns
Pointer to the created and initialized CGUIAnimation object.

◆ LoadBehaviourFromStream()

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.

Returns
Pointer to the created and initialized CGUIBehaviour object.

◆ LoadCommandFromStream()

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.

Returns
Pointer to the created and initialized CGUICommand object.

◆ LoadDialogFromFile() [1/2]

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.

Parameters
rkPathpath to the streaming file.
Returns
Pointer to the created GUIObject, NULL in case of error.

◆ LoadDialogFromFile() [2/2]

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&).

Parameters
pkFilePointer 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.
Returns
Pointer to the created GUIObject.

◆ LoadLayouterFromStream()

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.

Returns
Pointer to the created and initialized CGUILayouter object.

◆ LoadTextFromStream()

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.

Returns
Pointer to the created and initialized CGUIText object.

◆ SetCurrentFileName()

void CGUIFactoryManager::SetCurrentFileName ( const eC_String &  kFilename)
inline

Set the currently processed filename. This can be usefull, if the file is residing in memory, but should be identified for more information.

Parameters
kFilenamefile-name

◆ SetDefaultStreamingMode()

void CGUIFactoryManager::SetDefaultStreamingMode ( const FileType_t &  eStreamingMode)
inline

Sets the default streaming-mode for dialogs

Parameters
eStreamingModexml or binary

◆ SetSkipCorruptedData()

void CGUIFactoryManager::SetSkipCorruptedData ( const eC_Bool &  bSkipCorruptedData)
inline

Specify, if the factory-manager should try to skip corrupted blocks during load.

Parameters
bSkipCorruptedDataskip

Friends And Related Function Documentation

◆ CGUIComponentManager

friend class CGUIComponentManager
friend

◆ CGUICompositeObject

friend class CGUICompositeObject
friend

The documentation for this class was generated from the following file: