]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_WidgetEditor.h
Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetEditor.h
1 // File:        ModuleBase_WidgetEditor.h
2 // Created:     25 Apr 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef ModuleBase_WidgetEditor_H
6 #define ModuleBase_WidgetEditor_H
7
8 #include <ModuleBase.h>
9 #include "ModuleBase_WidgetDoubleValue.h"
10
11 #include <QObject>
12 #include <QStringList>
13
14 class ModelAPI_Feature;
15 class QLineEdit;
16
17 /**\class ModuleBase_WidgetEditor
18  * \ingroup GUI
19  * \brief Custom widget. An abstract class to be redefined to fill with some GUI controls
20  */
21 class MODULEBASE_EXPORT ModuleBase_WidgetEditor : public ModuleBase_WidgetDoubleValue
22 {
23   Q_OBJECT
24 public:
25   /// Constructor
26   /// \theParent the parent object
27   /// \theParent the parent object
28   /// \theData the widget configuation. The attribute of the model widget is obtained from
29   ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData);
30   /// Constructor
31   /// \theParent the parent object
32   /// \theParent the parent object
33   /// \theData the widget configuation. The attribute of the model widget is obtained from
34   ModuleBase_WidgetEditor(QWidget* theParent, const std::string& theAttribute);
35
36   /// Destructor
37   virtual ~ModuleBase_WidgetEditor();
38
39   /// Set focus to the first control of the current widget. The focus policy of the control is checked.
40   /// If the widget has the NonFocus focus policy, it is skipped.
41   virtual void focusTo();
42
43   /// Creates an editor for the real value and set the new value to the feature
44   /// \param theFeature the model feature
45   /// \param theAttribute the feature attribute
46   static void editFeatureValue(FeaturePtr theFeature, const std::string theAttribute);
47
48 private:
49   FeaturePtr myFeature; ///< the current widget feature
50   QStringList myFeatureKinds; ///< the kinds of possible features
51 };
52
53 #endif