Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
[modules/shaper.git] / src / ModuleBase / ModuleBase_MetaWidget.h
1 /*
2  *
3  */
4
5 #ifndef MODULEBASE_METAWIDGET_H_
6 #define MODULEBASE_METAWIDGET_H_
7
8 #include <ModuleBase.h>
9 #include <ModuleBase_ModelWidget.h>
10
11 #include <ModelAPI_Feature.h>
12
13 #include <QWidget>
14
15 #include <boost/shared_ptr.hpp>
16
17 /*
18  *
19  */
20 class ModuleBase_MetaWidget : public ModuleBase_ModelWidget
21 {
22 public:
23   MODULEBASE_EXPORT ModuleBase_MetaWidget(QWidget* theWrapped);
24   virtual ~ModuleBase_MetaWidget();
25   //! Interface for saving widget's data into the data model
26   MODULEBASE_EXPORT virtual bool storeValue(FeaturePtr theFeature);
27   //! Interface for loading widget's data from the data model
28   MODULEBASE_EXPORT virtual bool restoreValue(FeaturePtr theFeature);
29
30   /// Set focus to the current widget if it corresponds to the given attribute
31   /// \param theAttribute name
32   MODULEBASE_EXPORT virtual bool focusTo(const std::string& theAttributeName);
33
34   /// Returns list of widget controls
35   /// \return a control list
36   virtual QList<QWidget*> getControls() const;
37
38 private:
39   QWidget* myWrappedWidget;
40 };
41
42 #endif /* MODULEBASE_METAWIDGET_H_ */