Carousel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
Public Member Functions | Protected Slots | List of all members
CarouselInteractionService Class Reference

This class is registered into the application services by the InteractionServiceComponent. More...

#include <CarouselInteractionService.h>

Inherits IInteractionService.

Public Member Functions

 CarouselInteractionService (IServiceLocator *serviceLocator, QMainWindow *mainWindow, IComponentManager *manager, QObject *parent=nullptr)
 
IToolactiveTool ()
 
ICatalogscatalogs ()
 
const ICatalogscatalogs () const
 
IComponentConfigurationDelegateconfigurationDelegate ()
 
IInputDispatcherdispatcher ()
 
void loadUiState (int version=0)
 
QMainWindowmainWindow ()
 
void resetUi ()
 
void saveUiState (int version=0)
 
void setActiveTool (ITool *activeTool)
 
void setConfigurationDelegate (IComponentConfigurationDelegate *configurationDelegate)
 
void setDispatcher (IInputDispatcher *dispatcher)
 
- 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
 

Protected Slots

void onComponentAboutToShutDown (IComponent *component)
 
void onComponentManagerAboutToShutDown ()
 
void onComponentManagerStartedUp ()
 
void onComponentStartedUp (IComponent *component)
 
void onToolDeleted ()
 
void onToolExecutingStopped ()
 

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 class is registered into the application services by the InteractionServiceComponent.

See Also
IInteractionService.

Constructor & Destructor Documentation

CarouselInteractionService::CarouselInteractionService ( IServiceLocator serviceLocator,
QMainWindow mainWindow,
IComponentManager manager,
QObject parent = nullptr 
)

Initializes a new instance of the CarouselInteractionService class using specified instances of the application, mainWindow and manager.

Member Function Documentation

ITool* CarouselInteractionService::activeTool ( )
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

Implements IInteractionService.

ICatalogs& CarouselInteractionService::catalogs ( )
virtual

Gets the catalog collection.

Implements IInteractionService.

const ICatalogs& CarouselInteractionService::catalogs ( ) const
virtual

Gets the immutable catalog collection.

Implements IInteractionService.

IComponentConfigurationDelegate* CarouselInteractionService::configurationDelegate ( )

Gets the current configuration delegate responsible for the configuring started up component.

See Also
setConfigurationDelegate;
IInputDispatcher* CarouselInteractionService::dispatcher ( )
virtual

Gets the current user input dispatcher. Null by default.

See Also
setDispatcher, activeTool

Implements IInteractionService.

void CarouselInteractionService::loadUiState ( int  version = 0)
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()

Implements IInteractionService.

QMainWindow& CarouselInteractionService::mainWindow ( )
virtual

Gets the application shell or main window.

Implements IInteractionService.

void CarouselInteractionService::resetUi ( )
virtual

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

See Also
setConfigurationDelegate

Implements IInteractionService.

void CarouselInteractionService::saveUiState ( int  version = 0)
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()

Implements IInteractionService.

void CarouselInteractionService::setActiveTool ( ITool activeTool)
virtual

Deactivates current tool and sets the specified tool as active.

See Also
activeTool

Implements IInteractionService.

void CarouselInteractionService::setConfigurationDelegate ( IComponentConfigurationDelegate configurationDelegate)
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 CarouselInteractionService takes ownership of the configuration delegate.

Implements IInteractionService.

void CarouselInteractionService::setDispatcher ( IInputDispatcher dispatcher)
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 CarouselInteractionService takes ownership of the dispatcher.

See Also
setDispatcher, activeTool

Implements IInteractionService.

void CarouselInteractionService::onComponentManagerStartedUp ( )
protectedslot

Configures all started components using configuration delegate (if any). It also connects the onComponentStartedUp() slot to the manager's componentStarted() signal This slot is invoked when component manager started up.

void CarouselInteractionService::onComponentStartedUp ( IComponent component)
protectedslot

Configures a component using configuration delegate (if any). This slot is invoked when component is started up.

void CarouselInteractionService::onComponentAboutToShutDown ( IComponent component)
protectedslot

Deconfigures a component using configuration delegate (if any). This slot is invoked when component is prepared for shut down.

void CarouselInteractionService::onComponentManagerAboutToShutDown ( )
protectedslot

Saves UI state. This slot is invoked when component manager prepares for shut down.

void CarouselInteractionService::onToolExecutingStopped ( )
protectedslot

Sets active tool and receiver to nullptr to the current dispatcher (if any). This slot is invoked when active tool is stopped.

void CarouselInteractionService::onToolDeleted ( )
protectedslot

Sets active tool and receiver to nullptr to the current dispatcher (if any). This slot is invoked when active tool instance is deleted.