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