Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / XGUI / XGUI_SwitchWidget.h
1 /*
2  * XGUI_SwitchWidget.h
3  *
4  *  Created on: Apr 16, 2014
5  *      Author: sbh
6  */
7
8 #ifndef XGUI_SWITCHWIDGET_H_
9 #define XGUI_SWITCHWIDGET_H_
10
11 #include <XGUI.h>
12 #include <QFrame>
13
14 class QComboBox;
15 class QVBoxLayout;
16
17 class XGUI_EXPORT XGUI_SwitchWidget: public QFrame
18 {
19   Q_OBJECT
20 public:
21   XGUI_SwitchWidget(QWidget* parent = NULL);
22   virtual ~XGUI_SwitchWidget();
23
24   int addPage(QWidget * theWidget, const QString & theName);
25   int count() const;
26   int currentIndex() const;
27   QWidget * currentWidget() const;
28   int indexOf(QWidget * theWidget) const;
29   int insertPage(int index, QWidget * theWidget, const QString & theName);
30   bool isPageEnabled(int index) const;
31   QString pageText(int index) const;
32   QString pageToolTip(int index) const;
33   void removePage(int index);
34   void setPageEnabled(int index, bool enabled);
35   void setPageName(int index, const QString & text);
36   void setPageToolTip(int index, const QString & toolTip);
37
38 public slots:
39   void setCurrentIndex(int index);
40
41 signals:
42   void currentPageChanged(int);
43
44 protected:
45   void refresh();
46
47 private:
48   QVBoxLayout* myMainLay;
49   QComboBox* myCombo;
50   QWidgetList myCases;
51 };
52
53 #endif /* XGUI_SWITCHWIDGET_H_ */