kivio

kivio_base_connector_stencil.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_BASE_CONNECTOR_STENCIL_H
20#define KIVIO_BASE_CONNECTOR_STENCIL_H
21
22#ifdef HAVE_CONFIG_H
23#include <config.h>
24#endif
25
26#include <tqdom.h>
27#include <tqptrlist.h>
28
29#include "kivio_stencil.h"
30
31class KivioArrowHead;
32class KivioConnectorPoint;
33class KivioCustomDragData;
34class KivioFillStyle;
35class KivioLineStyle;
36class KivioIntraStencilData;
37class KivioStencil;
38
39class KivioBaseConnectorStencil : public KivioStencil
40{
41protected:
42 TQPtrList <KivioConnectorPoint> *m_pConnectorPoints;
43
44 KivioFillStyle *m_pFillStyle;
45 KivioLineStyle *m_pLineStyle;
46
47
48 // Utility routines
49 bool boolAllTrue( bool *, int );
50 bool boolContainsFalse( bool *, int );
51
52 TQDomElement saveConnectors( TQDomDocument &doc );
53 bool loadConnectors( const TQDomElement & );
54
55 TQDomElement saveProperties( TQDomDocument &doc );
56 bool loadProperties( const TQDomElement & );
57
58public:
59 KivioBaseConnectorStencil();
60 virtual ~KivioBaseConnectorStencil();
61
62 // fg color functions
63 virtual void setFGColor( TQColor c );
64 virtual TQColor fgColor();
65
66
67 // bg color functions
68 virtual void setBGColor( TQColor c );
69 virtual TQColor bgColor();
70
71
72 // line width functions
73 virtual void setLineWidth( double f );
74 virtual double lineWidth();
75
76
77 // position functions
78 virtual void setX( double );
79 virtual void setY( double );
80 virtual void setPosition( double, double );
81
82
83 // required for connector tool
84 virtual void setStartPoint( double, double );
85 virtual void setEndPoint( double, double );
86
87
88 // painting functions
89 virtual void paint( KivioIntraStencilData * );
90 virtual void paintOutline( KivioIntraStencilData * );
91 virtual void paintConnectorTargets( KivioIntraStencilData * );
92 virtual void paintSelectionHandles( KivioIntraStencilData * );
93
94
95 // collision detection
96 virtual KivioCollisionType checkForCollision( KoPoint *, double );
97
98
99 // custom dragging
100 virtual void customDrag( KivioCustomDragData * );
101
102
103 // geometry management
104 virtual void updateGeometry();
105
106
107 // file i/o routines
108 virtual bool loadXML( const TQDomElement & );
109 virtual TQDomElement saveXML( TQDomDocument & );
110
111
112 // duplication routines
113 virtual KivioStencil* duplicate();
114
115
116 // connection search routines
117 virtual void searchForConnections( KivioPage * );
118
119
120 // returns which resize handles are valid
121 virtual int resizeHandlePositions();
122
123};
124
125#endif
126