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