1 // SUPERV SUPERVGUI : GUI for Supervisor component
3 // Copyright (C) 2003 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 // File : SUPERVGUI_CanvasPort.h
23 // Author : Natalia KOPNOVA
26 #ifndef SUPERVGUI_CanvasPort_H
27 #define SUPERVGUI_CanvasPort_H
29 #include "SUPERVGUI_Def.h"
33 class SUPERVGUI_CanvasLink;
34 class SUPERVGUI_CanvasPortPrs;
36 class SUPERVGUI_CanvasPort : public QObject {
40 SUPERVGUI_CanvasPort(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
41 virtual ~SUPERVGUI_CanvasPort();
43 virtual void update();
46 virtual bool isStream() const { return false; }
48 SUPERV_Port getEngine() const { return myPort; }
49 SUPERVGUI_Main* getMain() const { return myMain; }
50 SUPERVGUI_CanvasPortPrs* getPrs() const;
52 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
54 virtual QPoint getConnectionPoint() const;
56 void moveBy(int dx, int dy);
57 void addLink(SUPERVGUI_CanvasLink* theLink);
58 void removeLink(SUPERVGUI_CanvasLink* theLink);
62 void objectDeleted(); // mkr : PAL8237
66 virtual void remove();
71 virtual SUPERVGUI_CanvasPortPrs* createPrs() const;
75 SUPERVGUI_Main* myMain;
77 SUPERVGUI_CanvasPortPrs* myPrs;
78 QValueList<SUPERVGUI_CanvasLink*> myLinks;
82 class SUPERVGUI_GetValueDlg;
83 class SUPERVGUI_CanvasPortIn : public SUPERVGUI_CanvasPort {
87 SUPERVGUI_CanvasPortIn(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
88 virtual ~SUPERVGUI_CanvasPortIn();
90 void setValue(const char* theValue);
92 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
98 bool eventFilter(QObject* o, QEvent* e);
101 SUPERVGUI_GetValueDlg* myDlg;
104 class SUPERVGUI_CanvasPortOut : public SUPERVGUI_CanvasPort {
108 SUPERVGUI_CanvasPortOut(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
109 virtual ~SUPERVGUI_CanvasPortOut();
112 bool isInStudy() const { return myInStudy; }
113 void setStudyState(bool theInStudy) { myInStudy = theInStudy; }
115 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
118 void putInStudy( QString* ); // mkr : PAL8150
127 class SUPERVGUI_CanvasStreamPortIn : public SUPERVGUI_CanvasPortIn {
131 SUPERVGUI_CanvasStreamPortIn(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::StreamPort_ptr thePort);
132 virtual ~SUPERVGUI_CanvasStreamPortIn() {}
134 virtual bool isStream() const { return true; }
135 SUPERV_StreamPort getStreamEngine() const { return myStreamPort; }
137 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
143 SUPERV_StreamPort myStreamPort;
146 class SUPERVGUI_CanvasStreamPortOut : public SUPERVGUI_CanvasPortOut {
150 SUPERVGUI_CanvasStreamPortOut(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::StreamPort_ptr thePort);
151 virtual ~SUPERVGUI_CanvasStreamPortOut() {}
153 virtual bool isStream() const { return true; }
154 SUPERV_StreamPort getStreamEngine() const { return myStreamPort; }
156 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
162 SUPERV_StreamPort myStreamPort;