Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / XGUI / XGUI_Workbench.h
1 #ifndef XGUI_Workbench_H
2 #define XGUI_Workbench_H
3
4 #include <QWidget>
5 #include <QScrollArea>
6 #include <QList>
7
8 class XGUI_Command;
9 class XGUI_MenuGroupPanel;
10 class CommandsArea;
11
12 class QHBoxLayout;
13 class QPushButton;
14
15 class XGUI_Workbench: public QWidget
16 {
17 Q_OBJECT
18 public:
19   XGUI_Workbench(QWidget* theParent);
20
21   XGUI_MenuGroupPanel* addGroup(const QString& theId);
22   XGUI_MenuGroupPanel* findGroup(const QString& theName);
23
24   //! Returns already created command by its ID
25   XGUI_Command* feature(const QString& theId) const;
26
27   //! Returns list of created commands
28   QList<XGUI_Command*> features() const;
29
30 private slots:
31   void onLeftScroll();
32   void onRightScroll();
33
34 protected:
35   virtual void resizeEvent(QResizeEvent * theEvent);
36   virtual bool eventFilter(QObject *theObj, QEvent *theEvent);
37
38
39 private:
40   void addSeparator();
41   bool isExceedsLeft();
42   bool isExceedsRight();
43
44   QWidget* myChildWidget;
45   QHBoxLayout* myLayout;
46   QList<XGUI_MenuGroupPanel*> myGroups;
47
48   CommandsArea* myCommandsArea;
49   QPushButton* myRightButton;
50   QPushButton* myLeftButton;
51 };
52
53 #endif