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

Inherit this abstract class to create a operations provides user to interact with application. More...

#include <Operation.h>

Inherits QAction, and IOperation.

Inherited by InstallComponentsOperation, RedoOperation, ShowComponentsOperation, ShowScriptsOperation, ToggleActionWrapper, ToogleDialogOperation, ToolBase, and UndoOperation.

Signals

void executingStopped ()
 

Public Member Functions

 Operation (QActionGroup *actionGroup=nullptr)
 
 Operation (const QString &text, QActionGroup *actionGroup=nullptr)
 
 Operation (const QIcon &icon, const QString &text, QActionGroup *actionGroup=nullptr)
 
QString category () const
 
void initialize (IServiceLocator *serviceLocator)
 
QString name () const
 
void stopExecuting ()
 
- Public Member Functions inherited from QAction
 QAction (QObject *parent)
 
 QAction (const QString &text, QObject *parent)
 
 QAction (QObject *parent, const char *name)
 
 QAction (const QString &text, const QKeySequence &shortcut, QObject *parent, const char *name)
 
 QAction (const QIcon &icon, const QString &text, QObject *parent)
 
 QAction (const QIcon &icon, const QString &text, const QKeySequence &shortcut, QObject *parent, const char *name)
 
QKeySequence accel () const
 
QActionGroupactionGroup () const
 
void activate (ActionEvent event)
 
void activated (int i)
 
bool addTo (QWidget *w)
 
QList< QGraphicsWidget * > associatedGraphicsWidgets () const
 
QList< QWidget * > associatedWidgets () const
 
bool autoRepeat () const
 
void changed ()
 
QVariant data () const
 
QFont font () const
 
void hover ()
 
void hovered ()
 
QIcon icon () const
 
QIcon iconSet () const
 
QString iconText () const
 
bool isCheckable () const
 
bool isChecked () const
 
bool isEnabled () const
 
bool isIconVisibleInMenu () const
 
bool isOn () const
 
bool isSeparator () const
 
bool isToggleAction () const
 
bool isVisible () const
 
QMenumenu () const
 
MenuRole menuRole () const
 
QString menuText () const
 
QWidgetparentWidget () const
 
Priority priority () const
 
bool removeFrom (QWidget *w)
 
void setAccel (const QKeySequence &shortcut)
 
void setActionGroup (QActionGroup *group)
 
void setAutoRepeat (bool)
 
void setCheckable (bool)
 
void setChecked (bool)
 
void setData (const QVariant &userData)
 
void setDisabled (bool b)
 
void setEnabled (bool)
 
void setFont (const QFont &font)
 
void setIcon (const QIcon &icon)
 
void setIconSet (const QIcon &i)
 
void setIconText (const QString &text)
 
void setIconVisibleInMenu (bool visible)
 
void setMenu (QMenu *menu)
 
void setMenuRole (MenuRole menuRole)
 
void setMenuText (const QString &text)
 
void setOn (bool b)
 
void setPriority (Priority priority)
 
void setSeparator (bool b)
 
void setShortcut (const QKeySequence &shortcut)
 
void setShortcutContext (Qt::ShortcutContext context)
 
void setShortcuts (QKeySequence::StandardKey key)
 
void setShortcuts (const QList< QKeySequence > &shortcuts)
 
void setSoftKeyRole (SoftKeyRole softKeyRole)
 
void setStatusTip (const QString &statusTip)
 
void setText (const QString &text)
 
void setToggleAction (bool b)
 
void setToolTip (const QString &tip)
 
void setVisible (bool)
 
void setWhatsThis (const QString &what)
 
QKeySequence shortcut () const
 
Qt::ShortcutContext shortcutContext () const
 
QList< QKeySequenceshortcuts () const
 
bool showStatusText (QWidget *widget)
 
SoftKeyRole softKeyRole () const
 
QString statusTip () const
 
QString text () const
 
void toggle ()
 
void toggled (bool checked)
 
QString toolTip () const
 
void trigger ()
 
void triggered (bool checked)
 
QString whatsThis () const
 
- 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 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
 
- Public Member Functions inherited from IOperation
virtual void execute ()=0
 
virtual void executingStopped ()=0
 

Protected Member Functions

void connectToSignals ()
 
void disconectFromSignals ()
 
void setCategory (const QString &category)
 
void setName (const QString &name)
 
- Protected Member Functions inherited from QAction
virtual bool event (QEvent *e)
 
- 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 QAction
 autoRepeat
 
 checkable
 
 checked
 
 enabled
 
 font
 
 icon
 
 iconText
 
 iconVisibleInMenu
 
 menuRole
 
 priority
 
 shortcut
 
 shortcutContext
 
 softKeyRole
 
 statusTip
 
 text
 
 toolTip
 
 visible
 
 whatsThis
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Inherit this abstract class to create a operations provides user to interact with application.

One of the way of user interaction with Carousel based applications are the operations, which call application essentials. You can create the following types of operations:

When you are creating a new operation, you must derived from the this class in your class code. This class determines the behavior and properties of simple operations such as buttons and menu items. For example, it declares operation properties such as name, category, icon, desctiptive text that used in QAction subclass - Operation and in the Customization dialog. It also defines what action happens when the operation is clicked.

You should implement at least execute() method in the derived class.

Constructor & Destructor Documentation

Operation::Operation ( QActionGroup actionGroup = nullptr)

Initializes a new instance of the Operation class with action group, if any. If the action group not null, this operation will be automatically inserted into the group.

Operation::Operation ( const QString text,
QActionGroup actionGroup = nullptr 
)

Initializes a new instance of the Operation class with action group, if any. If the action group not null, this operation will be automatically inserted into the group.

The Operation uses a stripped version of text (e.g. "&Menu Option..." becomes "Menu Option") as descriptive text for tool buttons. You can override this by setting a specific description with setText(). The same text will be used for tooltips unless you specify a different text using setToolTip().

Operation::Operation ( const QIcon icon,
const QString text,
QActionGroup actionGroup = nullptr 
)

Initializes a new instance of the Operation class with action group, if any. If the action group not null, this operation will be automatically inserted into the group.

The Operation uses a stripped version of text (e.g. "&Menu Option..." becomes "Menu Option") as descriptive text for tool buttons. You can override this by setting a specific description with setText(). The same text will be used for tooltips unless you specify a different text using setToolTip().

Member Function Documentation

QString Operation::category ( ) const
virtual

The name of the category with which this operation is associated. It determines where the operation will appear in the Operations panel of the Customize dialog.

Implements IOperation.

void Operation::stopExecuting ( )
virtual

If operation is checkable, this method called after user switch off this operation.

It is also emmits executingStopped() signal.

Implements IOperation.

Reimplemented in ToolBase, and ToggleActionWrapper.

void Operation::initialize ( IServiceLocator serviceLocator)
virtual

Called by carousel interactivity system to gives the operation a hook into the application. When subclassing Operation, use the initialize() method to get a hook to the application. When the final, complete boot loading takes place, the initialize() method gets called for every registered operation.

Does nothing by default.

Implements IOperation.

Reimplemented in ToolBase, RedoOperation, and UndoOperation.

QString Operation::name ( ) const
virtual

This property of a operation is a programmatic identifying name string. By convention, a operation's name should include its category name. The format of the name string should be <category>.<text>. Since it is an identifier of the operation, this property should not be localized. This property used to store user's customization.

Note
the text() property of a operation is the string that appears when the operation is placed on a operation bar.

Implements IOperation.

void Operation::executingStopped ( )
signal

This signal is emited when operation is deactivated.

void Operation::setCategory ( const QString category)
protected

Sets the name of the category with which this operation is associated. It determines where the operation will appear in the Operations panel of the Customize dialog.

void Operation::setName ( const QString name)
protected

Sets the programmatic identifying name string. By convention, a operation's name should include its category name. The format of the name string should be <category>.<text>. Since it is an identifier of the operation, this property should not be localized. This property used to store user's customization.

Note
the text() property of a operation is the string that appears when the operation is placed on a operation bar.
void Operation::connectToSignals ( )
protected

To provide convinient execute() and stopExecuting() methods Operation class subscribes to the base QAction class' signals QAction::toggled() and QAction::triggered(). It is already done in the constructor, but it may required to connect explicitly, e.g. after disconnecting.

See Also
disconectFromSignals
void Operation::disconectFromSignals ( )
protected

To provide convinient execute() and stopExecuting() methods Operation class subscribes to the base QAction class' signals QAction::toggled() and QAction::triggered(). But for some cases may required to change, for example, checked() property silencely, without invoking execute() or stopExecuting(). To do it you should call disconectFromSignals() first and then connectToSignals againg.

See Also
connectToSignals