Interface used to communicate with the context manager. More...
#include <IContextManager.h>
Public Slots | |
virtual void | addContexts (QObject *obj)=0 |
Inspects obj and if it implements Qtilities::Core::Interfaces::IContext, the context will be registered. | |
virtual void | broadcastState ()=0 |
Slot which will emit the current state of the context manager. Use this if you updated your contexts using notify = false. |
Signals | |
void | aboutToAppendContext (int context_id) |
Signal which is emitted when the appendContext() is about to append the context. | |
void | aboutToRemoveContext (int context_id) |
Signal which is emitted when the removeContext() is about to remove the context. | |
void | aboutToSetNewContext (int context_id) |
Signal which is emitted when the setNewContext() is about to set the new context. | |
void | aboutToUnregisterContext (int context_id) |
Signal which is emitted when the unregisterContext() is about to unregister the context. | |
void | contextChanged (QList< int > new_contexts) |
Notification that the context changes. | |
void | finishedAppendContext (int context_id) |
Signal which is emitted when the appendContext() function finished appending the context. | |
void | finishedRemoveContext (int context_id) |
Signal which is emitted when the removeContext() is done removing the context. | |
void | finishedSetNewContext (int context_id) |
Signal which is emitted when the setNewContext() finished to set the new context. | |
void | finishedUnregisterContext (int context_id) |
Signal which is emitted when the unregisterContext() is done unregistering the context. |
Public Member Functions | |
virtual QStringList | activeContextNames () const =0 |
Returns the names of all active contexts. | |
virtual QList< int > | activeContexts () const =0 |
Gets the current context. | |
virtual QList< int > | allContexts () const =0 |
Returns a list of all the contexts currently registered. | |
virtual void | appendContext (int context_id, bool notify=true)=0 |
Appends a context to the set of active contexts. | |
virtual void | appendContext (const QString &context_string, bool notify=true)=0 |
Appends a context to the set of active contexts. The context is identified using a string. | |
virtual QString | contextHelpID (int context_id) const =0 |
Returns the context help id for a given context id. QString() is returned if no help id was registered for the given context id. | |
virtual QString | contextHelpID (const QString &context_string) const =0 |
Returns the context help id for a given context string. QString() is returned if no help id was registered for the given context string. | |
virtual int | contextID (const QString &context_string)=0 |
Returns an unique context ID for the given context string. Contexts are stored and identified using integer ID values throughout the library. | |
virtual QStringList | contextNames () const =0 |
Returns the names of all registered contexts. | |
virtual QString | contextString (int context_id) const =0 |
Returns the string which was used to register a context id. If the context id does not exist, QString() is returned. | |
virtual bool | hasContext (QList< int > contexts) const =0 |
Returns true if any of the contexts in the list were registered in the context manager. | |
virtual bool | hasContext (int context) const =0 |
Returns true if the specified context is registered in the context manager. | |
virtual bool | hasContext (const QString &context_string) const =0 |
Returns true if the specified context string is registered in the context manager. | |
QObject * | objectBase () |
Returns the QObject* base of the interface. | |
const QObject * | objectBase () const |
Returns a const QObject* base of the interface. | |
virtual int | registerContext (const QString &context, const QString &context_help_id=QString())=0 |
Registers a new context. | |
virtual void | removeContext (int context_id, bool notify=true)=0 |
Removes a context from the set of active contexts. | |
virtual void | removeContext (const QString &context_string, bool notify=true)=0 |
Removes a context from the set of active contexts. The context is identified using a string. | |
virtual void | setNewContext (int context_id, bool notify=true)=0 |
Sets a new context. Will clear all current active contexts. | |
virtual void | setNewContext (const QString &context_string, bool notify=true)=0 |
Sets a new context. Will clear all current active contexts. The context is identified using a string. | |
virtual bool | unregisterContext (int context_id, bool notify=true)=0 |
Unregisters an existing context. | |
virtual bool | unregisterContext (const QString &context_string, bool notify=true)=0 |
Unregisters an existing context. | |
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. |
Interface used to communicate with the context manager.
See the Action Management article for more information about the context manager.
|
signal |
Signal which is emitted when the unregisterContext() is about to unregister the context.
context_id | The applicable context. |
This function was added in Qtilities v1.2.
|
signal |
Signal which is emitted when the unregisterContext() is done unregistering the context.
context_id | The applicable context. |
This function was added in Qtilities v1.2.
|
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.
|
pure virtual |
Registers a new context.
The recommended way to do this is to let your object implement IContext and then register it with the global object pool which will automate the registration of your context.
Implemented in Qtilities::Core::ContextManager.
|
pure virtual |
Unregisters an existing context.
context_id | The ID of the context to be unregistered. |
notify | Indicates if the context manager must notify when the active context(s) changed due to this unregisteration. |
Implemented in Qtilities::Core::ContextManager.
|
pure virtual |
Unregisters an existing context.
context_string | The string representation of the context to be unregistered. |
notify | Indicates if the context manager must notify when the active context(s) changed due to this unregisteration. |
Implemented in Qtilities::Core::ContextManager.
Qtilities : Reference Documentation | Back to top |
Copyright © 2009-2013, Jaco Naudé
|