Salome HOME
NRI : First integration.
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI.h
1 //  File      : SUPERVGUI.h
2 //  Created   : 31 octobre 2001
3 //  Author    : Francis KLOSS
4 //  Project   : SALOME
5 //  Module    : SUPERVGUI
6 //  Copyright : CEA
7
8 #ifndef SUPERVGUI_H
9 #define SUPERVGUI_H
10
11 // Acces a l'ihm de SALOME
12 // -----------------------
13
14 #include "QAD_Desktop.h"
15
16
17 #include "SUPERVGUI_Def.h"
18 #include "SUPERVGUI_Service.h"
19 #include "SUPERVGUI_Main.h"
20 //#include "SUPERVGUI_Information.h"
21
22
23 // Definition de la classe principale du module de supervision
24 // -----------------------------------------------------------
25
26 class SUPERVGUI: public QObject {
27   Q_OBJECT
28
29   public:
30     SUPERVGUI();
31     virtual ~SUPERVGUI();
32
33     QAD_Desktop*       getDesktop();
34     SUPERV_Engine      getEngine();
35     QAD_Study*         getActiveStudy() 
36       { return study; };
37
38     SUPERVGUI_Service* getBrowser();
39     QCursor            getCursor();
40     //bool information(SUPERV_CNode node, bool isReadOnly);
41     void putInfo(const char* mess);
42
43     void importDataflow();
44     void exportDataflow();
45     void newDataflow();
46     void modifyDataflow();
47     void reloadDataflow();
48     void runDataflow();
49     void stepByStep();
50     void killDataflow();
51     void suspendResumeDataflow();
52     void showComponents();
53
54     void init(QAD_Desktop* parent);
55     SUPERVGUI_Main* getMain();
56     void customPopup(QPopupMenu* popup);
57     void activeStudyChanged();
58
59     bool isContains(QAD_Study* theStudy, const QString theKey);
60
61     void registerGraph(QString theName, SUPERVGUI_Main* theGraph);
62     void unregisterGraph(SUPERVGUI_Main* theGraph);
63     QAD_StudyFrame* createGraph();
64
65     /** Returns:
66         theIsOwner = true if Selected object belongs to Suipervision.
67         theIsDataflow = true if Selected object is Dataflow
68     */
69     void whatIsSelected(const Handle(SALOME_InteractiveObject)& theObj, bool& theIsOwner, bool& theIsDataflow);
70
71   private slots:
72     void setMain(QWidget* w);
73     void displayDataflow();
74     void renameDataflow();
75     void deleteObject();
76     void onGraphClosed(QAD_StudyFrame* );
77
78   private:
79     void loadEngine(SALOME_NamingService* namingService);
80
81     static int             factory;
82     QAD_Desktop*           desktop;
83     QAD_Study*             study;
84     SUPERV_Engine          engine;
85     SUPERVGUI_Service*     browser;
86     //SUPERVGUI_Information* info;
87     QCursor                cursor;
88
89     SUPERVGUI_Main*        main;  // active main    
90     QPtrList<SUPERVGUI_Main> myGraphList;
91 };
92
93
94 // Acces a l'instance unique de la classe du module de l'interface graphique de la supervision
95 // -------------------------------------------------------------------------------------------
96 extern SUPERVGUI Supervision;
97
98 #endif