Used by the ModeManager to communicate with child modes. More...
#include <IMode.h>
Public Member Functions | |
virtual void | aboutToBeActivated () |
This function is called when the mode is about to be activated. That is, when the user clicks on the mode and it is going to become the active mode. | |
virtual QString | contextHelpId () const |
Returns a help ID for this context. | |
virtual QString | contextString () const |
Returns a context string for the context associated with this mode. | |
virtual void | initializeMode ()=0 |
This function is called in the initializeDependencies() function, thus all objects implementing interfaces in which a mode might be interested will be present in the global object pool. | |
virtual void | justActivated () |
This function is called after a mode was activated. That is, when the user clicked on the mode and it became the active mode. | |
virtual QIcon | modeIcon () const =0 |
An icon for the mode. | |
virtual int | modeID () const |
Returns a unique ID for this mode. | |
virtual QString | modeName () const =0 |
The name of the mode which is the text used to represent it. | |
virtual QWidget * | modeWidget ()=0 |
The main window's central widget for the mode. | |
virtual bool | setModeIcon (QIcon icon) |
A function which can be implemented by modes if they allow their icon to be changed. By default this function does nothing and returns false. | |
void | setModeID (int mode_id) |
Sets the mode ID for this mode. | |
void | setTargetManagerIDs (QList< int > new_target_manager_ids) |
Sets the list of mode managers in which this mode must appear. | |
int | supportedExtensionWidgetLocations () const |
Returns the supported locations of extension widgets in this mode. | |
QList< int > | targetManagerIDs () const |
Gets the list of mode managers in which this mode must appear. | |
Public Member Functions inherited from Qtilities::Core::Interfaces::IObjectBase | |
virtual QObject * | objectBase ()=0 |
Returns the QObject* base of the interface. | |
virtual const QObject * | objectBase () const =0 |
Returns a const QObject* base of the interface. | |
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. |
Used by the ModeManager to communicate with child modes.
|
inlinevirtual |
This function is called when the mode is about to be activated. That is, when the user clicks on the mode and it is going to become the active mode.
By default this function does nothing. Modes that require this functionality must reimplement this virtual function.
Reimplemented in Qtilities::Testing::DebugWidget.
|
inlinevirtual |
Returns a context string for the context associated with this mode.
By default no context will be associated with a mode.
Implements Qtilities::Core::Interfaces::IContext.
Reimplemented in Qtilities::Examples::ObjectManagement::ObjectManagementMode, Qtilities::Examples::MainWindow::ExampleMode, Qtilities::Plugins::Help::HelpMode, Qtilities::Examples::TasksExample::ExampleMode, and Qtilities::Plugins::SessionLog::SessionLogMode.
|
inlinevirtual |
This function is called after a mode was activated. That is, when the user clicked on the mode and it became the active mode.
By default this function does nothing. Modes that require this functionality must reimplement this virtual function.
|
pure virtual |
An icon for the mode.
The expected mode icon size is 48x48.
Implemented in Qtilities::Examples::ObjectManagement::ObjectManagementMode, Qtilities::Examples::MainWindow::ExampleMode, Qtilities::Plugins::Help::HelpMode, Qtilities::Examples::TasksExample::ExampleMode, Qtilities::Testing::DebugWidget, and Qtilities::Plugins::SessionLog::SessionLogMode.
|
inlinevirtual |
Returns a unique ID for this mode.
A mode ID is an unique number which is associated with a mode in an application. This allows modes with the same name to be added if desired. From the developer's perspective you don't have to reimplement this function in your interface implementation. In that case the Qtilities::CoreGui::ModeManager class will assign an unique mode ID when the mode is added to the mode manager and a debug message will be printed with information about the newly assigned mode ID.
It is however desired to specify your own mode ID in some cases, more specifically if you use the Qtilities::CoreGui::DynamicSideWidgetViewer widget in your application and you want dynamic side viewer widgets to appear only in specific application modes. To achieve this your modeID() must appear in the list of Qtilities::CoreGui::Interfaces::ISideViewerWidget::destinationModes() for a specific side viewer widget implementation.
Reimplemented in Qtilities::Examples::MainWindow::ExampleMode, Qtilities::Plugins::Help::HelpMode, and Qtilities::Examples::TasksExample::ExampleMode.
|
pure virtual |
The main window's central widget for the mode.
This widget must have a proper layout in order to be displayed correctly.
Implemented in Qtilities::Examples::ObjectManagement::ObjectManagementMode, Qtilities::Examples::MainWindow::ExampleMode, Qtilities::Plugins::Help::HelpMode, Qtilities::Examples::TasksExample::ExampleMode, Qtilities::Testing::DebugWidget, and Qtilities::Plugins::SessionLog::SessionLogMode.
|
inlinevirtual |
A function which can be implemented by modes if they allow their icon to be changed. By default this function does nothing and returns false.
The expected mode icon size is 48x48.
Reimplemented in Qtilities::Plugins::Help::HelpMode, and Qtilities::Plugins::SessionLog::SessionLogMode.
|
inline |
Sets the mode ID for this mode.
When your IMode implementation does not reimplement modeID(), it will automatically return the mode ID which was assigned by the ModeManager. If you want to use your own mode ID you must reimplement modeID() and return your mode there, or set it using this function.
|
inline |
Sets the list of mode managers in which this mode must appear.
|
inline |
Returns the supported locations of extension widgets in this mode.
The default implementation returns 0 which is equal to no locations.
This function was added in Qtilities v1.3.
|
inline |
Gets the list of mode managers in which this mode must appear.
The default implementation returns qti_def_DEFAULT_MODE_MANAGER which is used by the mode manager constructed by QtilitiesMainWindow.
Qtilities : Reference Documentation | Back to top |
Copyright © 2009-2013, Jaco Naudé
|