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 <Event_Message.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
19 class Config_FeatureMessage;
20 class Config_PointerMessage;
21
22 /**\class XGUI_Workshop
23  * \ingroup GUI
24  * \brief Class which defines a configuration of the application (Workshop) and launches it.
25  */
26 class XGUI_Workshop: public QObject, public Event_Listener
27 {
28 Q_OBJECT
29 public:
30
31   XGUI_Workshop();
32   virtual ~XGUI_Workshop();
33
34   //! Starting of the application
35   void startApplication();
36
37   //! Returns main window (Desktop) of the application
38   XGUI_MainWindow* mainWindow() const
39   {
40     return myMainWindow;
41   }
42
43   //! Returns selection manager object
44   XGUI_SelectionMgr* selector() const { return mySelector; }
45
46   //! Creates and adds a new workbench (menu group) with the given name and returns it
47   XGUI_Workbench* addWorkbench(const QString& theName);
48
49   //! Redefinition of Event_Listener method
50   virtual void processEvent(const Event_Message* theMessage);
51
52 public slots:
53   void onNew();
54   void onOpen();
55   void onSave();
56   void onSaveAs();
57   void onExit();
58
59 protected:
60   //Event-loop processing methods:
61   void addFeature(const Config_FeatureMessage*);
62   void fillPropertyPanel(ModuleBase_Operation* theOperation);
63   void connectToPropertyPanel(ModuleBase_Operation* theOperation);
64   void setCurrentOperation(ModuleBase_Operation* theOperation);
65
66 private:
67   void initMenu();
68
69   XGUI_Module* loadModule(const QString& theModule);
70   bool activateModule();
71
72   XGUI_MainWindow* myMainWindow;
73   XGUI_Module* myPartSetModule;
74
75   XGUI_SelectionMgr* mySelector;
76
77   ModuleBase_Operation* myCurrentOperation;
78 };
79
80 #endif