Salome HOME
Document's kind dependent features implemented
[modules/shaper.git] / src / XGUI / XGUI_Command.h
1 #ifndef XGUI_Command_H
2 #define XGUI_Command_H
3
4 #include "XGUI.h"
5 #include <QWidgetAction>
6
7 #define MIN_BUTTON_HEIGHT 25
8 #define MIN_BUTTON_WIDTH 60
9
10 /**\class XGUI_Command
11  * \ingroup GUI
12  * \brief Represents a command item in the application menu (Workbench)
13  */
14 class XGUI_EXPORT XGUI_Command : public QWidgetAction
15 {
16 Q_OBJECT
17  public:
18   XGUI_Command(const QString& theId, const QString& theDocumentKind,
19                QObject * parent, bool isCheckable = false);
20   XGUI_Command(const QString& theId, const QString& theDocumentKind,
21                const QIcon& icon, const QString& text, QObject* parent,
22                bool isCheckable = false);
23   ~XGUI_Command();
24
25   const QString& documentKind() const;
26   const QStringList& nestedCommands() const;
27   void setNestedCommands(const QStringList& myUnblockableCommands);
28
29   //! Connect the command to a slot
30   virtual void connectTo(const QObject* theResiver, const char* theSlot);
31
32  protected:
33   //! Creates a command representation widget dependently on parent widget type
34   virtual QWidget* createWidget(QWidget* theParent);
35
36  private:
37   bool myCheckable;
38
39   QString myDocumentKind;
40   //! List of Ids of commands which WILL NOT be blocked when the command is on.
41   QStringList myNestedCommands;
42 };
43
44 #endif