00001 #ifndef SXUICONNECTION_H_INCLUDED
00002 #define SXUICONNECTION_H_INCLUDED
00003
00004 #include <QGraphicsItem>
00005 #include "sxConnection.h"
00006
00007 class UiConnectionPrivate;
00011 class SX_GUISDKEXPORT sxUiConnection : public sxConnection, public QAbstractGraphicsShapeItem
00012 {
00013 UiConnectionPrivate * d;
00014
00015 void AdjustTextPosition(const QPointF& pt1, const QPointF& pt2);
00016 protected:
00017
00018 virtual bool SaveGui(QDomElement & conNode);
00019 virtual bool LoadGui(const QDomElement & conNode);
00020 void mouseDoubleClickEvent ( QGraphicsSceneMouseEvent * event );
00021 public:
00022 enum {
00023 CubicLine = 0,
00024 StraightLine,
00025 MultipleLine,
00026
00027 LineModeCount
00028 };
00029 sxUiConnection();
00030 explicit sxUiConnection(sxPort * term);
00031 virtual ~sxUiConnection();
00032
00033 void Adjust();
00034 void SetTemporaryPoint(const QPointF &pt);
00035 void SetTerminal(sxPort * port);
00036 QFont Font() const;
00037 void SetFont(const QFont& f);
00038 int LineMode() const;
00039 void SetLineMode(int mode);
00040
00041
00042 QRectF boundingRect() const;
00043 QPainterPath shape() const;
00044
00045 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
00046
00047 QPainterPath opaqueArea() const;
00048
00049 enum { TYPE = UserType + 2 };
00050 int type() const;
00051
00052
00053 };
00054
00055
00056 #endif // SXUICONNECTION_H_INCLUDED