Salome HOME
bf432cfd29ccb82f020ac8d825abb2171688672b
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_BrowseNodeDlg.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SUPERV SUPERVGUI : GUI for Supervisor component
23 //  File   : SUPERVGUI_BrowseNodeDlg.h
24 //  Author : Vitaly SMETANNIKOV
25 //  Module : SUPERV
26 //
27 #ifndef SUPERVGUI_BrowseNodeDlg_H
28 #define SUPERVGUI_BrowseNodeDlg_H
29
30 #include <qdialog.h>
31 #include "SUPERVGUI_Def.h"
32
33 /** 
34  * Class for ports values management (for internal using)
35  */
36 class SUPERVGUI_PortField : public QObject {
37
38   Q_OBJECT
39
40 public:
41   SUPERVGUI_PortField( QWidget* theParent, SUPERV_Port thePort );
42   virtual ~SUPERVGUI_PortField() {};
43
44   bool eventFilter( QObject* o, QEvent* e );
45
46   bool isEditable () { return myIsEditable; }
47
48   QString getData() const { return myValue->text(); } // mkr : PAL11406
49   void    setData( const QString& data ) { myValue->setText( data ); myValue->home( false ); }
50   void    updateGUI()   { myValue->setText( myPort->ToString() ); }
51
52   bool setNewValue();
53   
54 signals :
55   void activated();
56
57 public:
58   SUPERV_Port myPort;
59   QLabel*     myLabel;
60   QLineEdit*  myValue;
61   bool        myIsEditable;
62 };
63
64
65 /**
66  * Browse Node Dialog box
67  */
68 class SUPERVGUI_CanvasNode;
69
70 class SUPERVGUI_BrowseNodeDlg: public QDialog {
71   
72   Q_OBJECT
73
74 public:
75   SUPERVGUI_BrowseNodeDlg( SUPERVGUI_CanvasNode* theNode );
76   virtual ~SUPERVGUI_BrowseNodeDlg();
77
78   void setValues();
79
80 protected slots:
81   void accept();
82   void reject();
83   void onFieldActivated();
84   void onSelectionChanged();
85
86 protected:
87   void showEvent( QShowEvent* theEvent );
88
89 private:
90   void init();
91
92   SUPERVGUI_CanvasNode*         myNodeCanvas;
93   
94   bool                          myIsEditable;
95   QPtrList<SUPERVGUI_PortField> myPortsList;
96   SUPERVGUI_PortField*          myActiveField;
97 };
98
99 /**
100  * Get Value dialog box
101  */
102 class SUPERVGUI_CanvasPort;
103
104 class SUPERVGUI_GetValueDlg: public QDialog {
105   Q_OBJECT
106
107 public:
108   SUPERVGUI_GetValueDlg( SUPERVGUI_CanvasPort* thePort );
109   ~SUPERVGUI_GetValueDlg();
110
111 private slots:
112   void accept();
113   void reject();
114   void onSelectionChanged();
115   
116 private:
117   void init();
118
119   QPushButton*         myOKBtn;
120   QPushButton*         myCancelBtn;    
121   SUPERVGUI_PortField* myField;
122
123   SUPERVGUI_CanvasPort*      myPortCanvas;
124
125 };
126
127
128 /**
129  * Stream Port Parameter dialog box
130  */
131 class SUPERVGUI_CanvasStreamPortIn;
132 class SUPERVGUI_StreamInDlg: public QDialog
133 {
134   Q_OBJECT
135 public:
136   SUPERVGUI_StreamInDlg(SUPERVGUI_CanvasStreamPortIn* thePort);
137   virtual ~SUPERVGUI_StreamInDlg() {};
138
139 protected slots:
140   void accept();
141
142 private:
143   void init();
144   void setData(); 
145
146   SUPERVGUI_CanvasStreamPortIn* myPortCanvas;
147   QComboBox* mySchemaCombo;
148   QComboBox* myInterCombo;
149   QComboBox* myExterCombo;
150 };
151
152 class SUPERVGUI_CanvasStreamPortOut;
153 class SUPERVGUI_StreamOutDlg: public QDialog
154 {
155   Q_OBJECT
156 public:
157   SUPERVGUI_StreamOutDlg(SUPERVGUI_CanvasStreamPortOut* thePort);
158   virtual ~SUPERVGUI_StreamOutDlg() {};
159
160 protected slots:
161   void accept();
162
163 private:
164   void init();
165
166   SUPERVGUI_CanvasStreamPortOut* myPortCanvas;
167   QLineEdit* myValEdit;
168 };
169
170 #endif