Salome HOME
dc0529a84a74a35aaabda3f7a91c2554def70601
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_Array.h
1 //  SUPERV SUPERVGUI : GUI for Supervisor component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SUPERVGUI_Array.h
25 //  Author : Francis KLOSS
26 //  Module : SUPERV
27
28 #ifndef SUPERVGUI_Array_H
29 #define SUPERVGUI_Array_H
30
31 using namespace std;
32 #include "SUPERVGUI_Def.h"
33 #include <qpopupmenu.h>
34 #include "SUPERVGUI_Node.h"
35 #include "SUPERVGUI_ControlNode.h"
36 #include "SUPERVGUI_View.h"
37 #include "SUPERVGUI_Label.h"
38
39 class SUPERVGUI_Main;
40
41
42 class SUPERVGUI_Array: public SUPERVGUI_View {
43   Q_OBJECT
44
45   public:
46     SUPERVGUI_Array(SUPERVGUI_Main* m);
47     virtual ~SUPERVGUI_Array();
48
49     void sync();
50     bool create();
51     void destroy();
52
53     SUPERVGUI_Node* addNode(SUPERV_CNode node);
54
55   private:
56     void contentsMousePressEvent(QMouseEvent* e);
57
58
59     int             nodeX;
60     int             nodeY;
61 };
62
63
64
65
66
67
68
69 class SUPERVGUI_Cell: public SUPERVGUI_Node {
70   Q_OBJECT
71
72   public:
73     SUPERVGUI_Cell(QWidget* parent, SUPERVGUI_Main* m, SUPERV_CNode n);
74     virtual ~SUPERVGUI_Cell();
75
76     void sync();
77     void hideAll() {};
78     void showAll() {};
79
80     void updateStudy();
81     SUPERVGUI_Label* getTitle() { return myTitle; }
82     SUPERVGUI_Label* getComponent() { return component; }
83     void setPairCell(SUPERVGUI_Cell* thePairCell);
84     SUPERVGUI_Cell* getPairCell();
85
86   public slots:
87     virtual void rename();
88
89   protected:
90     SUPERVGUI_Cell* myPairCell;  //for ControlNodes
91     SUPERVGUI_Label* myTitle;
92     SUPERVGUI_Node*  guiNode;
93
94   private:
95     SUPERVGUI_Label* component;
96     //SUPERVGUI_Label* service;
97
98     int         myShowItem;
99     bool        myIsControl;
100     bool        myIsStart;
101 };
102
103 class SUPERVGUI_CellEndControl: public SUPERVGUI_Cell {
104   Q_OBJECT
105
106   public:
107     SUPERVGUI_CellEndControl(QWidget* parent, SUPERVGUI_Main* m, SUPERV_CNode n, SUPERVGUI_Cell* theStart);
108     virtual ~SUPERVGUI_CellEndControl();
109 };
110
111 #endif