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; }
75 void salomeViewerSelectionChanged();
78 void salomeViewerSelection();
81 void updateCommandStatus();
91 void showPropertyPanel();
92 void hidePropertyPanel();
93 void showObjectBrowser();
94 void hideObjectBrowser();
96 void onFeatureTriggered();
98 void changeCurrentDocument();
101 //Event-loop processing methods:
102 void addFeature(const Config_FeatureMessage*);
103 void connectWithOperation(ModuleBase_Operation* theOperation);
106 /// SLOT, that is called after the operation is started. Update workshop state according to
107 /// the started operation, e.g. visualizes the property panel and connect to it.
108 void onOperationStarted();
109 /// SLOT, that is called after the operation is stopped. Update workshop state, e.g.
110 /// hides the property panel and udpate the command status.
111 /// \param theOpertion a stopped operation
112 void onOperationStopped(ModuleBase_Operation* theOperation);
117 XGUI_Module* loadModule(const QString& theModule);
118 bool activateModule();
120 QDockWidget* createObjectBrowser(QWidget* theParent);
121 QDockWidget* createPropertyPanel(QWidget* theParent);
123 // Creates Dock widgets: Object browser and Property panel
124 void createDockWidgets();
125 void setPropertyPannelTitle(const QString& theTitle);
128 XGUI_MainWindow* myMainWindow;
129 XGUI_Module* myPartSetModule;
131 XGUI_ObjectsBrowser* myObjectBrowser;
132 QDockWidget* myPropertyPanelDock;
134 XGUI_SelectionMgr* mySelector;
135 XGUI_Displayer* myDisplayer;
137 XGUI_OperationMgr* myOperationMgr; ///< manager to manipulate through the operations
138 XGUI_ActionsMgr* myActionsMgr;
141 XGUI_SalomeConnector* mySalomeConnector;