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; }
74 void salomeViewerSelectionChanged();
77 void salomeViewerSelection();
80 void updateCommandStatus();
90 void showPropertyPanel();
91 void hidePropertyPanel();
92 void showObjectBrowser();
93 void hideObjectBrowser();
95 void onFeatureTriggered();
97 void changeCurrentDocument();
100 //Event-loop processing methods:
101 void addFeature(const Config_FeatureMessage*);
102 void connectWithOperation(ModuleBase_Operation* theOperation);
105 /// SLOT, that is called after the operation is started. Update workshop state according to
106 /// the started operation, e.g. visualizes the property panel and connect to it.
107 void onOperationStarted();
108 /// SLOT, that is called after the operation is stopped. Update workshop state, e.g.
109 /// hides the property panel and udpate the command status.
110 /// \param theOpertion a stopped operation
111 void onOperationStopped(ModuleBase_Operation* theOperation);
116 XGUI_Module* loadModule(const QString& theModule);
117 bool activateModule();
119 QDockWidget* createObjectBrowser(QWidget* theParent);
120 QDockWidget* createPropertyPanel(QWidget* theParent);
122 // Creates Dock widgets: Object browser and Property panel
123 void createDockWidgets();
124 void setPropertyPannelTitle(const QString& theTitle);
127 XGUI_MainWindow* myMainWindow;
128 XGUI_Module* myPartSetModule;
130 XGUI_ObjectsBrowser* myObjectBrowser;
131 QDockWidget* myPropertyPanelDock;
133 XGUI_SelectionMgr* mySelector;
134 XGUI_Displayer* myDisplayer;
136 XGUI_OperationMgr* myOperationMgr; ///< manager to manipulate through the operations
138 XGUI_SalomeConnector* mySalomeConnector;