Carousel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
Public Member Functions | List of all members
IInteractionService Class Referenceabstract

This service provides methods to configure application GUI like menus, operations, toolbars and other, and it is registered into the application services by the InteractionServiceComponent. More...

#include <IInteractionService.h>

Inherits QObject.

Inherited by CarouselInteractionService.

Public Member Functions

virtual IToolactiveTool ()=0
 
virtual ICatalogscatalogs ()=0
 
virtual const ICatalogscatalogs () const =0
 
virtual IInputDispatcherdispatcher ()=0
 
virtual void loadUiState (int version=0)=0
 
virtual QMainWindowmainWindow ()=0
 
virtual void resetUi ()=0
 
virtual void saveUiState (int version=0)=0
 
virtual void setActiveTool (ITool *activeTool)=0
 
virtual void setConfigurationDelegate (IComponentConfigurationDelegate *configurationDelegate)=0
 
virtual void setDispatcher (IInputDispatcher *dispatcher)=0
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

This service provides methods to configure application GUI like menus, operations, toolbars and other, and it is registered into the application services by the InteractionServiceComponent.

The IInteractionService interface is a starting point for many tasks one does with a application GUI. For example, use IInteractionService to obtain catalogs to add menus or operations; access the main window (eg, for getting central widget); specify active application tool to intercept the user actions (mouse move, mouse clicks, keys pressed).

The IInteractionService has a reference to the IComponentManager object, and it asks added components (if they register IInteractiveExtension) to register new menus, operations and toolbars into the catalogs. The IComponentConfigurationDelegate is used for it.

InteractiveServiceComponent registers this service in the application services, so you can get reference to IInteractionService the next way:

* IInteractionService* interactiveService = application->serviceLocator().locate<IInteractionService>();
*

but make sure, that your component that used IInteractionService is a child for the InteractiveServiceComponent.

See Also
ComponentDefinition::parents()

Member Function Documentation

virtual ITool* IInteractionService::activeTool ( )
pure virtual

The currently selected tool in application. When not null, user's mouse and keyboard events from the central widget are sent to this tool by IInputDispatcher.

See Also
setDispatcher, dispatcher

Implemented in CarouselInteractionService.

virtual ICatalogs& IInteractionService::catalogs ( )
pure virtual

Gets the catalog collection.

Implemented in CarouselInteractionService.

virtual const ICatalogs& IInteractionService::catalogs ( ) const
pure virtual

Gets the immutable catalog collection.

Implemented in CarouselInteractionService.

virtual IInputDispatcher* IInteractionService::dispatcher ( )
pure virtual

Gets the current user input dispatcher. Null by default.

See Also
setDispatcher, activeTool

Implemented in CarouselInteractionService.

virtual void IInteractionService::loadUiState ( int  version = 0)
pure virtual

Loads the geometry for top-level widgets and state of this mainwindow's toolbars and dockwidgets. The version number is compared with that is already stored (if any).

If they do not match, the mainwindow's state is left unchanged

It is after start up of the component to try to restore newly started component Ui.

See Also
saveUiState()

Implemented in CarouselInteractionService.

virtual QMainWindow& IInteractionService::mainWindow ( )
pure virtual

Gets the application shell or main window.

Implemented in CarouselInteractionService.

virtual void IInteractionService::resetUi ( )
pure virtual

Uses IConfigurationDelegate to clear changes done by components (using IConfigurationDelegate::deconfigure()) and configure components again.

See Also
setConfigurationDelegate

Implemented in CarouselInteractionService.

virtual void IInteractionService::saveUiState ( int  version = 0)
pure virtual

Saves the current geometry for top-level widgets and state of this mainwindow's toolbars and dockwidgets. The version number is stored as part of the data.

It is called at least in the destructor of the service.

See Also
loadUiState()

Implemented in CarouselInteractionService.

virtual void IInteractionService::setActiveTool ( ITool activeTool)
pure virtual

Deactivates current tool and sets the specified tool as active.

See Also
activeTool

Implemented in CarouselInteractionService.

virtual void IInteractionService::setConfigurationDelegate ( IComponentConfigurationDelegate configurationDelegate)
pure virtual

Sets the configuration delegate responsible for the configuring started up component: IComponentConfigurationDelegate::configure() method will be binded to the IComponentManager::componentStarted() signal.

CarouselComponentConfigurationDelegate is used by default. Note, that IInteractionService takes ownership of the configuration delegate.

Implemented in CarouselInteractionService.

virtual void IInteractionService::setDispatcher ( IInputDispatcher dispatcher)
pure virtual

Deletes the previous (if any) and sets the new input dispatcher in one of your GUI components. If you want user input would be sent to the active tool, use following snippet:

* IInteractionService* interactionService = application->serviceLocator().locate<IInteractionService>();
* interactionService->setDispatcher(new InputDispatcher());
* interactionService->dispatcher()->setSender(interactionService->mainWindow.centralWidget());
*

Null by default. Note, that IInteractionService takes ownership of the dispatcher.

See Also
setDispatcher, activeTool

Implemented in CarouselInteractionService.