Salome HOME
a684515a39e8d46b67cb742a520e7e80892cbe71
[modules/shaper.git] / src / ModuleBase / ModuleBase_ModelWidget.h
1 // File:        ModuleBase_ModelWidget.h
2 // Created:     25 Apr 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef ModuleBase_ModelWidget_H
6 #define ModuleBase_ModelWidget_H
7
8 #include <ModuleBase.h>
9
10 #include <QObject>
11
12 #include <boost/shared_ptr.hpp>
13
14 class ModelAPI_Feature;
15
16 /**\class ModuleBase_ModelWidget
17  * \brief An abstract custom widget class. This class realization is assumed to create some controls.
18  * The controls values modification should send signal about values change.
19  *
20  * Common interface for widgets in the property panel.
21  * Every widget are able to save/restore data from the model and/or to contain other widgets.
22  *
23  */
24 class MODULEBASE_EXPORT ModuleBase_ModelWidget : public QObject
25 {
26   Q_OBJECT
27 public:
28   /// Constructor
29   /// \theParent the parent object
30   ModuleBase_ModelWidget(QObject* theParent) :QObject(theParent) {};
31   /// Destructor
32   virtual ~ModuleBase_ModelWidget() {};
33
34   /// Saves the internal parameters to the given feature
35   /// \param theFeature a model feature to be changed
36   virtual bool storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
37
38   virtual bool restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
39
40
41 signals:
42   /// The signal about widget values changed
43   void valuesChanged();
44 };
45
46 #endif