Salome HOME
Make ModuleBase_ModelWidget::restoreValue() non-virtual and create virtual ModuleBase...
[modules/shaper.git] / src / PartSet / PartSet_WidgetSketchCreator.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_WidgetSketchCreator.h
4 // Created:     08 June 2015
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef PartSet_WidgetSketchCreator_H
8 #define PartSet_WidgetSketchCreator_H
9
10 #include "PartSet.h"
11
12 #include <ModuleBase_ModelWidget.h>
13
14 class QLabel;
15 class QLineEdit;
16 class PartSet_Module;
17 class ModuleBase_Operation;
18
19 class PARTSET_EXPORT PartSet_WidgetSketchCreator : public ModuleBase_ModelWidget
20 {
21 Q_OBJECT
22  public:
23   /// Constructor
24   /// \param theParent the parent object
25   /// \param theData the widget configuation. The attribute of the model widget is obtained from
26   /// \param theParentId is Id of a parent of the current attribute
27   PartSet_WidgetSketchCreator(QWidget* theParent, PartSet_Module* theModule, 
28     const Config_WidgetAPI* theData, const std::string& theParentId);
29
30   virtual ~PartSet_WidgetSketchCreator();
31
32   /// Returns list of widget controls
33   /// \return a control list
34   virtual QList<QWidget*> getControls() const;
35
36   /// Set focus to the first control of the current widget. The focus policy of the control is checked.
37   /// If the widget has the NonFocus focus policy, it is skipped.
38   /// \return the state whether the widget can accept the focus
39   virtual bool focusTo();
40
41 protected:
42   /// Saves the internal parameters to the given feature
43   /// \return True in success
44   virtual bool storeValueCustom() const;
45
46   virtual bool restoreValueCustom();
47
48   /// The methiod called when widget is activated
49   virtual void activateCustom();
50
51 private slots:
52   void onStarted();
53
54   void onResumed(ModuleBase_Operation* theOp);
55
56 private:
57
58   PartSet_Module* myModule;
59
60   /// Label of the widget
61   QLabel* myLabel;
62
63   /// Input control of the widget
64   QLineEdit* myTextLine;
65
66 };
67
68 #endif