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 XGUI_ErrorDialog;
23 class ModuleBase_Operation;
24 class ModuleBase_PropPanelOperation;
26 class Config_FeatureMessage;
27 class Config_PointerMessage;
32 /**\class XGUI_Workshop
34 * \brief Class which defines a configuration of the application (Workshop) and launches it.
36 class XGUI_EXPORT XGUI_Workshop: public QObject, public Events_Listener
41 XGUI_Workshop(XGUI_SalomeConnector* theConnector = 0);
42 virtual ~XGUI_Workshop();
44 //! Starting of the application
45 void startApplication();
47 //! Returns main window (Desktop) of the application
48 XGUI_MainWindow* mainWindow() const
53 //! Returns selection manager object
54 XGUI_SelectionMgr* selector() const { return mySelector; }
57 XGUI_Displayer* displayer() const;
59 //! ! Returns operation manager.
60 XGUI_OperationMgr* operationMgr() const { return myOperationMgr; }
62 //! Creates and adds a new workbench (menu group) with the given name and returns it
63 XGUI_Workbench* addWorkbench(const QString& theName);
65 //! Redefinition of Events_Listener method
66 virtual void processEvent(const Events_Message* theMessage);
68 XGUI_SalomeConnector* salomeConnector() const { return mySalomeConnector; }
70 //! Returns true if the application works as SALOME module
71 bool isSalomeMode() const { return mySalomeConnector != 0; }
73 //! Returns Object browser
74 XGUI_ObjectsBrowser* objectBrowser() const { return myObjectBrowser; }
77 void updateCommandStatus();
87 void showPropertyPanel();
88 void hidePropertyPanel();
89 void showObjectBrowser();
90 void hideObjectBrowser();
92 void onFeatureTriggered();
95 void errorOccurred(const QString&);
98 //Event-loop processing methods:
99 void addFeature(const Config_FeatureMessage*);
100 void connectWithOperation(ModuleBase_Operation* theOperation);
101 void saveDocument(QString theName);
104 /// SLOT, that is called after the operation is started. Update workshop state according to
105 /// the started operation, e.g. visualizes the property panel and connect to it.
106 void onOperationStarted();
107 /// SLOT, that is called after the operation is stopped. Update workshop state, e.g.
108 /// hides the property panel and udpate the command status.
109 /// \param theOpertion a stopped operation
110 void onOperationStopped(ModuleBase_Operation* theOperation);
115 XGUI_Module* loadModule(const QString& theModule);
116 bool activateModule();
118 QDockWidget* createObjectBrowser(QWidget* theParent);
119 QDockWidget* createPropertyPanel(QWidget* theParent);
121 // Creates Dock widgets: Object browser and Property panel
122 void createDockWidgets();
123 void setPropertyPannelTitle(const QString& theTitle);
125 QString myCurrentFile;
126 XGUI_MainWindow* myMainWindow;
127 XGUI_Module* myPartSetModule;
128 XGUI_ObjectsBrowser* myObjectBrowser;
129 QDockWidget* myPropertyPanelDock;
130 XGUI_SelectionMgr* mySelector;
131 XGUI_Displayer* myDisplayer;
132 XGUI_OperationMgr* myOperationMgr; ///< manager to manipulate through the operations
133 XGUI_ActionsMgr* myActionsMgr;
134 XGUI_SalomeConnector* mySalomeConnector;
135 XGUI_ErrorDialog* myErrorDlg;