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; }
76 void salomeViewerSelectionChanged();
79 void salomeViewerSelection();
82 void updateCommandStatus();
92 void showPropertyPanel();
93 void hidePropertyPanel();
94 void showObjectBrowser();
95 void hideObjectBrowser();
97 void onFeatureTriggered();
98 void changeCurrentDocument();
101 void errorOccurred(const QString&);
104 //Event-loop processing methods:
105 void addFeature(const Config_FeatureMessage*);
106 void connectWithOperation(ModuleBase_Operation* theOperation);
107 void saveDocument(QString theName);
110 /// SLOT, that is called after the operation is started. Update workshop state according to
111 /// the started operation, e.g. visualizes the property panel and connect to it.
112 void onOperationStarted();
113 /// SLOT, that is called after the operation is stopped. Update workshop state, e.g.
114 /// hides the property panel and udpate the command status.
115 /// \param theOpertion a stopped operation
116 void onOperationStopped(ModuleBase_Operation* theOperation);
121 XGUI_Module* loadModule(const QString& theModule);
122 bool activateModule();
124 QDockWidget* createObjectBrowser(QWidget* theParent);
125 QDockWidget* createPropertyPanel(QWidget* theParent);
127 // Creates Dock widgets: Object browser and Property panel
128 void createDockWidgets();
129 void setPropertyPannelTitle(const QString& theTitle);
131 QString myCurrentFile;
132 XGUI_MainWindow* myMainWindow;
133 XGUI_Module* myPartSetModule;
134 XGUI_ObjectsBrowser* myObjectBrowser;
135 QDockWidget* myPropertyPanelDock;
136 XGUI_SelectionMgr* mySelector;
137 XGUI_Displayer* myDisplayer;
138 XGUI_OperationMgr* myOperationMgr; ///< manager to manipulate through the operations
139 XGUI_ActionsMgr* myActionsMgr;
140 XGUI_SalomeConnector* mySalomeConnector;
141 XGUI_ErrorDialog* myErrorDlg;