00001 #ifndef SXUIPORT_H_INCLUDED 00002 #define SXUIPORT_H_INCLUDED 00003 00004 #include <QGraphicsItem> 00005 #include "sxPort.h" 00006 00007 00008 class sxUiTextItem; 00009 00013 class SX_GUISDKEXPORT sxUiPort : public QGraphicsPolygonItem 00014 { 00015 public: 00016 enum Placement { 00017 North = 0, 00018 East, 00019 South, 00020 West 00021 }; 00022 virtual ~sxUiPort(); 00023 void AdjustTextPosition(const QString& cap, sxObject * obj); 00024 void SetLocation(Placement loc); 00025 Placement Location() const; 00026 virtual void AdjustConnections(); 00027 QFont Font() const; 00028 void SetFont(const QFont & f); 00029 00030 protected: 00031 Placement xLocation; 00032 sxUiTextItem * xText; 00033 00034 void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); 00035 void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ); 00036 sxUiPort(Placement loc); 00037 }; 00038 00042 class SX_GUISDKEXPORT sxUiInPort : public sxInPort, public sxUiPort 00043 { 00044 public: 00045 sxUiInPort(const QString& cap = QString(), sxComponent * comp = 0); 00046 virtual ~sxUiInPort(); 00047 QVariant itemChange(GraphicsItemChange change, const QVariant &value); 00048 00049 sxConnection * MakeConnection(sxPort * with, const QString& name); 00050 void AdjustConnections(); 00051 }; 00052 00056 class SX_GUISDKEXPORT sxUiOutPort : public sxOutPort, public sxUiPort 00057 { 00058 public: 00059 sxUiOutPort(const QString& cap = QString(), sxComponent * comp = 0); 00060 ~sxUiOutPort(); 00061 QVariant itemChange(GraphicsItemChange change, const QVariant &value); 00062 00063 sxConnection * MakeConnection(sxPort * with, const QString& name); 00064 void AdjustConnections(); 00065 }; 00066 00067 00068 #endif // SXUIPORT_H_INCLUDED