]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_IPropertyPanel.h
Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom into Dev_0.7.1
[modules/shaper.git] / src / ModuleBase / ModuleBase_IPropertyPanel.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * ModuleBase_IPropertyPanel.h
5  *
6  *  Created on: Oct 01, 2014
7  *      Author: vsv
8  */
9
10 #ifndef ModuleBase_PROPERTYPANEL_H_
11 #define ModuleBase_PROPERTYPANEL_H_
12
13 #include "ModuleBase.h"
14
15 #include <QDockWidget>
16 #include <QKeyEvent>
17
18 class ModuleBase_ModelWidget;
19
20 /**
21 * A class for Property panel object definition
22 */
23 class MODULEBASE_EXPORT ModuleBase_IPropertyPanel : public QDockWidget
24 {
25 Q_OBJECT
26 public:
27   /// Constructor
28   /// \param theParent is a parent of the property panel
29   ModuleBase_IPropertyPanel(QWidget* theParent) : QDockWidget(theParent), myIsEditing(false) {}
30
31   /// Returns currently active widget
32   virtual ModuleBase_ModelWidget* activeWidget() const = 0;
33
34   /// Returns all property panel's widget created by WidgetFactory
35   virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const = 0;
36
37   /// Editing mode depends on mode of current operation. This value is defined by it.
38   /// \param isEditing state of editing mode flag
39   virtual void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
40
41   /// \return State of editing mode flag
42   bool isEditingMode() const { return myIsEditing; }
43
44   /// Set Enable/Disable state of Ok button
45   /// \param theEnabled Enable/Disable state of Ok button
46   virtual void setOkEnabled(bool theEnabled) = 0;
47
48   /// \return Enable/disable state of Ok button
49   virtual bool isOkEnabled() const = 0;
50
51   /// Set Enable/Disable state of Cancel button
52   /// \param theEnabled Enable/Disable state of Cancel button
53   virtual void setCancelEnabled(bool theEnabled) = 0;
54
55   /// \return Enable/Disable state of Cancel button
56   virtual bool isCancelEnabled() const = 0;
57
58 signals:
59   /// The signal about key release on the control, that corresponds to the attribute
60   /// \param theEvent key release event
61   void keyReleased(QKeyEvent* theEvent);
62
63   /// The signal about the widget activation
64   /// \param theWidget the activated widget
65   void beforeWidgetActivated(ModuleBase_ModelWidget* theWidget);
66
67   /// The signal about the widget activation
68   /// \param theWidget the activated widget
69   void widgetActivated(ModuleBase_ModelWidget* theWidget);
70
71   /// Emited when there is no next widget
72   void noMoreWidgets();
73
74 public slots:
75   /// Activate the next widget in the property panel
76   /// \param theWidget a widget. The next widget should be activated
77   virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget) = 0;
78
79   /// Activate the next from current widget in the property panel
80   virtual void activateNextWidget() = 0;
81
82   /**
83   * Makes the given widget active, highlights it and removes
84   * highlighting from the previous active widget
85   * emits widgetActivated(theWidget) signal
86   * \param theWidget which has to be activated
87   */
88   virtual void activateWidget(ModuleBase_ModelWidget* theWidget) = 0;
89
90 protected:
91
92   /// Flag which shows that current operation is in editing mode
93   bool myIsEditing;
94 };
95
96 #endif