1 #ifndef XGUI_WORKSHOP_H
2 #define XGUI_WORKSHOP_H
5 #include <Events_Listener.h>
10 #include <QKeySequence>
12 class XGUI_MainWindow;
16 class XGUI_SelectionMgr;
18 class XGUI_OperationMgr;
19 class XGUI_SalomeConnector;
20 class XGUI_ObjectsBrowser;
21 class XGUI_ActionsMgr;
22 class ModuleBase_Operation;
23 class ModuleBase_PropPanelOperation;
25 class Config_FeatureMessage;
26 class Config_PointerMessage;
31 /**\class XGUI_Workshop
33 * \brief Class which defines a configuration of the application (Workshop) and launches it.
35 class XGUI_EXPORT XGUI_Workshop: public QObject, public Events_Listener
40 XGUI_Workshop(XGUI_SalomeConnector* theConnector = 0);
41 virtual ~XGUI_Workshop();
43 //! Starting of the application
44 void startApplication();
46 //! Returns main window (Desktop) of the application
47 XGUI_MainWindow* mainWindow() const
52 //! Returns selection manager object
53 XGUI_SelectionMgr* selector() const { return mySelector; }
56 XGUI_Displayer* displayer() const;
58 //! ! Returns operation manager.
59 XGUI_OperationMgr* operationMgr() const { return myOperationMgr; }
61 //! Creates and adds a new workbench (menu group) with the given name and returns it
62 XGUI_Workbench* addWorkbench(const QString& theName);
64 //! Redefinition of Events_Listener method
65 virtual void processEvent(const Events_Message* theMessage);
67 XGUI_SalomeConnector* salomeConnector() const { return mySalomeConnector; }
69 //! Returns true if the application works as SALOME module
70 bool isSalomeMode() const { return mySalomeConnector != 0; }
72 //! Returns Object browser
73 XGUI_ObjectsBrowser* objectBrowser() const { return myObjectBrowser; }
76 void updateCommandStatus();
86 void showPropertyPanel();
87 void hidePropertyPanel();
88 void showObjectBrowser();
89 void hideObjectBrowser();
91 void onFeatureTriggered();
94 //Event-loop processing methods:
95 void addFeature(const Config_FeatureMessage*);
96 void connectWithOperation(ModuleBase_Operation* theOperation);
99 /// SLOT, that is called after the operation is started. Update workshop state according to
100 /// the started operation, e.g. visualizes the property panel and connect to it.
101 void onOperationStarted();
102 /// SLOT, that is called after the operation is stopped. Update workshop state, e.g.
103 /// hides the property panel and udpate the command status.
104 /// \param theOpertion a stopped operation
105 void onOperationStopped(ModuleBase_Operation* theOperation);
110 XGUI_Module* loadModule(const QString& theModule);
111 bool activateModule();
113 QDockWidget* createObjectBrowser(QWidget* theParent);
114 QDockWidget* createPropertyPanel(QWidget* theParent);
116 // Creates Dock widgets: Object browser and Property panel
117 void createDockWidgets();
118 void setPropertyPannelTitle(const QString& theTitle);
121 XGUI_MainWindow* myMainWindow;
122 XGUI_Module* myPartSetModule;
124 XGUI_ObjectsBrowser* myObjectBrowser;
125 QDockWidget* myPropertyPanelDock;
127 XGUI_SelectionMgr* mySelector;
128 XGUI_Displayer* myDisplayer;
130 XGUI_OperationMgr* myOperationMgr; ///< manager to manipulate through the operations
131 XGUI_ActionsMgr* myActionsMgr;
134 XGUI_SalomeConnector* mySalomeConnector;