]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_Workshop.h
Salome HOME
Issue #21: set title of property panel from xml description
[modules/shaper.git] / src / XGUI / XGUI_Workshop.h
1 #ifndef XGUI_WORKSHOP_H
2 #define XGUI_WORKSHOP_H
3
4 #include "XGUI.h"
5 #include <Event_Listener.h>
6
7 #include <QObject>
8 #include <QMap>
9 #include <QIcon>
10 #include <QKeySequence>
11
12 class XGUI_MainWindow;
13 class XGUI_Command;
14 class XGUI_Module;
15 class XGUI_Workbench;
16 class XGUI_SelectionMgr;
17 class ModuleBase_Operation;
18 class ModuleBase_PropPanelOperation;
19
20 class Config_FeatureMessage;
21 class Config_PointerMessage;
22
23 /**\class XGUI_Workshop
24  * \ingroup GUI
25  * \brief Class which defines a configuration of the application (Workshop) and launches it.
26  */
27 class XGUI_EXPORT XGUI_Workshop: public QObject, public Event_Listener
28 {
29 Q_OBJECT
30 public:
31
32   XGUI_Workshop();
33   virtual ~XGUI_Workshop();
34
35   //! Starting of the application
36   void startApplication();
37
38   //! Returns main window (Desktop) of the application
39   XGUI_MainWindow* mainWindow() const
40   {
41     return myMainWindow;
42   }
43
44   //! Returns selection manager object
45   XGUI_SelectionMgr* selector() const { return mySelector; }
46
47   //! Creates and adds a new workbench (menu group) with the given name and returns it
48   XGUI_Workbench* addWorkbench(const QString& theName);
49
50   //! Redefinition of Event_Listener method
51   virtual void processEvent(const Event_Message* theMessage);
52
53 public slots:
54   void updateCommandStatus();
55
56   void onNew();
57   void onOpen();
58   void onSave();
59   void onSaveAs();
60   void onExit();
61   void onUndo();
62   void onRedo();
63
64 protected:
65   //Event-loop processing methods:
66   void addFeature(const Config_FeatureMessage*);
67   void fillPropertyPanel(ModuleBase_PropPanelOperation* theOperation);
68   void connectToPropertyPanel(ModuleBase_Operation* theOperation);
69   void setCurrentOperation(ModuleBase_Operation* theOperation);
70
71 private:
72   void initMenu();
73
74   XGUI_Module* loadModule(const QString& theModule);
75   bool activateModule();
76
77   XGUI_MainWindow* myMainWindow;
78   XGUI_Module* myPartSetModule;
79
80   XGUI_SelectionMgr* mySelector;
81
82   ModuleBase_Operation* myCurrentOperation;
83 };
84
85 #endif