All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Signals | Public Member Functions
Qtilities::ProjectManagement::ObserverProjectItemWrapper Class Reference

This class wraps Qtilities::Core::Observer as a project item. More...

#include <ObserverProjectItemWrapper.h>

Inheritance diagram for Qtilities::ProjectManagement::ObserverProjectItemWrapper:
Inheritance graph
[legend]

List of all members.

Signals

void modificationStateChanged (bool is_modified) const
 Implement this function as a signal when implementing the object.

Public Member Functions

virtual void clearExportTask ()
 Clears the export task.
virtual
IExportable::ExportResultFlags 
exportBinary (QDataStream &stream) const
 Allows exporting to a QDataStream.
ObserverData::ExportItemFlags exportItemFlags () const
 Get the export item flags to be used for this project item.
virtual
IExportable::ExportResultFlags 
exportXml (QDomDocument *doc, QDomElement *object_node) const
 Allows exporting to an XML document. A reference to the QDomElement to which the object's information must be added is provided, along with a reference to the QDomDocument.
virtual
IExportable::ExportResultFlags 
importBinary (QDataStream &stream, QList< QPointer< QObject > > &import_list)
 Allows importing and reconstruction of the object state from information provided in a QDataStream.
virtual
IExportable::ExportResultFlags 
importXml (QDomDocument *doc, QDomElement *object_node, QList< QPointer< QObject > > &import_list)
 Allows importing and reconstruction of data from information provided in a XML document. A reference to the QDomElement which contains the object's information is provided, along with a reference to the QDomDocument.
InstanceFactoryInfo instanceFactoryInfo () const
 The instance factory information which must be used when the exported object is reconstructed during an import.
bool isModified () const
 Indicates the modification state of the object.
bool newProjectItem ()
 Called by the project manager when a new project needs to be created.
QObject * objectBase ()
 Returns the QObject* base of the interface.
const QObject * objectBase () const
 Returns a const QObject* base of the interface.
QString projectItemName () const
 The name of the project item.
void setExportItemFlags (ObserverData::ExportItemFlags flags)
 Sets the export item flags to be used for this project item.
virtual void setExportVersion (Qtilities::ExportVersion version)
 Returns the export version currently used by all Qtilities classes.
void setObserverContext (Observer *observer)
 Sets the observer context for this project item.
ExportModeFlags supportedFormats () const
 Provides information about the export format(s) supported by your implementation of IExportable.
- Public Member Functions inherited from Qtilities::ProjectManagement::Interfaces::IProjectItem
virtual bool closeProjectItem (ITask *task=0)=0
 Close the project item.
- Public Member Functions inherited from Qtilities::Core::Interfaces::IModificationNotifier
virtual void setModificationState (bool new_state, NotificationTargets notification_targets=NotifyListeners, bool force_notifications=false)=0
 Sets the modification state of the object. Returns true if it was successfull.
- Public Member Functions inherited from Qtilities::Core::Interfaces::IObjectBase
QString objectOriginID () const
 Allows interfaces to provide some sort of source identification.
void setObjectOriginID (const QString &object_origin_id)
 Allows setting of the object source ID of this interface implementation.
- Public Member Functions inherited from Qtilities::Core::Interfaces::IExportable
quint32 applicationExportVersion () const
 Returns the application export version currently used by all your application's classes.
IExportableduplicate (QString *error_msg=0, int properties_to_copy=0, ExportResultFlags *result_flags=0) const
 Function which will create a duplicate (copy) of this object.
virtual ITaskexportTask () const
 Gets the task which must be used to log import/export information to.
Qtilities::ExportVersion exportVersion () const
 Returns the export version currently used by all Qtilities classes.
bool isExportable () const
 Gets if this object must be part of it's parents' exports.
virtual void setApplicationExportVersion (quint32 version)
 Sets the application export version currently used by all your application's classes.
virtual void setExportTask (ITask *task)
 Sets the task which must be used to log import/export information to.
virtual void setIsExportable (bool new_is_exportable)
 Sets if this object must be part of it's parents' exports.

Detailed Description

This class wraps Qtilities::Core::Observer as a project item.

Using ObserverProjectItemWrapper you can easily make any Qtilities::Core::Observer part of a project. For example:

Observer* obs = new Observer;
ObserverProjectItemWrapper* project_item = new ObserverProjectItemWrapper(obs);
OBJECT_MANAGER->registerObject(project_item,QtilitiesCategory("Core::Project Items (IProjectItem)","::"));

Make sure you register the project item in the global object pool before initializing the project manager.


Member Function Documentation

void Qtilities::ProjectManagement::ObserverProjectItemWrapper::clearExportTask ( )
virtual

Clears the export task.

See also:
setExportTask(), exportTask()

Reimplemented from Qtilities::Core::Interfaces::IExportable.

Qtilities::Core::Interfaces::IExportable::ExportResultFlags Qtilities::ProjectManagement::ObserverProjectItemWrapper::exportBinary ( QDataStream &  stream) const
virtual

Allows exporting to a QDataStream.

See Serializing Qtilities Data Types Overview for more information about the expected output format.

Parameters:
streamA reference to the QDataStream to which the object's information must be appended is provided.

Reimplemented from Qtilities::Core::Interfaces::IExportable.

Qtilities::Core::ObserverData::ExportItemFlags Qtilities::ProjectManagement::ObserverProjectItemWrapper::exportItemFlags ( ) const

Get the export item flags to be used for this project item.

The default ObserverData::ExportData.

See also:
setExportItemFlags()
Qtilities::Core::Interfaces::IExportable::ExportResultFlags Qtilities::ProjectManagement::ObserverProjectItemWrapper::exportXml ( QDomDocument *  doc,
QDomElement *  object_node 
) const
virtual

Allows exporting to an XML document. A reference to the QDomElement to which the object's information must be added is provided, along with a reference to the QDomDocument.

See Serializing Qtilities Data Types Overview for more information about the expected output format.

Reimplemented from Qtilities::Core::Interfaces::IExportable.

Qtilities::Core::Interfaces::IExportable::ExportResultFlags Qtilities::ProjectManagement::ObserverProjectItemWrapper::importBinary ( QDataStream &  stream,
QList< QPointer< QObject > > &  import_list 
)
virtual

Allows importing and reconstruction of the object state from information provided in a QDataStream.

See Serializing Qtilities Data Types Overview for more information about the expected output format.

Parameters:
streamThe QDataStream which contains the object's information.
import_listAll objects constructed during the import operation must be added to the import list. When the operation fails, all objects in this list will be deleted.

Reimplemented from Qtilities::Core::Interfaces::IExportable.

Qtilities::Core::Interfaces::IExportable::ExportResultFlags Qtilities::ProjectManagement::ObserverProjectItemWrapper::importXml ( QDomDocument *  doc,
QDomElement *  object_node,
QList< QPointer< QObject > > &  import_list 
)
virtual

Allows importing and reconstruction of data from information provided in a XML document. A reference to the QDomElement which contains the object's information is provided, along with a reference to the QDomDocument.

See Serializing Qtilities Data Types Overview for more information about the expected output format.

Reimplemented from Qtilities::Core::Interfaces::IExportable.

Qtilities::Core::InstanceFactoryInfo Qtilities::ProjectManagement::ObserverProjectItemWrapper::instanceFactoryInfo ( ) const
virtual

The instance factory information which must be used when the exported object is reconstructed during an import.

For more information see The IExportable interface, what does it have to do with factories?.

Reimplemented from Qtilities::Core::Interfaces::IExportable.

void Qtilities::ProjectManagement::ObserverProjectItemWrapper::modificationStateChanged ( bool  is_modified) const
virtualsignal

Implement this function as a signal when implementing the object.

Because this interface does not use the Q_OBJECT macro, you cannot connect to this signal directly. Instead you need to connect to the signal on the base object implementing this interface as follows:

connect(iface->objectBase(),SIGNAL(modificationStateChanged(bool)),SLOT(yourSlot(bool)));

Implements Qtilities::Core::Interfaces::IModificationNotifier.

const QObject* Qtilities::ProjectManagement::ObserverProjectItemWrapper::objectBase ( ) const
inlinevirtual

Returns a const QObject* base of the interface.

This function can be used in const methods, but make sure that you don't modify things that should stay const. An example where this is used is when we want to get a property on an object in a const method. This is a const operation.

Implements Qtilities::Core::Interfaces::IObjectBase.

void Qtilities::ProjectManagement::ObserverProjectItemWrapper::setExportItemFlags ( ObserverData::ExportItemFlags  flags)

Sets the export item flags to be used for this project item.

See also:
exportItemFlags()
void Qtilities::ProjectManagement::ObserverProjectItemWrapper::setExportVersion ( Qtilities::ExportVersion  version)
virtual

Returns the export version currently used by all Qtilities classes.

By default the latest Qtilities version is selected.

See also:
exportVersion()

Reimplemented from Qtilities::Core::Interfaces::IExportable.

Qtilities::Core::Interfaces::IExportable::ExportModeFlags Qtilities::ProjectManagement::ObserverProjectItemWrapper::supportedFormats ( ) const
virtual

Provides information about the export format(s) supported by your implementation of IExportable.

Note:
It is important to note that you need to check the exportVersion() when you return the supported formats.

Reimplemented from Qtilities::Core::Interfaces::IExportable.



Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé