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 ModuleBase_Operation;
22 class ModuleBase_PropPanelOperation;
24 class Config_FeatureMessage;
25 class Config_PointerMessage;
30 /**\class XGUI_Workshop
32 * \brief Class which defines a configuration of the application (Workshop) and launches it.
34 class XGUI_EXPORT XGUI_Workshop: public QObject, public Events_Listener
39 XGUI_Workshop(XGUI_SalomeConnector* theConnector = 0);
40 virtual ~XGUI_Workshop();
42 //! Starting of the application
43 void startApplication();
45 //! Returns main window (Desktop) of the application
46 XGUI_MainWindow* mainWindow() const
51 //! Returns selection manager object
52 XGUI_SelectionMgr* selector() const { return mySelector; }
55 XGUI_Displayer* displayer() const;
57 //! ! Returns operation manager.
58 XGUI_OperationMgr* operationMgr() const { return myOperationMgr; }
60 //! Creates and adds a new workbench (menu group) with the given name and returns it
61 XGUI_Workbench* addWorkbench(const QString& theName);
63 //! Redefinition of Events_Listener method
64 virtual void processEvent(const Events_Message* theMessage);
66 XGUI_SalomeConnector* salomeConnector() const { return mySalomeConnector; }
68 //! Returns true if the application works as SALOME module
69 bool isSalomeMode() const { return mySalomeConnector != 0; }
71 //! Returns Object browser
72 XGUI_ObjectsBrowser* objectBrowser() const { return myObjectBrowser; }
75 void updateCommandStatus();
85 void showPropertyPanel();
86 void hidePropertyPanel();
87 void showObjectBrowser();
88 void hideObjectBrowser();
90 void onFeatureTriggered();
93 //Event-loop processing methods:
94 void addFeature(const Config_FeatureMessage*);
95 void connectWithOperation(ModuleBase_Operation* theOperation);
98 /// SLOT, that is called after the operation is started. Update workshop state according to
99 /// the started operation, e.g. visualizes the property panel and connect to it.
100 void onOperationStarted();
101 /// SLOT, that is called after the operation is stopped. Update workshop state, e.g.
102 /// hides the property panel and udpate the command status.
103 /// \param theOpertion a stopped operation
104 void onOperationStopped(ModuleBase_Operation* theOperation);
109 XGUI_Module* loadModule(const QString& theModule);
110 bool activateModule();
112 QDockWidget* createObjectBrowser(QWidget* theParent);
113 QDockWidget* createPropertyPanel(QWidget* theParent);
115 // Creates Dock widgets: Object browser and Property panel
116 void createDockWidgets();
117 void setPropertyPannelTitle(const QString& theTitle);
120 XGUI_MainWindow* myMainWindow;
121 XGUI_Module* myPartSetModule;
123 XGUI_ObjectsBrowser* myObjectBrowser;
124 QDockWidget* myPropertyPanelDock;
126 XGUI_SelectionMgr* mySelector;
127 XGUI_Displayer* myDisplayer;
129 XGUI_OperationMgr* myOperationMgr; ///< manager to manipulate through the operations
131 XGUI_SalomeConnector* mySalomeConnector;