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

This class provides methods to application widget events' manipulating and transfering them to the active application's tool. More...

#include <InputDispatcher.h>

Inherits QObject, and IInputDispatcher.

Public Member Functions

 InputDispatcher (QObject *parent=nullptr)
 
void activate ()
 
void deactivate ()
 
bool isActive () const
 
bool isWorking () const
 
IInputReceiverreceiver () const
 
QWidgetsender () const
 
void setReceiver (IInputReceiver *receiver)
 
void setSender (QWidget *interceptedWidget)
 
- 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)
 
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 Member Functions

bool eventFilter (QObject *sender, QEvent *event)
 
- 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)
 

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)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

This class provides methods to application widget events' manipulating and transfering them to the active application's tool.

You can also use instance of this interface to handle user inputs

After activating events from the widget will be sent to the selected tool by InteracionService. There are following events, that will be intercepted from the widget:

All these events (except context menu event) will pass to the widget if dispatcher isActive(), and right after they will be handled by receiver. Also, if your receiver displays a custom context menu, it should let the application know that it handled the context menu event by returning true from the IInputReceiver::contextMenuFired() function. If you don't do this, the standard context menu will be displayed.

Member Function Documentation

void InputDispatcher::activate ( )
virtual

Starts intercept the widget events and passes them to the selected receiver if any.

Events will not be intercepted until sender or receiver is null. Deactivating by default.

Implements IInputDispatcher.

void InputDispatcher::deactivate ( )
virtual

Stops invokes appropriate registered handlers by the widget events intercepting. It is a default state.

Implements IInputDispatcher.

bool InputDispatcher::isActive ( ) const
virtual

Gets the value determinig whether events passed to receiver or not.

Note
IInputDispatcher might be active, but is not working. It is mean, than receiver or sender is null. As soon as they be set, it will start working.

Implements IInputDispatcher.

bool InputDispatcher::isWorking ( ) const
virtual

Gets the value determinig whether events passed to receiver or not.

Returns true if active and widget events are intercepted and passed to the receiver. Returns false if is not active, or widget or receiver is null.

Implements IInputDispatcher.

void InputDispatcher::setSender ( QWidget interceptedWidget)
virtual

Sets the reference to widget events will be intercepted from.

Implements IInputDispatcher.

void InputDispatcher::setReceiver ( IInputReceiver receiver)
virtual

Sets the receiver events form widget will be sended to.

Implements IInputDispatcher.

QWidget* InputDispatcher::sender ( ) const
virtual

Returns widget events will be intercepted from.

Implements IInputDispatcher.

IInputReceiver* InputDispatcher::receiver ( ) const
virtual

Returns the reveived events object.

Implements IInputDispatcher.