Salome HOME
Adding Naming DS for Placement operation.
[modules/shaper.git] / src / ModuleBase / ModuleBase_IPropertyPanel.h
1 /*
2  * ModuleBase_IPropertyPanel.h
3  *
4  *  Created on: Oct 01, 2014
5  *      Author: vsv
6  */
7
8 #ifndef ModuleBase_PROPERTYPANEL_H_
9 #define ModuleBase_PROPERTYPANEL_H_
10
11 #include "ModuleBase.h"
12
13 #include <QDockWidget>
14 #include <QKeyEvent>
15
16 class ModuleBase_ModelWidget;
17
18 class MODULEBASE_EXPORT ModuleBase_IPropertyPanel : public QDockWidget
19 {
20 Q_OBJECT
21 public:
22   ModuleBase_IPropertyPanel(QWidget* theParent) : QDockWidget(theParent), myIsEditing(false) {}
23
24   /// Returns currently active widget
25   virtual ModuleBase_ModelWidget* activeWidget() const = 0;
26
27   /// Returns all property panel's widget created by WidgetFactory
28   virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const = 0;
29
30   /// Editing mode depends on mode of current operation. This value is defined by it.
31   void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
32   bool isEditingMode() const { return myIsEditing; }
33
34 signals:
35   /// The signal about key release on the control, that corresponds to the attribute
36   /// \param theEvent key release event
37   void keyReleased(QKeyEvent* theEvent);
38
39   /// The signal about the widget activation
40   /// \param theWidget the activated widget
41   void widgetActivated(ModuleBase_ModelWidget* theWidget);
42
43   /// Emited when there is no next widget
44   void noMoreWidgets();
45
46 public slots:
47   /// Activate the next widget in the property panel
48   /// \param theWidget a widget. The next widget should be activated
49   virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget) = 0;
50
51   /// Activate the next from current widget in the property panel
52   virtual void activateNextWidget() = 0;
53
54   // Makes the given widget active, highlights it and removes
55   // highlighting from the previous active widget
56   // emits widgetActivated(theWidget) signal
57   virtual void activateWidget(ModuleBase_ModelWidget* theWidget) = 0;
58
59 protected:
60   bool myIsEditing;
61 };
62
63 #endif