Salome HOME
Issue #218 Disable stratch is expandable object is in the panel
[modules/shaper.git] / src / XGUI / XGUI_Command.h
index b1227ba2e88335a0636ee9c3416141477ddf516d..0f5aa627159862b360ea38b44e0ec56c38600fa7 100644 (file)
@@ -1,47 +1,44 @@
 #ifndef XGUI_Command_H
 #define XGUI_Command_H
 
+#include "XGUI.h"
 #include <QWidgetAction>
 
-#define MIN_BUTTON_HEIGHT 18
-#define MIN_BUTTON_WIDTH 40
+#define MIN_BUTTON_HEIGHT 25
+#define MIN_BUTTON_WIDTH 60
 
 /**\class XGUI_Command
  * \ingroup GUI
  * \brief Represents a command item in the application menu (Workbench)
  */
-class XGUI_Command: public QWidgetAction
+class XGUI_EXPORT XGUI_Command : public QWidgetAction
 {
 Q_OBJECT
-public:
-  XGUI_Command(const QString& theId, QObject * parent);
-  XGUI_Command(const QString& theId, const QIcon& icon, const QString& text, QObject* parent);
+ public:
+  XGUI_Command(const QString& theId, const QString& theDocumentKind,
+               QObject * parent, bool isCheckable = false);
+  XGUI_Command(const QString& theId, const QString& theDocumentKind,
+               const QIcon& icon, const QString& text, QObject* parent,
+               bool isCheckable = false);
   ~XGUI_Command();
 
-  //! Returns true if the command is enabled
-  virtual bool enabled() const;
-
-  //! Set the command enabled
-  virtual void enable();
-
-  //! Set the command disabled
-  virtual void disable();
-
-  //! Returns Id of the command
-  virtual QString id() const
-  {
-    return myId;
-  }
+  const QString& documentKind() const;
+  const QStringList& nestedCommands() const;
+  void setNestedCommands(const QStringList& myUnblockableCommands);
 
   //! Connect the command to a slot
   virtual void connectTo(const QObject* theResiver, const char* theSlot);
 
-protected:
+ protected:
   //! Creates a command representation widget dependently on parent widget type
   virtual QWidget* createWidget(QWidget* theParent);
 
-private:
-  QString myId;
+ private:
+  bool myCheckable;
+
+  QString myDocumentKind;
+  //! List of Ids of commands which WILL NOT be blocked when the command is on.
+  QStringList myNestedCommands;
 };
 
 #endif