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();
52 virtual SUPERVGUI_CanvasPortPrs* createPrs() const;
56 SUPERVGUI_Main* myMain;
58 SUPERVGUI_CanvasPortPrs* myPrs;
59 QValueList<SUPERVGUI_CanvasLink*> myLinks;
63 class SUPERVGUI_GetValueDlg;
64 class SUPERVGUI_CanvasPortIn : public SUPERVGUI_CanvasPort {
68 SUPERVGUI_CanvasPortIn(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
69 virtual ~SUPERVGUI_CanvasPortIn();
71 void setValue(const char* theValue);
73 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
79 bool eventFilter(QObject* o, QEvent* e);
82 SUPERVGUI_GetValueDlg* myDlg;
85 class SUPERVGUI_CanvasPortOut : public SUPERVGUI_CanvasPort {
89 SUPERVGUI_CanvasPortOut(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort);
90 virtual ~SUPERVGUI_CanvasPortOut();
93 bool isInStudy() const { return myInStudy; }
94 void setStudyState(bool theInStudy) { myInStudy = theInStudy; }
96 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
105 class SUPERVGUI_CanvasStreamPortIn : public SUPERVGUI_CanvasPortIn {
109 SUPERVGUI_CanvasStreamPortIn(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::StreamPort_ptr thePort);
110 virtual ~SUPERVGUI_CanvasStreamPortIn() {}
112 virtual bool isStream() const { return true; }
113 SUPERV_StreamPort getStreamEngine() const { return myStreamPort; }
115 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
121 SUPERV_StreamPort myStreamPort;
124 class SUPERVGUI_CanvasStreamPortOut : public SUPERVGUI_CanvasPortOut {
128 SUPERVGUI_CanvasStreamPortOut(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::StreamPort_ptr thePort);
129 virtual ~SUPERVGUI_CanvasStreamPortOut() {}
131 virtual bool isStream() const { return true; }
132 SUPERV_StreamPort getStreamEngine() const { return myStreamPort; }
134 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
140 SUPERV_StreamPort myStreamPort;