1 // SUPERV SUPERVGUI : GUI for Supervisor component
3 // Copyright (C) 2003 OPEN CASCADE
5 // File : SUPERVGUI_CanvasPort.h
6 // Author : Natalia KOPNOVA
9 #ifndef SUPERVGUI_CanvasPort_H
10 #define SUPERVGUI_CanvasPort_H
12 #include "SUPERVGUI_Def.h"
16 class SUPERVGUI_CanvasLink;
17 class SUPERVGUI_CanvasPortPrs;
19 class SUPERVGUI_CanvasPort : public QObject {
23 SUPERVGUI_CanvasPort(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
24 virtual ~SUPERVGUI_CanvasPort();
26 virtual void update();
29 virtual bool isStream() const { return false; }
31 SUPERV_Port getEngine() const { return myPort; }
32 SUPERVGUI_Main* getMain() const { return myMain; }
33 SUPERVGUI_CanvasPortPrs* getPrs() const;
35 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
37 virtual QPoint getConnectionPoint() const;
39 void moveBy(int dx, int dy);
40 void addLink(SUPERVGUI_CanvasLink* theLink);
41 void removeLink(SUPERVGUI_CanvasLink* theLink);
45 void objectDeleted(); // mkr : PAL8237
49 virtual void remove();
54 virtual SUPERVGUI_CanvasPortPrs* createPrs() const;
58 SUPERVGUI_Main* myMain;
60 SUPERVGUI_CanvasPortPrs* myPrs;
61 QValueList<SUPERVGUI_CanvasLink*> myLinks;
65 class SUPERVGUI_GetValueDlg;
66 class SUPERVGUI_CanvasPortIn : public SUPERVGUI_CanvasPort {
70 SUPERVGUI_CanvasPortIn(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
71 virtual ~SUPERVGUI_CanvasPortIn();
73 void setValue(const char* theValue);
75 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
81 bool eventFilter(QObject* o, QEvent* e);
84 SUPERVGUI_GetValueDlg* myDlg;
87 class SUPERVGUI_CanvasPortOut : public SUPERVGUI_CanvasPort {
91 SUPERVGUI_CanvasPortOut(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
92 virtual ~SUPERVGUI_CanvasPortOut();
95 bool isInStudy() const { return myInStudy; }
96 void setStudyState(bool theInStudy) { myInStudy = theInStudy; }
98 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
107 class SUPERVGUI_CanvasStreamPortIn : public SUPERVGUI_CanvasPortIn {
111 SUPERVGUI_CanvasStreamPortIn(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::StreamPort_ptr thePort);
112 virtual ~SUPERVGUI_CanvasStreamPortIn() {}
114 virtual bool isStream() const { return true; }
115 SUPERV_StreamPort getStreamEngine() const { return myStreamPort; }
117 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
123 SUPERV_StreamPort myStreamPort;
126 class SUPERVGUI_CanvasStreamPortOut : public SUPERVGUI_CanvasPortOut {
130 SUPERVGUI_CanvasStreamPortOut(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::StreamPort_ptr thePort);
131 virtual ~SUPERVGUI_CanvasStreamPortOut() {}
133 virtual bool isStream() const { return true; }
134 SUPERV_StreamPort getStreamEngine() const { return myStreamPort; }
136 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
142 SUPERV_StreamPort myStreamPort;