Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_BrowseNodeDlg.h
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
4 //  This library is free software; you can redistribute it and/or 
5 //  modify it under the terms of the GNU Lesser General Public 
6 //  License as published by the Free Software Foundation; either 
7 //  version 2.1 of the License. 
8 // 
9 //  This library is distributed in the hope that it will be useful, 
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 //  Lesser General Public License for more details. 
13 // 
14 //  You should have received a copy of the GNU Lesser General Public 
15 //  License along with this library; if not, write to the Free Software 
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 // 
18 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //  SUPERV SUPERVGUI : GUI for Supervisor component
21 //
22 //  File   : SUPERVGUI_BrowseNodeDlg.h
23 //  Author : Vitaly SMETANNIKOV
24 //  Module : SUPERV
25
26 #ifndef SUPERVGUI_BrowseNodeDlg_H
27 #define SUPERVGUI_BrowseNodeDlg_H
28
29 #include <qdialog.h>
30 #include "SUPERVGUI_Def.h"
31
32 /** 
33  * Class for ports values management (for internal using)
34  */
35 class SUPERVGUI_PortField : public QObject {
36
37   Q_OBJECT
38
39 public:
40   SUPERVGUI_PortField( QWidget* theParent, SUPERV_Port thePort );
41   virtual ~SUPERVGUI_PortField() {};
42
43   bool eventFilter( QObject* o, QEvent* e );
44
45   bool isEditable () { return myIsEditable; }
46
47   QString getData() const { return myValue->text(); } // mkr : PAL11406
48   void    setData( const QString& data ) { myValue->setText( data ); myValue->home( false ); }
49   void    updateGUI()   { myValue->setText( myPort->ToString() ); }
50
51   bool setNewValue();
52   
53 signals :
54   void activated();
55
56 public:
57   SUPERV_Port myPort;
58   QLabel*     myLabel;
59   QLineEdit*  myValue;
60   bool        myIsEditable;
61 };
62
63
64 /**
65  * Browse Node Dialog box
66  */
67 class SUPERVGUI_CanvasNode;
68
69 class SUPERVGUI_BrowseNodeDlg: public QDialog {
70   
71   Q_OBJECT
72
73 public:
74   SUPERVGUI_BrowseNodeDlg( SUPERVGUI_CanvasNode* theNode );
75   virtual ~SUPERVGUI_BrowseNodeDlg();
76
77   void setValues();
78
79 protected slots:
80   void accept();
81   void reject();
82   void onFieldActivated();
83   void onSelectionChanged();
84
85 protected:
86   void showEvent( QShowEvent* theEvent );
87
88 private:
89   void init();
90
91   SUPERVGUI_CanvasNode*         myNodeCanvas;
92   
93   bool                          myIsEditable;
94   QPtrList<SUPERVGUI_PortField> myPortsList;
95   SUPERVGUI_PortField*          myActiveField;
96 };
97
98 /**
99  * Get Value dialog box
100  */
101 class SUPERVGUI_CanvasPort;
102
103 class SUPERVGUI_GetValueDlg: public QDialog {
104   Q_OBJECT
105
106 public:
107   SUPERVGUI_GetValueDlg( SUPERVGUI_CanvasPort* thePort );
108   ~SUPERVGUI_GetValueDlg();
109
110 private slots:
111   void accept();
112   void reject();
113   void onSelectionChanged();
114   
115 private:
116   void init();
117
118   QPushButton*         myOKBtn;
119   QPushButton*         myCancelBtn;    
120   SUPERVGUI_PortField* myField;
121
122   SUPERVGUI_CanvasPort*      myPortCanvas;
123
124 };
125
126
127 /**
128  * Stream Port Parameter dialog box
129  */
130 class SUPERVGUI_CanvasStreamPortIn;
131 class SUPERVGUI_StreamInDlg: public QDialog
132 {
133   Q_OBJECT
134 public:
135   SUPERVGUI_StreamInDlg(SUPERVGUI_CanvasStreamPortIn* thePort);
136   virtual ~SUPERVGUI_StreamInDlg() {};
137
138 protected slots:
139   void accept();
140
141 private:
142   void init();
143   void setData(); 
144
145   SUPERVGUI_CanvasStreamPortIn* myPortCanvas;
146   QComboBox* mySchemaCombo;
147   QComboBox* myInterCombo;
148   QComboBox* myExterCombo;
149 };
150
151 class SUPERVGUI_CanvasStreamPortOut;
152 class SUPERVGUI_StreamOutDlg: public QDialog
153 {
154   Q_OBJECT
155 public:
156   SUPERVGUI_StreamOutDlg(SUPERVGUI_CanvasStreamPortOut* thePort);
157   virtual ~SUPERVGUI_StreamOutDlg() {};
158
159 protected slots:
160   void accept();
161
162 private:
163   void init();
164
165   SUPERVGUI_CanvasStreamPortOut* myPortCanvas;
166   QLineEdit* myValEdit;
167 };
168
169 #endif