Salome HOME
Update classes documentation
[modules/shaper.git] / src / ModuleBase / ModuleBase_Dialog.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #ifndef ModuleBase_Dialog_H
4 #define ModuleBase_Dialog_H
5
6 #include "ModuleBase.h"
7 #include <ModelAPI_Feature.h>
8
9 #include <QDialog>
10 #include <string>
11
12
13 class ModuleBase_IWorkshop;
14 class ModuleBase_ModelWidget;
15
16 /**
17  * \ingroup GUI
18  * A dialog box which is used for modal dialog box feature interface
19  */
20 class ModuleBase_Dialog : public QDialog
21 {
22   Q_OBJECT
23 public:
24   /// Constructor
25   /// \param theParent a workshop object instance
26   /// \param theId an Id of a feature
27   /// \param theDescription an XML description of the feature
28   ModuleBase_Dialog(ModuleBase_IWorkshop* theParent, const QString& theId, 
29                     const std::string& theDescription);
30
31   /// Redefinition of virtual method
32   virtual void accept();
33
34 protected:
35   /// Redefinition of virtual method
36   virtual void showEvent(QShowEvent* theEvent);
37
38
39 private:
40   /// Initialising of the widget
41   void initializeWidget(ModuleBase_ModelWidget* theWidget);
42
43   /// Id of the feature
44   QString myId;
45
46   /// XML description of the feature
47   std::string myDescription;
48
49   /// An instance of workshop object
50   ModuleBase_IWorkshop* myWorkshop;
51
52   /// The feature instance
53   FeaturePtr myFeature;
54
55   /// List of created widgets
56   QList<ModuleBase_ModelWidget*> myWidgets;
57
58   /// Pointer on active widget
59   ModuleBase_ModelWidget* myActiveWidget;
60 };
61
62 #endif