Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom.git into Dev_0.6.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 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   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 widgetActivated(ModuleBase_ModelWidget* theWidget);
56
57   /// Emited when there is no next widget
58   void noMoreWidgets();
59
60 public slots:
61   /// Activate the next widget in the property panel
62   /// \param theWidget a widget. The next widget should be activated
63   virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget) = 0;
64
65   /// Activate the next from current widget in the property panel
66   virtual void activateNextWidget() = 0;
67
68   // Makes the given widget active, highlights it and removes
69   // highlighting from the previous active widget
70   // emits widgetActivated(theWidget) signal
71   virtual void activateWidget(ModuleBase_ModelWidget* theWidget) = 0;
72
73 protected:
74   bool myIsEditing;
75 };
76
77 #endif