]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_Workshop.h
Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[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 XGUI_Displayer;
18 class ModuleBase_Operation;
19 class ModuleBase_PropPanelOperation;
20
21 class Config_FeatureMessage;
22 class Config_PointerMessage;
23
24 /**\class XGUI_Workshop
25  * \ingroup GUI
26  * \brief Class which defines a configuration of the application (Workshop) and launches it.
27  */
28 class XGUI_EXPORT XGUI_Workshop: public QObject, public Event_Listener
29 {
30 Q_OBJECT
31 public:
32
33   XGUI_Workshop();
34   virtual ~XGUI_Workshop();
35
36   //! Starting of the application
37   void startApplication();
38
39   //! Returns main window (Desktop) of the application
40   XGUI_MainWindow* mainWindow() const
41   {
42     return myMainWindow;
43   }
44
45   //! Returns selection manager object
46   XGUI_SelectionMgr* selector() const { return mySelector; }
47
48   //! Returns displayer
49   XGUI_Displayer* displayer() const { return myDisplayer; }
50
51   //! Creates and adds a new workbench (menu group) with the given name and returns it
52   XGUI_Workbench* addWorkbench(const QString& theName);
53
54   //! Returns the current operation or NULL
55   ModuleBase_Operation* currentOperation() { return myCurrentOperation; }
56
57   //! Redefinition of Event_Listener method
58   virtual void processEvent(const Event_Message* theMessage);
59
60 public slots:
61   void updateCommandStatus();
62
63   void onNew();
64   void onOpen();
65   void onSave();
66   void onSaveAs();
67   void onExit();
68   void onUndo();
69   void onRedo();
70
71 protected:
72   //Event-loop processing methods:
73   void addFeature(const Config_FeatureMessage*);
74   void fillPropertyPanel(ModuleBase_PropPanelOperation* theOperation);
75   void connectWithOperation(ModuleBase_Operation* theOperation);
76   void setCurrentOperation(ModuleBase_Operation* theOperation);
77
78 private:
79   void initMenu();
80
81   XGUI_Module* loadModule(const QString& theModule);
82   bool activateModule();
83
84   XGUI_MainWindow* myMainWindow;
85   XGUI_Module* myPartSetModule;
86
87   XGUI_SelectionMgr* mySelector;
88   XGUI_Displayer* myDisplayer;
89
90   ModuleBase_Operation* myCurrentOperation;
91 };
92
93 #endif