GCF LOGO VCL LOGO

Base class for all GCF components. More...

#include <GCF3/Component>

Public Member Functions

 Component (QObject *parent=0)
 
virtual QString name () const
 
virtual QString organization () const
 
virtual GCF::Version version () const
 
virtual QString buildTimestamp () const
 
const QSettings * settings () const
 
bool isLoaded () const
 
bool isActive () const
 
void load ()
 
void unload ()
 
void activate ()
 
void deactivate ()
 
void addContentObject (const QString &name, QObject *object, const QVariantMap &info=QVariantMap())
 
void addContentObject (QObject *object, const QVariantMap &info=QVariantMap())
 
void removeContentObject (QObject *object)
 
void removeContentObject (const QString &name)
 

Protected Member Functions

 ~Component ()
 
virtual void finalizeEvent (GCF::FinalizeEvent *e)
 
virtual void initializeEvent (GCF::InitializeEvent *e)
 
virtual void activationEvent (GCF::ActivationEvent *e)
 
virtual void contentLoadEvent (GCF::ContentLoadEvent *e)
 
virtual void deactivationEvent (GCF::DeactivationEvent *e)
 
virtual void settingsLoadEvent (GCF::SettingsLoadEvent *e)
 
virtual void contentUnloadEvent (GCF::ContentUnloadEvent *e)
 
virtual void settingsUnloadEvent (GCF::SettingsUnloadEvent *e)
 
virtual void contentObjectLoadEvent (GCF::ContentObjectLoadEvent *e)
 
virtual void contentObjectMergeEvent (GCF::ContentObjectMergeEvent *e)
 
virtual void contentObjectUnloadEvent (GCF::ContentObjectUnloadEvent *e)
 
virtual void contentObjectUnmergeEvent (GCF::ContentObjectUnmergeEvent *e)
 
virtual void activateContentObjectEvent (GCF::ActivateContentObjectEvent *e)
 
virtual void deactivateContentObjectEvent (GCF::DeactivateContentObjectEvent *e)
 
virtual QObject * loadObject (const QString &name, const QVariantMap &info)
 
virtual bool unloadObject (const QString &name, QObject *object, const QVariantMap &info)
 
virtual bool mergeObject (QObject *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool unmergeObject (QObject *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool activateObject (QObject *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool deactivateObject (QObject *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 

Detailed Description

This class is at the heart of GCF's component model. A component, in GCF, is an entity that makes available one or more objects that can work in tandem with objects offered by other components in the application. Components are generally written for reusability. They can be written once and used in several different application contexts.

The GCF::Component class offers a unified way to represent components, initialize (or load) and uninitialize (or unload) them in an application. Objects offered by components are registered with the application's object-tree ( GCF::ApplicationServices::objectTree() ). This way, any component in the application can easily search for objects (and services) offered by any other component in the application.

To create your own component, you can subclass from GCF::Component and implement your component's behavior. Example:

class MyComponent : public GCF::Component
{
public:
MyComponent(QObject *parent=0) : GCF::Component(parent) { }
protected:
~MyComponent() { }
};
GCF_EXPORT_COMPONENT(MyComponent);

A couple of key points must be noticed from the code snippet above

  • Constructor must be public, destructor must be protected. This is to ensure that the component can only be created on the heap and never on the stack.
  • GCF_EXPORT_COMPONENT macro can be used to export the component class across shared-library boundaries. This should be done in a source file, and not in a header file.

Instantiating components

A component is said to be instantiated if an instance of the component is created in memory. An instantiated component is however not useful and not included into the application. For that you will need to load the compoent. A loaded component is initialized and its objects are included in the application. Read the following sections to know more about this.

Components can be instantiated using any of the following means

  • By loading the component from a shared library
  • By creating an instance of a component class

To load a component from shared library, you can make use of the GCF::ApplicationServices::loadComponent() function. Example:

#include <GCF3/Application>
#include <GCF3/Component>
int main(int argc, char **argv)
{
GCF::Application a(argc, argv);
GCF::Component *component = gAppService->loadComponent("GDrive/GDriveLite");
if(component)
{
// The component "GDrive/GDriveLite" has been instantiated
// and initialized
}
return a.exec();
}

If you want to instantiate the component from a shared library and load it later (explicitly); then you can use the GCF::ApplicationServices::instantiateComponent() function. Example:

#include <GCF3/Application>
#include <GCF3/Component>
int main(int argc, char **argv)
{
GCF::Application a(argc, argv);
GCF::Component *component = gAppService->instantiateComponent("GDrive/GDriveLite");
if(component)
{
// The component "GDrive/GDriveLite" has been instantiated
// but __not__ initialized.
...
...
...
component->load();
}
return a.exec();
}

If you have access to the constructor of any subclass of GCF::Component, then you can instantiate the component using the new operator of C++ and then call the load() method on the component to load the component.

Component loading (or initialization)

One of the ways to load a component is by making use of the load() method. Example:

GCF::Component *comp = ....;
comp->load();
// By the time the load() function returns, the component is
// completely initialized and its content loaded.

While a component is being loaded, it receives one or more events. These events are handled by the event() method. As a component developer you can reimplement event handlers from this class and offer your own code. Following is the order in which events are despatched to the component (upon load)

  • Pre-Activation: Read documentation of GCF::Component::activationEvent() for more information. After the pre-activation event is handled by the component, each and every content object of the component is activated.

Once the post-initialization event has been handled; the component is considered to have been initialized.

gcf-component-load-events.png
See Also
How component loading works

Component unloading (or uninitialization)

One of the ways to unload a component is to make use of the unload() method. Example:

GCF::Component *comp = ....;
comp->unload();
// By the time the unload() function returns, the component is
// completely unloaded and the component object is deleted.
comp = 0;

When a component is being to unloading, it receives one or more events. These events are handled by the event() method. As a component developer you can reimplement event handlers from this class and offer your own code. Following is the order in which events are despatched to the component (upon unload)

After the post-finalize event is handled, the component object is deleted.

gcf-component-unload-events.png
See Also
How component unloading works

Content File

Each component can (optionally) provide a content file listing the content-objects offered by it.

A component specifies the content-file that it uses via the GCF::ContentLoadEvent class when its GCF::Component::contentLoadEvent() is called. A typical implementation of this event handler would be

void ComponentClass::contentLoadEvent(GCF::ContentLoadEvent *e)
{
e->setContentFile(....);
}

A content file is written in XML. At the most basic level, a content file has a root content XML element and one or more object XML elements under it. Example:

<content>
<object name="object1" key11="value1" key12="value2" key13="value3" />
<object name="object2" key21="value1" key22="value2" key23="value3" />
...
...
...
<object name="objectn" keyn1="value1" keyn2="value2" keyn3="value3" />
</content>

Whenever an object element is parsed by GCF, it sends a GCF::ContentObjectLoadEvent event to the component. Whatever object is created and reported via the event is associated with that name. Example:

void ComponentClass::contentObjectLoadEvent(GCF::ContentObjectLoadEvent *e)
{
if(e->objectName() == "object1")
{
QObject *object = .....; // create the object
e->setObject(object);
return;
}
if(e->objectName() == "object2")
{
QObject *object = .....; // create the object
e->setObject(object);
return;
}
.....
.....
.....
.....
if(e->objectName() == "objectn")
{
QObject *object = .....; // create the object
e->setObject(object);
return;
}
}

You could also optionally do away with implementation of contentObjectLoadEvent() and simply implement the GCF::Component::loadObject() to behave like a factory method to create QObject instances based on the name. This is because the default implementation of GCF::Component::contentObjectLoadEvent() calls the GCF::Component::loadObject()

QObject *ComponentClass::loadObject(const QString &name, const QVariantMap &info)
{
if(name == "object1")
return .....; // create the object
if(name == "object2")
return .....; // create the object
.......
.......
.......
.......
if(name == "objectn")
return .....; // create the object
}

The info parameter passed to the loadObject() method or accessed via the GCF::ContentObjectLoadEvent::info() method on the event-object, contains all key=value pairs provided in the object XML element.

You can also configure object properties and create signal/slot connections in the content-xml file. Read GCF Content XML File Specification for more information.

Activation

Components can be activated by calling the activate() method. When this method is called GCF sends a GCF::ActivationEvent event to the component, which can be handled by reimplementing the activationEvent() virtual function. The activation event is actually sent twice to the component. GCF first sends a pre-activation event to the component. After this event is handled, it sends a GCF::ActivateContentObjectEvent event to the component against each of its content objects. This event can be handled by reimplementing the activateContentObjectEvent() function. Finally, GCF sends a post-activtion event to the component.

By default components are activated at the end of load().

Deactivation

Just as with component activation, a component can be deactivated by calling the deactivate() method. When this method is called, GCF sends a GCF::DeactivationEvent event to the component, which can be handled by reimplementing the deactiationEvent() virtual function. The deactivation is sent twice to the component. GCF first sends a pre-deactivation event. After that it sends a GCF::DeactivateContentObjectEvent event to the component against each of its content objects. This event can be handled by reimplementing the deactivateContentObjectEvent() function. Finally, GCF sends a post-deactivtion event to the component.

By default components are deactivated at the start of unload().

Application Object Tree

Objects loaded from the parsing of a content-file is registered with the application's object tree accessible via gAppService->objectTree(). This part is explained in the following video

 

 

There are more ways in which objects can be registered with the application and included in the application object tree. Please read the section on Registering objects to know more about this.

Constructor & Destructor Documentation

GCF::Component::Component ( QObject *  parent = 0)

Constructor for instantiating the component.

See Also
Instantiating components
GCF::Component::~Component ( )
protected

Destructor.

Note
If you are subclassing from GCF::Component, it is recommended that you declare destructor as protected. This will ensure that your component can only be created on the heap, never on the stack.

Member Function Documentation

QString GCF::Component::name ( ) const
virtual

Reimplement this function to return a name for your component. By default this function returns the name of the component-class.

Note
If you are reimplementing this function, return a string name that confirms to class-naming conventions of C++. [No spaces, first letter should be character, no special characters apart from _]
QString GCF::Component::organization ( ) const
virtual

Reimplement this function to return the name of your organization. By default this function returns qApp->organizationName()

GCF::Version GCF::Component::version ( ) const
virtual

Reimplement this function to return a version number for your component. By default this function return GCF::Version(1,0,0);

QString GCF::Component::buildTimestamp ( ) const
virtual

Reimplement this function to return a build-timestamp. This should be the date and time of the last time the component was built. By default this function returns __TIMESTAMP__

const QSettings * GCF::Component::settings ( ) const

Returns settings of this component. The function will return a NULL pointer until a Post-SettingsLoad event (GCF::SettingsLoadEvent) is delivered. It will return a valid pointer to QSettings after that.

See Also
Component loading (or initialization)
bool GCF::Component::isLoaded ( ) const

This function returns true if the component has been loaded completely. False otherwise. A component is considered loaded if it has received the Post-Initialize event (GCF::InitializeEvent).

See Also
Component loading (or initialization)
bool GCF::Component::isActive ( ) const

Returns true if the component has been loaded and activated. False otherwise.

See Also
Activation
void GCF::Component::load ( )

Loads the component.

Note
If the component has already been loaded, then this function is a no-op.
See Also
Component loading (or initialization)
void GCF::Component::unload ( )

Unloads the component. The component is deleted by the time it returns.

See Also
Component unloading (or uninitialization)
void GCF::Component::activate ( )

Activates the component.

Note
If the component is already active, then this function is a no-op.
See Also
Activation, isActive()
void GCF::Component::deactivate ( )

Deactivates the component.

Note
If the component is already inactive, then this function is a no-op.
See Also
Deactivation, isActive()
void GCF::Component::addContentObject ( const QString &  name,
QObject *  object,
const QVariantMap &  info = QVariantMap() 
)

This function allows you to programmatically add a content-object to the component's object tree, which makes it possible for other components in the application to search for and reference the added object.

Read Application Object Tree for more information about object-trees.

Parameters
namea string name for the added object. Names should following C++ object-naming convention.
objectpointer to the QObject that is being added. If NULL, then this function is a no-op.
infooptional key=value map that contains additional information about the content object.
Note
This function cannot be called within contentObjectLoadEvent() and contentObjectUnloadEvent()
void GCF::Component::addContentObject ( QObject *  object,
const QVariantMap &  info = QVariantMap() 
)

This function allows you to programmatically add a content-object to the component's object tree, which makes it possible for other components in the application to search for and reference the added object.

Read Application Object Tree for more information about object-trees.

Parameters
objectpointer to the QObject that is being added. The objectName() of the object is considered to be the name of the object in the object tree.
infooptional key=value map that contains additional information about the content object.
Note
This function cannot be called within contentObjectLoadEvent() and contentObjectUnloadEvent()
void GCF::Component::removeContentObject ( QObject *  object)

This function removes a content-object from the component's object tree.

Parameters
objectpointer to the QObject that needs to be removed
Note
The QObject refererred to by object will not be deleted by this function.
void GCF::Component::removeContentObject ( const QString &  name)

This function removes a content-object from the component's object tree.

Parameters
namename of the object that needs to be removed
Note
The QObject refererred to by name will not be deleted by this function.
void GCF::Component::finalizeEvent ( GCF::FinalizeEvent e)
protectedvirtual

Reimplement this event handler to handle pre and post finalization events. This function is called as a part of the unload() process. The function can be reimplemented to

  • Prepare the component for finalization during Pre-Finalize
  • Clean up memory and prepare for deletion during Post-Finalize

The default implementation does nothing.

Parameters
epointer to GCF::FinalizeEvent object that describes this event
void GCF::Component::initializeEvent ( GCF::InitializeEvent e)
protectedvirtual

Reimplement this event handler to handle pre and post initialization events. The default implementation does nothing.

Parameters
epointer to a GCF::InitializeEvent object that describes the event.

This is the first event that gets delivered to a component during load. Typically this function is reimplemented to handle

  • Pre-Initialzation time to initialize component's objects and variables (or examine system environment) before the component's settings and content get loaded.
  • Post-Initialization time to do some work after the component is completely loaded, but before it is activated.

Example:

class MyComponent : public GCF::Component
{
protected:
if(e->isPreInitialize()) {
// Pre-initialization work
} else {
// Post-initialization work
}
}
};
See Also
Component loading (or initialization)

Reimplemented in GCF::QmlComponent.

void GCF::Component::activationEvent ( GCF::ActivationEvent e)
protectedvirtual

Reimplement this event handler to handle pre and post activation events. The default implementation does nothing.

Parameters
epointer to a GCF::ActivationEvent object that describes this event.

This event gets delivered during activate() process. The event handler can be reimplemented to perform some tasks just before and just after activation.

Reimplemented in GCF::QmlComponent.

void GCF::Component::contentLoadEvent ( GCF::ContentLoadEvent e)
protectedvirtual

Reimplement this event handler to handle pre and post content-load events. The default implementation does nothing.

Parameters
epointer to a GCF::ContentLoadEvent object that describes the event.

This event is delivered to the component during its load() process. Typically this function is implemented to

  • Offer name of the content file to load during Pre-ContentLoad
  • Initialize loaded content objects during Post-ContentLoad

Example:

class MyComponent : public GCF::Component
{
protected:
if(e->isPreContentLoad()) {
e->setContentFile(...);
} else {
// Initialize or do anything else with loaded content
}
}
};
See Also
Component loading (or initialization)
void GCF::Component::deactivationEvent ( GCF::DeactivationEvent e)
protectedvirtual

Reimplement this event handler to handle pre and post deactivation events. The default implementation does nothing.

Parameters
epointer to a GCF::DeactivationEvent object that describes this event.

This event gets delivered during deactivate() process. The event handler can be reimplemented to perform some tasks just before and just after deactivation.

Reimplemented in GCF::QmlComponent.

void GCF::Component::settingsLoadEvent ( GCF::SettingsLoadEvent e)
protectedvirtual

Reimplement this event handler to handle pre and post settings-load events. The default implementation does nothing.

Parameters
epointer to a GCF::SettingsLoadEvent object that describes the event.

This is the second event that gets delivered to a component during load. Typically this function is implemented to

  • Offer name of the settings file to load in Pre-SettingsLoad.
  • Process the loaded settings in Post-SettingsLoad

Example:

class MyComponent : public GCF::Component
{
protected:
e->setSettingsFile(....);
else {
const QSettings *settings = this->settings();
// process loaded settings
}
}
};
See Also
Component loading (or initialization)
void GCF::Component::contentUnloadEvent ( GCF::ContentUnloadEvent e)
protectedvirtual

Reimplement this event handler to handle pre and post content-unload events. The default implementation does nothing.

Parameters
epointer to a GCF::ContentUnloadEvent object that describes the event

This event is called during the unload() process. Typically this function is implemented to

  • Prepare the component and its content-objects for unloading during Pre-ContentUnload
  • Release any additional memory occupied for managing the content of the component during Post-ContentUnload

Example:

class MyComponent : public GCF::Component
{
protected:
if(e->isPreContentLoad()) {
// Prepare for unload
} else {
// Cleanup after unload
}
}
};
See Also
Component unloading (or uninitialization)
void GCF::Component::settingsUnloadEvent ( GCF::SettingsUnloadEvent e)
protectedvirtual

Reimplement this event handler to handle pre and post settings-unload events. The default implementation does nothing.

Parameters
epointer to a GCF::SettingsUnloadEvent object that describes the event.

This event is delivered to the component during its unload() process. Typically this function is implemented to

  • Add/remove/alter keys and/or values in settings() in Pre-SettingsUnload.
  • Release any memory occupied for handling component settings in Post-SettingsUnload

Example:

class MyComponent : public GCF::Component
{
protected:
QSettings *settings = const_cast<QSettings*>(this->settings());
// add/remove/alter settings here
} else {
// release any memory used for handling configuration parameters
// sourced from settings
}
}
};
See Also
Component loading (or initialization)
void GCF::Component::contentObjectLoadEvent ( GCF::ContentObjectLoadEvent e)
protectedvirtual

Reimplement this event handler to handle content object load events. This event handler is called whenever an object XML element is encountered in the content file.

Parameters
epointer to a GCF::ContentObjectLoadEvent object that describes the event.

The default implementation of this event-handler calls the loadObject() method and sets the object returned from it into GCF::ContentObjectLoadEvent::setObject(). It is recommended that you implement loadObject() instead of this event handler for loading content objects.

class MyComponent : public GCF::Component
{
protected:
if(e->name() == ....)
e->setObject(...);
else if(e->name() == ....)
e->setObject(...)
// ...
// ...
// ...
// ...
}
};
See Also
Content File

Reimplemented in GCF::QmlComponent, and GCF::GuiComponent.

void GCF::Component::contentObjectMergeEvent ( GCF::ContentObjectMergeEvent e)
protectedvirtual

Reimplement this event handler to handle content-object merge events. This event handler is called if a content-object that is currently being loaded by GCF needs to be merged with a content-object belonging to this component.

Parameters
epointer to a GCF::ContentObjectMergeEvent object that describes the event.

A merge happens when the parent attribute of object XML element (that caused creation of a content-object) refers to a content object belonging to this component.

Example: Suppose that this component (by name MyComponent) is offering an object by name 'container'. Also suppose that another component has a content XML file as shown below

<content>
<object name="object" parent="MyComponent.container" />
</content>

After the other component has finished handling GCF::ContentObjectLoadEvent for object, a GCF::ContentObjectMergeEvent is sent to this component with

  • pointer to 'container'
  • pointer to 'object'
  • key=value information map of 'container'
  • key=value information map of 'object'

This event handler can then customize the way in which parenting (or merging) happens for 'container' and 'object'. For example, in a real world scenario, implementations of this event handler could add a child-widget into a tab of the parent-widget.

Note
The default implementation of this event handler calls mergeObject(). It is recommended that you implement mergeObject() instead of this event handler.
See Also
Component loading (or initialization), Content File

Reimplemented in GCF::QmlComponent, and GCF::GuiComponent.

void GCF::Component::contentObjectUnloadEvent ( GCF::ContentObjectUnloadEvent e)
protectedvirtual

Reimplement this event handler to handle content object load events. This event handler is called whenever a object XML element is encountered in the content file.

Parameters
epointer to a GCF::ContentObjectUnloadEvent object that describes the event.

The default implementation of this event-handler calls the unloadObject() method. It is recommended that you implement unloadObject() instead of this event handler for unloading objects.

class MyComponent : public GCF::Component
{
protected:
if(e->name() == ....) {
// un-initialize the object
// optionally delete the object
delete e->object();
} else if(e->name() == ....) {
}
// ...
// ...
// ...
// ...
}
};
Note
Content-object that is being unloaded will be automatically deleted by GCF, unless you reimplement the event handler to explicitly delete the object here itself.
See Also
Component unloading (or uninitialization)

Reimplemented in GCF::QmlComponent, and GCF::GuiComponent.

void GCF::Component::contentObjectUnmergeEvent ( GCF::ContentObjectUnmergeEvent e)
protectedvirtual

Reimplement this event handler to handle content object unmerge events. This event handler is called if a content-object that is currently being unloaded by GCF needs to be unmerged from a content-object belonging to this component.

Parameters
epointer to a GCF::ContentObjectUnmergeEvent object that describes the event.

An unmerge happens when a component, whose object was merged with an object from this component, is being unloaded. This event handler can customize the process of unmerging. The default implementation calls unmergeObject() function. It is recommended that you implement unmergeObject() instead of this event handler.

See Also
Component unloading (or uninitialization)

Reimplemented in GCF::QmlComponent, and GCF::GuiComponent.

void GCF::Component::activateContentObjectEvent ( GCF::ActivateContentObjectEvent e)
protectedvirtual

Reimplement this handler to handle content-object activation. The event is sent as a part of activate() process. The default event handler calls activateObject(). It is recommended that you implement activateObject() than handling this event.

Parameters
epointer to a GCF::ActivateContentObjectEvent object that describes this event
See Also
Activation

Reimplemented in GCF::QmlComponent, and GCF::GuiComponent.

void GCF::Component::deactivateContentObjectEvent ( GCF::DeactivateContentObjectEvent e)
protectedvirtual

Reimplement this handler to handle content-object deactivation. The event is sent as a part of deactivate() process. The default event handler calls deactivateObject(). It is recommended that you implement deactivateObject() than handling this event.

Parameters
epointer to a GCF::DeactivateContentObjectEvent object that describes this event
See Also
Deactivation

Reimplemented in GCF::QmlComponent, and GCF::GuiComponent.

QObject * GCF::Component::loadObject ( const QString &  name,
const QVariantMap &  info 
)
protectedvirtual

This function is called from GCF::Component::contentObjectLoadEvent(). You can reimplement this function to return a QObject pointer based on the name and information map given.

Parameters
namename of the object that needs to be loaded
infokey=value information map provided against the object that needs loading
Returns
pointer to a QObject that was loaded.
bool GCF::Component::unloadObject ( const QString &  name,
QObject *  object,
const QVariantMap &  info 
)
protectedvirtual

This function is called from GCF::Component::contentObjectUnloadEvent(). You can reimplement this function to unload the given object. GCF will delete the object immediately after return from this function, unless it was deleted explicitly by you in the reimplementation of this function.

Parameters
namename of the object that needs to be unloaded
objectpointer to the QObject that needs to be unloaded
infokey=value information map against the object that needs unloading
Returns
true on success, false otherwise. [Note: The return value is currently ignored]
bool GCF::Component::mergeObject ( QObject *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function is called from GCF::Component::contentObjectMergeEvent(). You can reimplement this function to merge child into parent. Here parent belongs to this component.

Parameters
parentpointer to a QObject added by this component.
childpointer to a QObject that needs to be merged (or parented) into parent
parentInfokey=value information map associated with the parent
childInfokey=value information map associated with the child
Returns
true on success, false otherwise. [Note: The return value is currently ignored]

Reimplemented in GCF::GuiComponent.

bool GCF::Component::unmergeObject ( QObject *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function is called from GCF::Component::contentObjectUnmergeEvent(). You can reimplement this function to unmerge child into parent. Here parent belongs to this component.

Parameters
parentpointer to a QObject added by this component.
childpointer to a QObject that needs to be unmerged (or parented) into parent
parentInfokey=value information map associated with the parent
childInfokey=value information map associated with the child
Returns
true on success, false otherwise. [Note: The return value is currently ignored]

Reimplemented in GCF::GuiComponent.

bool GCF::Component::activateObject ( QObject *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function is called from GCF::Component::activateContentObjectEvent(). You can reimplement this function to activate the child in a way suitable for parent.

Parameters
parentpointer to a QObject added by this component.
childpointer to a QObject that needs to be activated in parent
parentInfokey=value information map associated with the parent
childInfokey=value information map associated with the child
Returns
true on success, false otherwise. [Note: The return value is currently ignored]

Reimplemented in GCF::GuiComponent.

bool GCF::Component::deactivateObject ( QObject *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function is called from GCF::Component::deactivateContentObjectEvent(). You can reimplement this function to deactivate the child in a way suitable for parent.

Parameters
parentpointer to a QObject added by this component.
childpointer to a QObject that needs to be deactivated in parent
parentInfokey=value information map associated with the parent
childInfokey=value information map associated with the child
Returns
true on success, false otherwise. [Note: The return value is currently ignored]

Reimplemented in GCF::GuiComponent.