Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetChoice.h
1 // File:        ModuleBase_WidgetChoice.h
2 // Created:     03 Sept 2014
3 // Author:      Vitaly Smetannikov
4
5 #ifndef ModuleBase_WidgetChoice_H
6 #define ModuleBase_WidgetChoice_H
7
8 #include "ModuleBase.h"
9 #include "ModuleBase_ModelWidget.h"
10
11 class QWidget;
12 class QLabel;
13 class QComboBox;
14
15 class MODULEBASE_EXPORT ModuleBase_WidgetChoice : public ModuleBase_ModelWidget
16 {
17 Q_OBJECT
18  public:
19   ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData, 
20                           const std::string& theParentId);
21
22   virtual ~ModuleBase_WidgetChoice();
23   
24   /// Saves the internal parameters to the given feature
25   /// \param theObject a model feature to be changed
26   virtual bool storeValue() const;
27
28   virtual bool restoreValue();
29
30   virtual bool focusTo();
31
32   /// Returns the internal parent wiget control, that can be shown anywhere
33   /// \returns the widget
34   QWidget* getControl() const
35   {
36     return myContainer;
37   }
38
39   /// Returns list of widget controls
40   /// \return a control list
41   virtual QList<QWidget*> getControls() const;
42
43 private slots:
44   void onCurrentIndexChanged(int theIndex);
45
46 private:
47   QWidget* myContainer;
48   QLabel* myLabel;
49   QComboBox* myCombo;
50 };
51
52 #endif