]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_IPropertyPanel.h
Salome HOME
1419a715e6c8ef4418ee948b0a87695939fe0230
[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 class MODULEBASE_EXPORT ModuleBase_IPropertyPanel : public QDockWidget
21 {
22 Q_OBJECT
23 public:
24   ModuleBase_IPropertyPanel(QWidget* theParent) : QDockWidget(theParent), myIsEditing(false) {}
25
26   /// Returns currently active widget
27   virtual ModuleBase_ModelWidget* activeWidget() const = 0;
28
29   /// Returns all property panel's widget created by WidgetFactory
30   virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const = 0;
31
32   /// Editing mode depends on mode of current operation. This value is defined by it.
33   virtual void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
34   bool isEditingMode() const { return myIsEditing; }
35
36   /// Set Enable/Disable state of Ok button
37   virtual void setOkEnabled(bool theEnabled) = 0;
38
39   /// Returns state of Ok button
40   virtual bool isOkEnabled() const = 0;
41
42   /// Set Enable/Disable state of Ok button
43   virtual void setCancelEnabled(bool theEnabled) = 0;
44
45   /// Returns state of Ok button
46   virtual bool isCancelEnabled() const = 0;
47
48 signals:
49   /// The signal about key release on the control, that corresponds to the attribute
50   /// \param theEvent key release event
51   void keyReleased(QKeyEvent* theEvent);
52
53   /// The signal about the widget activation
54   /// \param theWidget the activated widget
55   void beforeWidgetActivated(ModuleBase_ModelWidget* theWidget);
56
57   /// The signal about the widget activation
58   /// \param theWidget the activated widget
59   void widgetActivated(ModuleBase_ModelWidget* theWidget);
60
61   /// Emited when there is no next widget
62   void noMoreWidgets();
63
64 public slots:
65   /// Activate the next widget in the property panel
66   /// \param theWidget a widget. The next widget should be activated
67   virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget) = 0;
68
69   /// Activate the next from current widget in the property panel
70   virtual void activateNextWidget() = 0;
71
72   // Makes the given widget active, highlights it and removes
73   // highlighting from the previous active widget
74   // emits widgetActivated(theWidget) signal
75   virtual void activateWidget(ModuleBase_ModelWidget* theWidget) = 0;
76
77 protected:
78   bool myIsEditing;
79 };
80
81 #endif