Salome HOME
Issue #273: Add copyright string
[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 signals:
37   /// The signal about key release on the control, that corresponds to the attribute
38   /// \param theEvent key release event
39   void keyReleased(QKeyEvent* theEvent);
40
41   /// The signal about the widget activation
42   /// \param theWidget the activated widget
43   void widgetActivated(ModuleBase_ModelWidget* theWidget);
44
45   /// Emited when there is no next widget
46   void noMoreWidgets();
47
48 public slots:
49   /// Activate the next widget in the property panel
50   /// \param theWidget a widget. The next widget should be activated
51   virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget) = 0;
52
53   /// Activate the next from current widget in the property panel
54   virtual void activateNextWidget() = 0;
55
56   // Makes the given widget active, highlights it and removes
57   // highlighting from the previous active widget
58   // emits widgetActivated(theWidget) signal
59   virtual void activateWidget(ModuleBase_ModelWidget* theWidget) = 0;
60
61 protected:
62   bool myIsEditing;
63 };
64
65 #endif