kivio_connector_target.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#ifndef KIVIO_CONNECTOR_TARGET_H
20#define KIVIO_CONNECTOR_TARGET_H
21
22#include <tqdom.h>
23#include <tqptrlist.h>
24
25#include <KoPoint.h>
26
27class KivioIntraStencilData;
28class KivioPainter;
29class KivioStencil;
30class KivioConnectorPoint;
31
32class KivioConnectorTarget
33{
34protected:
35 KoPoint m_position;
36 double m_xOffset, m_yOffset;
37 int m_id;
38 TQPtrList<KivioConnectorPoint> *m_pConnectors;
39
40public:
41 KivioConnectorTarget();
42 KivioConnectorTarget( double, double );
43 KivioConnectorTarget( double, double, double, double );
44 virtual ~KivioConnectorTarget();
45
46 bool loadXML( const TQDomElement & );
47 TQDomElement saveXML( TQDomDocument & );
48
49 KivioConnectorTarget *duplicate();
50
51 inline float x() { return m_position.x(); }
52 inline float y() { return m_position.y(); }
53 inline KoPoint position() { return m_position; }
54
55 void setId( int id );
56 inline int id() { return m_id; }
57
58 void setX( float );
59 void setY( float );
60 void setPosition( float, float );
61
62 void addConnectorPointToList( KivioConnectorPoint * );
63 bool removeConnectorPointFromList( KivioConnectorPoint * );
64
65 void paintOutline( KivioIntraStencilData * );
66
67 void disconnectPoint( KivioConnectorPoint * );
68
69 bool hasConnections();
70
71 void setOffsets(double x, double y);
72 double xOffset() { return m_xOffset; }
73 double yOffset() { return m_yOffset; }
74};
75
76#endif
77