1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SUPERV SUPERVGUI : GUI for Supervisor component
23 // File : SUPERVGUI_ManagePortsDlg.h
24 // Author : Alexander SLADKOV
27 #ifndef SUPERVGUI_ManagePortsDlg_H
28 #define SUPERVGUI_ManagePortsDlg_H
30 #include "SUPERVGUI.h"
34 #include <qstringlist.h>
35 #include <qlineedit.h>
36 #include <qcombobox.h>
39 class SUPERVGUI_CanvasNode;
42 * Simple redefinition of ListBoxItem for storing ports name and type without having to parce it
44 class PortListItem : QListBoxText {
46 PortListItem ( QListBox* lb, const QString& name, const QString& type )
47 : QListBoxText( lb/*, QString( "%1 (%2)" ).arg( name ).arg( type )*/ ),
52 virtual QString text() const { return QString( "%1 (%2)" ).arg( PortName ).arg( PortType ); }
58 class SUPERVGUI_ManagePortsDlg: public QDialog {
63 SUPERVGUI_ManagePortsDlg( SUPERVGUI_CanvasNode* theNode );
64 virtual ~SUPERVGUI_ManagePortsDlg();
70 void addInput() { addPort( myInList ); }
71 void addOutput() { addPort( myOutList );}
72 void removeInput() { removePort( myInList ); }
73 void removeOutput() { removePort( myOutList );}
74 void upInput() { moveUp( myInList ); }
75 void upOutput() { moveUp( myOutList );}
76 void downInput() { moveDown( myInList ); }
77 void downOutput() { moveDown( myOutList );}
79 void nameChanged( const QString& name );
80 void typeChanged( const QString& type );
81 void itemChanged( QListBoxItem * item );
82 void itemDeselect(QListBoxItem* item, const QPoint& point); // mkr: PAL12448
85 void addPort( QListBox* );
86 void removePort( QListBox* );
87 void moveUp( QListBox* );
88 void moveDown( QListBox* );
89 void moveItem( QListBox* theLB, const int from, const int to );
91 void createLinkEngine( SUPERV::Port_ptr thePort,
92 QValueList< QPair< QString,QString > >& theOwnList,
93 QValueList< QPair< QString,QString > >& theCorrespList );
97 void init( const SUPERVGUI_CanvasNode* theNode );
99 SUPERVGUI_CanvasNode* myNode;
101 QLineEdit* myNameEdt;
102 QComboBox* myTypeCombo;
105 QListBoxItem* myLastItem;
109 * Port parameters dialog definition (taken from SUPERVGUI_Node.h without change)
111 class SUPERVGUI_PortParamsDlg: public QDialog {
115 SUPERVGUI_PortParamsDlg(const QStringList& thePortsNames);
116 ~SUPERVGUI_PortParamsDlg() {};
118 QString getName() { return myNameTxt->text(); }
119 QString getType() { return myTypeTxt->currentText(); }
126 QLineEdit* myNameTxt;
127 QComboBox* myTypeTxt;
128 QStringList myPortsNames;