All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions
Qtilities::CoreGui::Interfaces::IMode Class Reference

Used by the ModeManager to communicate with child modes. More...

#include <IMode.h>

Inheritance diagram for Qtilities::CoreGui::Interfaces::IMode:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

Used by the ModeManager to communicate with child modes.


Member Function Documentation

virtual void Qtilities::CoreGui::Interfaces::IMode::aboutToBeActivated ( )
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.

See also:
justActivated()

Reimplemented in Qtilities::Testing::DebugWidget.

virtual QString Qtilities::CoreGui::Interfaces::IMode::contextString ( ) const
inlinevirtual
virtual void Qtilities::CoreGui::Interfaces::IMode::justActivated ( )
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.

See also:
aboutToBeActivated()
virtual QIcon Qtilities::CoreGui::Interfaces::IMode::modeIcon ( ) const
pure virtual
virtual int Qtilities::CoreGui::Interfaces::IMode::modeID ( ) const
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.

Note:
Mode IDs available for user modes range from 100 - 999. The mode manager starts to auto-assign unique mode IDs from 1000 onwards for modes which does not have their own IDs.

Reimplemented in Qtilities::Examples::MainWindow::ExampleMode, Qtilities::Plugins::Help::HelpMode, and Qtilities::Examples::TasksExample::ExampleMode.

virtual QWidget* Qtilities::CoreGui::Interfaces::IMode::modeWidget ( )
pure virtual
virtual bool Qtilities::CoreGui::Interfaces::IMode::setModeIcon ( QIcon  icon)
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.

See also:
modeIcon()

Reimplemented in Qtilities::Plugins::Help::HelpMode, and Qtilities::Plugins::SessionLog::SessionLogMode.

void Qtilities::CoreGui::Interfaces::IMode::setModeID ( int  mode_id)
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.

void Qtilities::CoreGui::Interfaces::IMode::setTargetManagerIDs ( QList< int >  new_target_manager_ids)
inline

Sets the list of mode managers in which this mode must appear.

See also:
targetManagerIDs()
int Qtilities::CoreGui::Interfaces::IMode::supportedExtensionWidgetLocations ( ) const
inline

Returns the supported locations of extension widgets in this mode.

The default implementation returns 0 which is equal to no locations.

Returns:
(int) QtilitiesMainWindow::ModeLayoutFlags representing the supported extension widget locations.

This function was added in Qtilities v1.3.

QList<int> Qtilities::CoreGui::Interfaces::IMode::targetManagerIDs ( ) const
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.

See also:
setTargetManagerIDs()


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