All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions
Qtilities::Core::ActivityPolicyFilter Class Reference

The ActivityPolicyFilter class is an implementation of AbstractSubjectFilter which allows control over activity of objects within the context of an Observer. More...

#include <ActivityPolicyFilter.h>

Inheritance diagram for Qtilities::Core::ActivityPolicyFilter:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ActivityPolicy { UniqueActivity, MultipleActivity }
 Policy to control if only one, or multiple subjects can be active at any time. More...
enum  MinimumActivityPolicy { AllowNoneActive, ProhibitNoneActive }
 Policy to control the minimum number of subjects which can be active at any time. More...
enum  NewSubjectActivityPolicy { SetNewActive, SetNewInactive }
 Policy to control the activity of new subjects attached to the observer context in which the filter is installed. More...
enum  ParentTrackingPolicy { ParentIgnoreActivity, ParentFollowActivity }
 Policy to control if this activity filter follows the activity of it's parent observer. More...
- Public Types inherited from Qtilities::Core::AbstractSubjectFilter
enum  EvaluationResult { Allowed, Conditional, Rejected }
 Enumeration which defines the possible results of subject filter evaluation operations. More...
- Public Types inherited from Qtilities::Core::Interfaces::IExportable
enum  ExportMode { None = 0, Binary = 1, XML = 2 }
 Possible export modes that an implementation of IExportable can support. More...
enum  Result {
  Complete = 0, Incomplete = 1, Failed = 2, FailedContinue = 4,
  VersionTooNew = 8, VersionTooOld = 16, VersionSupported = 32, SuccessResult = Complete | Incomplete | VersionSupported,
  FailedResult = Failed | FailedContinue | VersionTooNew | VersionTooOld
}
 The possible results of an export/import operation. More...
- Public Types inherited from Qtilities::Core::Interfaces::IModificationNotifier
enum  NotificationTarget { NotifyNone = 0, NotifyListeners = 1, NotifySubjects = 2 }
 The targets which should be notified when the state of the object implementing this interface changes. More...

Public Slots

bool getSubjectActivity (const QObject *obj, bool *ok=0) const
 Get the activity of a specific subject.
bool invertActivity ()
 Invert activity of subjects in the observer context in which this filter is installed.
bool setActiveSubject (QObject *obj, bool broadcast=true)
 Sets a single active subject.
bool setActiveSubjects (QList< QObject * > objects, bool broadcast=true)
 Sets the active subjects. This function will check the validity of the objects list against the activity policies in the filter.
bool setActiveSubjects (QList< QPointer< QObject > > objects, bool broadcast=true)
 Sets the active subjects.
bool setAllActive ()
 Set all subjects to be active in the observer context in which this filter is installed.
bool setNoneActive ()
 Set all subjects to be inactive in the observer context in which this filter is installed.
bool setSubjectActivity (QObject *obj, bool is_active)
 Set the activity of a specific subject.
bool toggleSubjectActivity (QObject *obj)
 Toggles the activity of a specific subject.

Signals

void activeSubjectsChanged (QList< QObject * > active_objects, QList< QObject * > inactive_objects)
 Emitted when the active objects changed.
void modificationStateChanged (bool is_modified) const
 Implement this function as a signal when implementing the object.
- Signals inherited from Qtilities::Core::AbstractSubjectFilter
void monitoredPropertyChanged (const char *property_name, QList< QObject * > objects=QList< QObject * >())
 A signal which is emitted as soon as a monitored property of the observer or any of the installed subject filters changed.
void propertyChangeFiltered (const char *property_name, QList< QObject * > objects=QList< QObject * >())
 A signal which is emitted as soon as an property change event is filtered.

Public Member Functions

QStringList activeSubjectNames () const
 Returns a list with the names of all the active subjects in the current observer context.
QList< QObject * > activeSubjects () const
 Returns a list with references to all the active subjects in the current observer context.
ActivityPolicyFilter::ActivityPolicy activityPolicy () const
 Gets the activity policy used by this subject filter.
bool canInvertActivity () const
 Checks if invertActivity() can change the activity of subjects in this filter.
bool canSetAllActive () const
 Checks if setAllActive() can change the activity of subjects in this filter.
bool canSetNoneActive () const
 Checks if setNoneActive() can change the activity of subjects in this filter.
void disableActivityPolicyEnforcement ()
 Disables enforcement of ActivityPolicy.
void enableActivityPolicyEnforcement ()
 Enables enforcement of ActivityPolicy.
IExportable::ExportResultFlags exportBinary (QDataStream &stream) const
 Allows exporting to a QDataStream.
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.
QString filterName () const
 Returns the name of the subject filter.
void finalizeAttachment (QObject *obj, bool attachment_successful, bool import_cycle=false)
 Finalize the attachment of a the subject to the filter's observer context.
void finalizeDetachment (QObject *obj, bool detachment_successful, bool subject_deleted=false)
 Finalize the detachment of a subject from the filter's observer context.
IExportable::ExportResultFlags importBinary (QDataStream &stream, QList< QPointer< QObject > > &import_list)
 Allows importing and reconstruction of the object state from information provided in a QDataStream.
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.
QStringList inactiveSubjectNames () const
 Returns a list with the names of all the inactive subjects in the current observer context.
QList< QObject * > inactiveSubjects () const
 Returns a list with references to all the inactive subjects in the current observer context.
bool initializeAttachment (QObject *obj, QString *rejectMsg=0, bool import_cycle=false)
 Initialize the attachment of a new subject to the filter's observer context.
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.
ActivityPolicyFilter::MinimumActivityPolicy minimumActivityPolicy () const
 Gets the minumum activity policy used by this subject filter.
QStringList monitoredProperties () const
 This function returns a QStringList with the names of all the properties which are monitored by this subject filter.
ActivityPolicyFilter::NewSubjectActivityPolicy newSubjectActivityPolicy () const
 Gets the new subject activity policy used by this subject filter.
int numActiveSubjects () const
 Gets the number of active subjects in the current observer context.
QObject * objectBase ()
 Returns the QObject* base of the interface.
const QObject * objectBase () const
 Returns a const QObject* base of the interface.
ActivityPolicyFilter::ParentTrackingPolicy parentTrackingPolicy () const
 Gets the parent tracking policy used by this subject filter.
void setActivityPolicy (ActivityPolicyFilter::ActivityPolicy activity_policy)
 Sets the activity policy used by this subject filter.
void setMinimumActivityPolicy (ActivityPolicyFilter::MinimumActivityPolicy minimum_naming_policy)
 Sets the minimum activity policy used by this subject filter.
void setNewSubjectActivityPolicy (ActivityPolicyFilter::NewSubjectActivityPolicy new_subject_activity_policy)
 Sets the new subject activity policy used by this subject filter.
bool setObserverContext (Observer *observer_context)
 Reimplemented from AbstractSubjectFilter in order to install event filter on observer_context.
void setParentTrackingPolicy (ActivityPolicyFilter::ParentTrackingPolicy parent_tracking_policy)
 Sets the parent tracking policy used by this subject filter.
IExportable::ExportModeFlags supportedFormats () const
 Provides information about the export format(s) supported by your implementation of IExportable.
- Public Member Functions inherited from Qtilities::Core::AbstractSubjectFilter
virtual
AbstractSubjectFilter::EvaluationResult 
evaluateAttachment (QObject *obj, QString *rejectMsg=0, bool silent=false) const
 Evaluates the attachment of a new subject to the filter's observer context. Use this function to check how an attachment will be handled.
virtual
AbstractSubjectFilter::EvaluationResult 
evaluateDetachment (QObject *obj, QString *rejectMsg=0) const
 Evaluates the detachment of a subject from the filter's observer context. Use this function to check how an detachment will be handled.
virtual bool initializeDetachment (QObject *obj, QString *rejectMsg=0, bool subject_deleted=false)
 Initialize the detachment of a subject from the filter's observer context.
virtual bool isModificationStateMonitored () const
 Get if this subject filter's modification state is monitored by its observer context.
ObserverobserverContext () const
 Returns the observer context that this subject filter is attached to.
virtual QStringList reservedProperties () const
 This function returns a QStringList with the names of all the reserved properties of this subject filter.
virtual void setIsModificationStateMonitored (bool is_monitored)
 Set if this subject filter's modification state is monitored by its observer context.
- 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.
virtual void clearExportTask ()
 Clears the export task.
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 setExportVersion (Qtilities::ExportVersion version)
 Returns the export version currently used by all Qtilities classes.
virtual void setIsExportable (bool new_is_exportable)
 Sets if this object must be part of it's parents' exports.
- 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::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.

Static Public Member Functions

static QString activityPolicyToString (ActivityPolicy activity_policy)
 Function which returns a string associated with a specific ActivityPolicy.
static QString minimumActivityPolicyToString (MinimumActivityPolicy minimum_activity_policy)
 Function which returns a string associated with a specific MinimumActivityPolicy.
static QString newSubjectActivityPolicyToString (NewSubjectActivityPolicy new_subject_activity_policy)
 Function which returns a string associated with a specific NewSubjectActivityPolicy.
static QString parentTrackingPolicyToString (ParentTrackingPolicy parent_tracking_policy)
 Function which returns a string associated with a specific ParentTrackingPolicy.
static ActivityPolicy stringToActivityPolicy (const QString &activity_policy_string)
 Function which returns the ActivityPolicy associated with a string.
static MinimumActivityPolicy stringToMinimumActivityPolicy (const QString &minimum_activity_policy_string)
 Function which returns the MinimumActivityPolicy associated with a string.
static NewSubjectActivityPolicy stringToNewSubjectActivityPolicy (const QString &new_subject_activity_policy_string)
 Function which returns the NewSubjectActivityPolicy associated with a string.
static ParentTrackingPolicy stringToParentTrackingPolicy (const QString &parent_tracking_policy_string)
 Function which returns the ParentTrackingPolicy associated with a string.

Protected Member Functions

bool handleMonitoredPropertyChange (QObject *obj, const char *property_name, QDynamicPropertyChangeEvent *propertyChangeEvent)
 Function which should react to QDynamicPropertyChangeEvents on properties which are reserved by the subject filter.

Additional Inherited Members

- Protected Attributes inherited from Qtilities::Core::AbstractSubjectFilter
bool filter_is_modification_state_monitored
 Indicates if the modification state of the filter is monitored by it's observer context.
Observerobserver
 The observer context to which the subject filter is attached.

Detailed Description

The ActivityPolicyFilter class is an implementation of AbstractSubjectFilter which allows control over activity of objects within the context of an Observer.

It is usefull when you need to control the activity of subjects within the context of an observer.

To install a ActivityPolicyFilter on an Observer is easy:

Observer* obs = new Observer;
ActivityPolicyFilter* activity_filter = new ActivityPolicyFilter;
obs->installSubjectFilter(activity_filter);

When you use Qtilities::CoreGui::TreeNode instead, its even easier:

TreeNode* tree_node = new TreeNode;
ActivityPolicyFilter* activity_filter = tree_node->enableActivityControl(ObserverHints::CheckboxActivityDisplay);

Member Enumeration Documentation

Policy to control if only one, or multiple subjects can be active at any time.

See also:
setActivityPolicy(), activityPolicy()
Enumerator:
UniqueActivity 

Only one subject can be active at any time.

MultipleActivity 

Multiple subjects can be active at any time.

Policy to control the minimum number of subjects which can be active at any time.

See also:
setMinimumActivityPolicy(), minimumActivityPolicy()
Enumerator:
AllowNoneActive 

All subjects can be incative at the same time.

ProhibitNoneActive 

There should at least be one active subject at any time, unless no subjects are attached to the observer context in which the filter is installed

Policy to control the activity of new subjects attached to the observer context in which the filter is installed.

See also:
setNewSubjectActivityPolicy(), newSubjectActivityPolicy()
Enumerator:
SetNewActive 

New subjects are automatically set to be active.

SetNewInactive 

New subjects are automatically set to be inactive.

Policy to control if this activity filter follows the activity of it's parent observer.

This policy allows developers to implement the functionality where clicking on a node in a tree will enable/disabled (check/uncheck) all items underneath the node.

For an example of this behaviour see the Parent Tracking Activity tab in the BuildingTreesExample.

Note:
To track the activity of the observer parent, the observer parent must have only one parent itself (othwerise it won't be possible to know in which context the activity must be tracked) and the parent must have an activity policy filter installed.
In order for the activity property changes to be delivered to this filter, the delivery of QtilitiesPropertyChangeEvents must be enabled on the parent observer. See Qtilities::Core::Observer::toggleQtilitiesPropertyChangeEvents().
When minimumActivityPolicy() is set to ProhibitNoneActive, setting the activity to false on the observer parent will attempt to disable all objects within this context. However this will be prohibited and nothing will change. The opposite, that is setting the activity to true on the observer parent will still work as expected.
When activityPolicy() is set to UniqueActivity, this policy does nothing when set to ParentFollowActivity since only one subject can be active at any time.
See also:
setParentTrackingPolicy(), parentTrackingPolicy()
Enumerator:
ParentIgnoreActivity 

This filter does not track or care about the activity of its observer parent.

ParentFollowActivity 

This filter tracks the activity of its observer parent.


Member Function Documentation

void Qtilities::Core::ActivityPolicyFilter::activeSubjectsChanged ( QList< QObject * >  active_objects,
QList< QObject * >  inactive_objects 
)
signal

Emitted when the active objects changed.

*Use this signal when you have access to the observer reference, rather than waiting for a *QtilitiesPropertyChangeEvent on each object in the observer context.

Note:
This signal is not emmited while a processing cycle is active on this filter's observer *context. In that scenario, the signal will be emitted when the processing cycle on the observer *context ends only if the active subjects changed during the processing cycle.
Qtilities::Core::ActivityPolicyFilter::ActivityPolicy Qtilities::Core::ActivityPolicyFilter::activityPolicy ( ) const

Gets the activity policy used by this subject filter.

Default is MultipleActivity.

See also:
setActivityPolicy()
bool Qtilities::Core::ActivityPolicyFilter::canInvertActivity ( ) const

Checks if invertActivity() can change the activity of subjects in this filter.

Inversion depends on the activity policies and has the following requirements:

Returns:
If the above criteria is not met, false is returned. True otherwise.
See also:
invertActivity();
bool Qtilities::Core::ActivityPolicyFilter::canSetAllActive ( ) const

Checks if setAllActive() can change the activity of subjects in this filter.

Being able to set all subjects active depends on the activity policies and has the following requirements:

Returns:
If the above criteria is not met, false is returned. True otherwise.
See also:
setAllActive();
bool Qtilities::Core::ActivityPolicyFilter::canSetNoneActive ( ) const

Checks if setNoneActive() can change the activity of subjects in this filter.

Being able to set all subjects inactive depends on the activity policies and has the following requirements:

Returns:
If the above criteria is not met, false is returned. True otherwise.
See also:
setNoneActive();
void Qtilities::Core::ActivityPolicyFilter::disableActivityPolicyEnforcement ( )

Disables enforcement of ActivityPolicy.

This can be usefull when the activity of a context is known to be correct and you need to speed up attachment of a large number of items.

Note:
When using this, make sure you know that the activity will be valid. Also, make sure to enable activity policy enforcement again using enablePolicyEnforcement().
See also:
enableActivityPolicyEnforcement();
void Qtilities::Core::ActivityPolicyFilter::enableActivityPolicyEnforcement ( )

Enables enforcement of ActivityPolicy.

See also:
disableActivityPolicyEnforcement();
Qtilities::Core::Interfaces::IExportable::ExportResultFlags Qtilities::Core::ActivityPolicyFilter::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::Interfaces::IExportable::ExportResultFlags Qtilities::Core::ActivityPolicyFilter::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.

void Qtilities::Core::ActivityPolicyFilter::finalizeAttachment ( QObject *  obj,
bool  attachment_successful,
bool  import_cycle = false 
)
virtual

Finalize the attachment of a the subject to the filter's observer context.

Note:
When attachment_successful is true, the object will already be attached to the observer context.
Parameters:
objThe object to be added.
import_cycleIndicates if the attachment call was made during an observer import cycle. In such cases the subject filter must not add exportable properties to the object since these properties will be added from the import source. Also, it is not neccesarry to validate the context in such cases.
attachment_successfulTrue if the attachment was successful, false otherwise.
Note:
By default does nothing in the base class.

Reimplemented from Qtilities::Core::AbstractSubjectFilter.

void Qtilities::Core::ActivityPolicyFilter::finalizeDetachment ( QObject *  obj,
bool  detachment_successful,
bool  subject_deleted = false 
)
virtual

Finalize the detachment of a subject from the filter's observer context.

Parameters:
objThe object to be detached.
detachment_successfulTrue if the detachment was successfull, false otherwise.
subject_deletedIndicates if the detachment operation is happening because the subject was deleted. This allows for optimization inside implementations of this function.
Note:
By default does nothing in the base class.

Reimplemented from Qtilities::Core::AbstractSubjectFilter.

bool Qtilities::Core::ActivityPolicyFilter::getSubjectActivity ( const QObject *  obj,
bool *  ok = 0 
) const
slot

Get the activity of a specific subject.

Parameters:
objThe subject to toggle the activity for.
okTrue if the return value can be trusted, that is the subject is observed in this context etc. False otherwise.
Returns:
The activity of the subject.
bool Qtilities::Core::ActivityPolicyFilter::handleMonitoredPropertyChange ( QObject *  obj,
const char *  property_name,
QDynamicPropertyChangeEvent *  propertyChangeEvent 
)
protectedvirtual

Function which should react to QDynamicPropertyChangeEvents on properties which are reserved by the subject filter.

As soon as a subject is attached to an observer the observer installs a event filter on the subject which monitors dynamic property changes. When a dynamic property change event is received, the observer will route the event to the appropriate subject filter and call this function on the subject filter. Thus, this function will only be called when the property_name is a reserved property of the subject filter.

Parameters:
objThe object on which the property change took place.
property_nameThe property name which changed.
propertyChangeEventThe QDynamicPropertyChangeEvent which triggered the event.
Returns:
Return true if the event should be filtered (thus, the event will not be allowed to finish and the property will not change), false otherwise when the change event should be allowed (thus, the event will not be filtered and the property will change if not filtered by any other subject filters).
Note:
By default false is returned by the base class.
See also:
monitoredProperties()

Reimplemented from Qtilities::Core::AbstractSubjectFilter.

Qtilities::Core::Interfaces::IExportable::ExportResultFlags Qtilities::Core::ActivityPolicyFilter::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::Core::ActivityPolicyFilter::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.

bool Qtilities::Core::ActivityPolicyFilter::initializeAttachment ( QObject *  obj,
QString *  rejectMsg = 0,
bool  import_cycle = false 
)
virtual

Initialize the attachment of a new subject to the filter's observer context.

Note:
The object is not yet attached to the observer context when this function is called.
Parameters:
objThe object to be added.
import_cycleIndicates if the attachment call was made during an observer import cycle. In such cases the subject filter must not add exportable properties to the object since these properties will be added from the import source. Also, it is not neccesarry to validate the context in such cases.
Returns:
Return true if the attachment is allowed, false otherwise.
True if the attachment was successfully initialized, false otherwise.
Note:
By default true is returned by the base class.

Reimplemented from Qtilities::Core::AbstractSubjectFilter.

Qtilities::Core::InstanceFactoryInfo Qtilities::Core::ActivityPolicyFilter::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.

bool Qtilities::Core::ActivityPolicyFilter::invertActivity ( )
slot

Invert activity of subjects in the observer context in which this filter is installed.

Returns:
If the inversion could be done, false otherwise.
See also:
canInvertActivity();
Qtilities::Core::ActivityPolicyFilter::MinimumActivityPolicy Qtilities::Core::ActivityPolicyFilter::minimumActivityPolicy ( ) const

Gets the minumum activity policy used by this subject filter.

Default is AllowNoneActive.

See also:
setMinimumActivityPolicy()
void Qtilities::Core::ActivityPolicyFilter::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.

QStringList Qtilities::Core::ActivityPolicyFilter::monitoredProperties ( ) const
virtual

This function returns a QStringList with the names of all the properties which are monitored by this subject filter.

Monitored properties are all properties that you use on your subject filter that does not appear in the reservedProperties() list. All of these properties will be monitored by the observer context in which the subject filter is installed. The property change events will be delivered to handleMonitoredPropertyChange().

When property changes are valid, the monitoredPropertyChanged() signal is emitted as soon as the property change is completed.

Note:
By default an empty QStringList() is returned by the base class.
See also:
handleMonitoredPropertyChange(), monitoredPropertyChanged()

Reimplemented from Qtilities::Core::AbstractSubjectFilter.

Qtilities::Core::ActivityPolicyFilter::NewSubjectActivityPolicy Qtilities::Core::ActivityPolicyFilter::newSubjectActivityPolicy ( ) const

Gets the new subject activity policy used by this subject filter.

Default is SetNewInactive.

See also:
setNewSubjectActivityPolicy()
const QObject* Qtilities::Core::ActivityPolicyFilter::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.

Qtilities::Core::ActivityPolicyFilter::ParentTrackingPolicy Qtilities::Core::ActivityPolicyFilter::parentTrackingPolicy ( ) const

Gets the parent tracking policy used by this subject filter.

Default is ParentIgnoreActivity.

See also:
setParentTrackingPolicy()
void Qtilities::Core::ActivityPolicyFilter::setActivityPolicy ( ActivityPolicyFilter::ActivityPolicy  activity_policy)

Sets the activity policy used by this subject filter.

The policy can only be changed if no observer context has been set yet or if an observer context with no subjects have been set.

See also:
activityPolicy()
bool Qtilities::Core::ActivityPolicyFilter::setAllActive ( )
slot

Set all subjects to be active in the observer context in which this filter is installed.

Returns:
True if all subjects could be set active, false otherwise.
See also:
canSetAllActive();
void Qtilities::Core::ActivityPolicyFilter::setMinimumActivityPolicy ( ActivityPolicyFilter::MinimumActivityPolicy  minimum_naming_policy)

Sets the minimum activity policy used by this subject filter.

The policy can only be changed if no observer context has been set yet or if an observer context with no subjects have been set.

See also:
minimumActivityPolicy()
void Qtilities::Core::ActivityPolicyFilter::setNewSubjectActivityPolicy ( ActivityPolicyFilter::NewSubjectActivityPolicy  new_subject_activity_policy)

Sets the new subject activity policy used by this subject filter.

The policy can only be changed at any time.

See also:
newSubjectActivityPolicy()
bool Qtilities::Core::ActivityPolicyFilter::setNoneActive ( )
slot

Set all subjects to be inactive in the observer context in which this filter is installed.

Returns:
True if all subjects could be set inactive, false otherwise.
See also:
canSetNoneActive();
void Qtilities::Core::ActivityPolicyFilter::setParentTrackingPolicy ( ActivityPolicyFilter::ParentTrackingPolicy  parent_tracking_policy)

Sets the parent tracking policy used by this subject filter.

The policy can only be changed if no observer context has been set yet or if an observer context with no subjects have been set.

See also:
parentTrackingPolicy()
bool Qtilities::Core::ActivityPolicyFilter::setSubjectActivity ( QObject *  obj,
bool  is_active 
)
slot

Set the activity of a specific subject.

Parameters:
objThe subject to toggle the activity for.
is_activeThe new activity to be set on obj.
Returns:
True if successfull, false otherwise.
Qtilities::Core::Interfaces::IExportable::ExportModeFlags Qtilities::Core::ActivityPolicyFilter::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.

bool Qtilities::Core::ActivityPolicyFilter::toggleSubjectActivity ( QObject *  obj)
slot

Toggles the activity of a specific subject.

Parameters:
objThe subject to toggle the activity for.
Returns:
True if successfull, false otherwise.


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