Salome HOME
Hide faces: checking presentation on having any shapes using a whole container of...
[modules/shaper.git] / src / ModuleBase / ModuleBase_Dialog.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef ModuleBase_Dialog_H
22 #define ModuleBase_Dialog_H
23
24 #include "ModuleBase.h"
25 #include <ModelAPI_Feature.h>
26
27 #include <QDialog>
28 #include <string>
29
30
31 class ModuleBase_IWorkshop;
32 class ModuleBase_ModelWidget;
33 class QDialogButtonBox;
34
35
36 /**
37  * \ingroup GUI
38  * A dialog box which is used for modal dialog box feature interface
39  */
40 class ModuleBase_Dialog : public QDialog
41 {
42   Q_OBJECT
43 public:
44   /// Constructor
45   /// \param theParent a workshop object instance
46   /// \param theId an Id of a feature
47   /// \param theDescription an XML description of the feature
48   ModuleBase_Dialog(ModuleBase_IWorkshop* theParent, const QString& theId,
49                     const std::string& theDescription);
50
51   /// Redefinition of virtual method
52   virtual void accept();
53
54 protected:
55   /// Redefinition of virtual method
56   virtual void showEvent(QShowEvent* theEvent);
57
58 private:
59   /// Initialising of the widget
60   void initializeWidget(ModuleBase_ModelWidget* theWidget);
61
62   /// Id of the feature
63   QString myId;
64
65   /// XML description of the feature
66   std::string myDescription;
67
68   /// An instance of workshop object
69   ModuleBase_IWorkshop* myWorkshop;
70
71   /// The feature instance
72   FeaturePtr myFeature;
73
74   /// List of created widgets
75   QList<ModuleBase_ModelWidget*> myWidgets;
76
77   /// Pointer on active widget
78   ModuleBase_ModelWidget* myActiveWidget;
79
80   /// Buttons of the dialog
81   QDialogButtonBox* myButtonsBox;
82 };
83
84 #endif