00001
00004 #ifndef SXCONNECTION_H_INCLUDED
00005 #define SXCONNECTION_H_INCLUDED
00006
00007 #include "sxObject.h"
00008
00009 class sxPort;
00010 class sxInPort;
00011 class sxOutPort;
00012
00016 class SX_SDKEXPORT sxConnection : public sxCaptionItem
00017 {
00018 public:
00019 virtual ~sxConnection();
00020
00021 sxConnection(const QString& cap = QString(),
00022 sxPort * p1 = 0, sxPort * p2 = 0);
00023
00024 QString ConnectionId() const;
00025 bool IsFloating() const;
00026 bool IsConnected() const;
00027
00028 sxPort * OtherPort(sxPort * theP) const;
00029 sxOutPort * Source() const;
00030 sxInPort * Destination() const;
00031 void SetPort(sxPort * p);
00032 bool Connect();
00033 bool Connect(sxPort * p1, sxPort * p2);
00034 void Disconnect();
00035 void RemovePorts();
00036
00037
00038 bool Save(QDomElement & consNode);
00039 bool Load(const QDomElement & conNode, const QList<sxPort *> & portList);
00040 protected:
00041 void SetConnectionId(quintptr id);
00042 virtual bool SaveGui(QDomElement & conNode);
00043 virtual bool LoadGui(const QDomElement & conNode);
00044 private:
00045 SX_DISABLE_COPY(sxConnection)
00046
00047
00048 class PrivateData;
00049 PrivateData * d_p;
00050 };
00051
00052 #endif // SXCONNECTION_H_INCLUDED