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
13 #include "SUPERVGUI_Def.h"
17 class SUPERVGUI_CanvasLink;
18 class SUPERVGUI_CanvasPortPrs;
20 class SUPERVGUI_CanvasPort : public QObject {
24 SUPERVGUI_CanvasPort(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
25 virtual ~SUPERVGUI_CanvasPort();
27 virtual void update();
30 virtual bool isStream() const { return false; }
32 SUPERV_Port getEngine() const { return myPort; }
33 SUPERVGUI_Main* getMain() const { return myMain; }
34 SUPERVGUI_CanvasPortPrs* getPrs() const;
36 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
38 virtual QPoint getConnectionPoint() const;
40 void moveBy(int dx, int dy);
41 void addLink(SUPERVGUI_CanvasLink* theLink);
42 void removeLink(SUPERVGUI_CanvasLink* theLink);
47 virtual void remove();
51 virtual SUPERVGUI_CanvasPortPrs* createPrs() const;
55 SUPERVGUI_Main* myMain;
57 SUPERVGUI_CanvasPortPrs* myPrs;
58 QValueList<SUPERVGUI_CanvasLink*> myLinks;
62 class SUPERVGUI_GetValueDlg;
63 class SUPERVGUI_CanvasPortIn : public SUPERVGUI_CanvasPort {
67 SUPERVGUI_CanvasPortIn(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
68 virtual ~SUPERVGUI_CanvasPortIn();
70 void setValue(const char* theValue);
72 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
78 bool eventFilter(QObject* o, QEvent* e);
81 SUPERVGUI_GetValueDlg* myDlg;
84 class SUPERVGUI_CanvasPortOut : public SUPERVGUI_CanvasPort {
88 SUPERVGUI_CanvasPortOut(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
89 virtual ~SUPERVGUI_CanvasPortOut();
92 bool isInStudy() const { return myInStudy; }
93 void setStudyState(bool theInStudy) { myInStudy = theInStudy; }
95 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
104 class SUPERVGUI_CanvasStreamPortIn : public SUPERVGUI_CanvasPortIn {
108 SUPERVGUI_CanvasStreamPortIn(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::StreamPort_ptr thePort);
109 virtual ~SUPERVGUI_CanvasStreamPortIn() {}
111 virtual bool isStream() const { return true; }
112 SUPERV_StreamPort getStreamEngine() const { return myStreamPort; }
114 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
120 SUPERV_StreamPort myStreamPort;
123 class SUPERVGUI_CanvasStreamPortOut : public SUPERVGUI_CanvasPortOut {
127 SUPERVGUI_CanvasStreamPortOut(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::StreamPort_ptr thePort);
128 virtual ~SUPERVGUI_CanvasStreamPortOut() {}
130 virtual bool isStream() const { return true; }
131 SUPERV_StreamPort getStreamEngine() const { return myStreamPort; }
133 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
139 SUPERV_StreamPort myStreamPort;