Salome HOME
Temporary comment (somehow inform the user about the scale of the view: line lenght...
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetCheckGroupBox.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        ModuleBase_WidgetCheckGroupBox.h
4 // Created:     13 Dec 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef ModuleBase_WidgetCheckGroupBox_H_
8 #define ModuleBase_WidgetCheckGroupBox_H_
9
10 #include <ModuleBase.h>
11 #include <ModuleBase_PageBase.h>
12 #include <ModuleBase_ModelWidget.h>
13
14 class QGroupBox;
15 class QGridLayout;
16
17 /**
18 * \ingroup GUI
19 * Implements a model widget for switch as a container widget. It can be defined in XML with "toolbox" keyword
20 */
21 class MODULEBASE_EXPORT ModuleBase_WidgetCheckGroupBox : public ModuleBase_ModelWidget,
22                                                          public ModuleBase_PageBase
23 {
24   Q_OBJECT
25 public:
26   /// Constructor
27   /// \param theParent the parent object
28   /// \param theData the widget configuration. The attribute of the model widget is obtained from
29   ModuleBase_WidgetCheckGroupBox(QWidget* theParent, const Config_WidgetAPI* theData);
30   virtual ~ModuleBase_WidgetCheckGroupBox();
31
32   /// Defines if it is supported to set the value in this widget
33   /// \return false because this is an info widget
34   virtual bool canAcceptFocus() const { return false; };
35
36   /// Set the title of the group box
37   /// \param theTitle the text of the title
38   void setTitle(const QString& theTitle);
39
40   /// Methods to be redefined from ModuleBase_PageBase: start
41   /// Cast the page to regular QWidget
42   virtual QWidget* pageWidget();
43   /// Methods to be redefined from ModuleBase_PageBase: end
44
45   /// Methods to be redefined from ModuleBase_ModelWidget: start
46   /// Returns list of widget controls
47   /// \return a control list
48   virtual QList<QWidget*> getControls() const;
49   /// Methods to be redefined from ModuleBase_ModelWidget: end
50
51 protected slots:
52   // store value to the model
53   void onPageClicked();
54
55 protected:
56   /// Methods to be redefined from ModuleBase_PageBase: start
57   /// Adds the given widget to page's layout
58   virtual void placeModelWidget(ModuleBase_ModelWidget* theWidget);
59   /// Adds the given page to page's layout
60   virtual void placeWidget(QWidget* theWidget);
61   /// Returns page's layout (QGridLayout)
62   virtual QLayout* pageLayout();
63   /// Adds a stretch to page's layout
64   virtual void addPageStretch();
65   /// Methods to be redefined from ModuleBase_PageBase: end
66
67
68   /// Methods to be redefined from ModuleBase_ModelWidget: start
69   /// Saves the internal parameters to the given feature
70   /// \return True in success
71   virtual bool storeValueCustom();
72   /// Restore value from attribute data to the widget's control
73   virtual bool restoreValueCustom();
74   /// Methods to be redefined from ModuleBase_ModelWidget: end
75
76 private:
77   QGroupBox* myGroupBox;
78   QGridLayout* myMainLayout; ///< page's layout
79 };
80
81 #endif /* ModuleBase_WidgetCheckGroupBox_H_ */