kivio
kivio_connector_point.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KIVIO_CONNECTOR_POINT_H
00020 #define KIVIO_CONNECTOR_POINT_H
00021
00022 #include <qdom.h>
00023
00024 #include <KoPoint.h>
00025 #include <koffice_export.h>
00026 class KivioConnectorTarget;
00027 class KivioStencil;
00028
00029
00030 class KIVIO_EXPORT KivioConnectorPoint
00031 {
00032 protected:
00033
00034 KoPoint m_pos;
00035
00036
00037 KivioConnectorTarget *m_pTarget;
00038
00039
00040 KivioStencil *m_pStencil;
00041
00042 int m_targetId;
00043
00044 bool m_connectable;
00045
00046
00047 public:
00048 KivioConnectorPoint( KivioStencil *, bool conn=true );
00049 KivioConnectorPoint();
00050 virtual ~KivioConnectorPoint();
00051
00052 bool loadXML( const QDomElement & );
00053 QDomElement saveXML( QDomDocument & );
00054
00055 KivioConnectorTarget *target() const { return m_pTarget; }
00056 void setTarget( KivioConnectorTarget * );
00057
00058 KivioStencil *stencil() const { return m_pStencil; }
00059 void setStencil( KivioStencil *p ) { m_pStencil=p; }
00060
00061 void setTargetId( int i ) { m_targetId = i; }
00062 int targetId() const { return m_targetId; }
00063
00064 double x() const { return m_pos.x(); }
00065 double y() const { return m_pos.y(); }
00066 KoPoint position() const { return m_pos; }
00067
00068 void setX( double, bool updateStencil = true );
00069 void setY( double, bool updateStencil = true );
00070 void setPosition( double, double, bool updateStencil = true );
00071 void moveBy( double _x, double _y, bool updateStencil = true );
00072
00073 bool connectable() const { return m_connectable; }
00074 void setConnectable( bool b ) { m_connectable = b; if( b==false ) { disconnect(); } }
00075
00076 void disconnect(bool removeFromTargetList = true);
00077 bool isConnected();
00078 };
00079
00080 #endif
00081
|