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 //! ! Returns an actions manager
63 XGUI_ActionsMgr* actionsMgr() const { return myActionsMgr; };
65 //! Creates and adds a new workbench (menu group) with the given name and returns it
66 XGUI_Workbench* addWorkbench(const QString& theName);
68 //! Redefinition of Events_Listener method
69 virtual void processEvent(const Events_Message* theMessage);
71 XGUI_SalomeConnector* salomeConnector() const { return mySalomeConnector; }
73 //! Returns true if the application works as SALOME module
74 bool isSalomeMode() const { return mySalomeConnector != 0; }
76 //! Returns Object browser
77 XGUI_ObjectsBrowser* objectBrowser() const { return myObjectBrowser; }
79 void salomeViewerSelectionChanged();
82 void salomeViewerSelection();
85 void updateCommandStatus();
95 void showPropertyPanel();
96 void hidePropertyPanel();
97 void showObjectBrowser();
98 void hideObjectBrowser();
100 void onFeatureTriggered();
101 void changeCurrentDocument();
104 void errorOccurred(const QString&);
107 //Event-loop processing methods:
108 void addFeature(const Config_FeatureMessage*);
109 void connectWithOperation(ModuleBase_Operation* theOperation);
110 void saveDocument(QString theName);
113 /// SLOT, that is called after the operation is started. Update workshop state according to
114 /// the started operation, e.g. visualizes the property panel and connect to it.
115 void onOperationStarted();
116 /// SLOT, that is called after the operation is stopped. Update workshop state, e.g.
117 /// hides the property panel and udpate the command status.
118 /// \param theOpertion a stopped operation
119 void onOperationStopped(ModuleBase_Operation* theOperation);
124 XGUI_Module* loadModule(const QString& theModule);
125 bool activateModule();
127 QDockWidget* createObjectBrowser(QWidget* theParent);
128 QDockWidget* createPropertyPanel(QWidget* theParent);
130 // Creates Dock widgets: Object browser and Property panel
131 void createDockWidgets();
132 void setPropertyPannelTitle(const QString& theTitle);
134 QString myCurrentFile;
135 XGUI_MainWindow* myMainWindow;
136 XGUI_Module* myPartSetModule;
137 XGUI_ObjectsBrowser* myObjectBrowser;
138 QDockWidget* myPropertyPanelDock;
139 XGUI_SelectionMgr* mySelector;
140 XGUI_Displayer* myDisplayer;
141 XGUI_OperationMgr* myOperationMgr; ///< manager to manipulate through the operations
142 XGUI_ActionsMgr* myActionsMgr;
143 XGUI_SalomeConnector* mySalomeConnector;
144 XGUI_ErrorDialog* myErrorDlg;