Salome HOME
Issue #2079 : Select parent feature for default Constructions. Disable popup menu...
[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 class QDialogButtonBox;
16
17
18 /**
19  * \ingroup GUI
20  * A dialog box which is used for modal dialog box feature interface
21  */
22 class ModuleBase_Dialog : public QDialog
23 {
24   Q_OBJECT
25 public:
26   /// Constructor
27   /// \param theParent a workshop object instance
28   /// \param theId an Id of a feature
29   /// \param theDescription an XML description of the feature
30   ModuleBase_Dialog(ModuleBase_IWorkshop* theParent, const QString& theId,
31                     const std::string& theDescription);
32
33   /// Redefinition of virtual method
34   virtual void accept();
35
36 protected:
37   /// Redefinition of virtual method
38   virtual void showEvent(QShowEvent* theEvent);
39
40 private:
41   /// Initialising of the widget
42   void initializeWidget(ModuleBase_ModelWidget* theWidget);
43
44   /// Id of the feature
45   QString myId;
46
47   /// XML description of the feature
48   std::string myDescription;
49
50   /// An instance of workshop object
51   ModuleBase_IWorkshop* myWorkshop;
52
53   /// The feature instance
54   FeaturePtr myFeature;
55
56   /// List of created widgets
57   QList<ModuleBase_ModelWidget*> myWidgets;
58
59   /// Pointer on active widget
60   ModuleBase_ModelWidget* myActiveWidget;
61
62   /// Buttons of the dialog
63   QDialogButtonBox* myButtonsBox;
64 };
65
66 #endif