Salome HOME
Merge from V6_main (04/10/2012)
[modules/med.git] / src / MEDOP / gui / WorkspaceController.hxx
1
2 // Author : Guillaume Boulant (EDF) 
3
4 #ifndef _WORKSPACE_CONTROLLER_HXX
5 #define _WORKSPACE_CONTROLLER_HXX
6
7 #include "TreeGuiManager.hxx"
8 #include "MEDEventListener_i.hxx"
9 #include "XmedConsoleDriver.hxx"
10 #include "DatasourceController.hxx"
11 #include "MEDOPGUI.hxx"
12
13 #include <SALOMEconfig.h>
14 #include CORBA_CLIENT_HEADER(MEDDataManager)
15 #include <StandardApp_Module.hxx>
16
17 #include <vector>
18
19 /*!
20  * This class defines a DockWidget plugged in the SALOME application,
21  * and containing a tree view for rendering a hierarchical data
22  * model. This datamodel contains the objects used in the workspace.
23  */
24 class MEDOPGUI_EXPORT WorkspaceController: public TreeGuiManager {
25
26   Q_OBJECT
27
28 public:
29   WorkspaceController(StandardApp_Module * salomeModule);
30   ~WorkspaceController();
31
32   void createActions();
33
34 public slots:
35   // Slots overiding TreeGuiManager
36   void processItemList(QStringList itemNameIdList, int actionId);
37
38   // Internal slots
39   void processMedEvent(const MEDOP::MedEvent * event);
40   void processDatasourceEvent(const DatasourceEvent * event);
41   void OnSaveWorkspace();
42   void OnCleanWorkspace();
43
44 private:
45   XmedConsoleDriver * _consoleDriver;
46   StandardApp_Module * _salomeModule;
47   void _importItem(QString itemNameId);
48   void _importItemList(QStringList itemNameIdList);
49   void _importFieldIntoConsole(MEDOP::FieldHandler * fieldHandler,
50                                bool askForOptions,
51                                const char * alias=NULL);
52
53   void _exportItemList(QStringList itemNameIdList);
54   void _saveItemList(QStringList itemNameIdList);
55   void _viewItemList(QStringList itemNameIdList);
56
57   MEDEventListener_i * _medEventListener;
58
59   // This structure is intended to memorized in a bundle the whole set
60   // of integers identifying the actions of the popup menu associated
61   // to the TreeView embedded in this TreeGuiManager
62   typedef struct {
63     int display;
64     int useInTui;
65     int exportToPv;
66     int remove;
67     int save;
68   } ActionIdentifiers;
69
70   ActionIdentifiers _actionIds;
71
72 };
73
74 #endif // _WORKSPACE_CONTROLLER_HXX