kivio_base_target_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_TARGET_STENCIL_H
20#define KIVIO_BASE_TARGET_STENCIL_H
21
22#include <tqfont.h>
23#include <tqcolor.h>
24#include <tqdom.h>
25#include <tqptrlist.h>
26
27class KivioCustomDragData;
28class KivioConnectorPoint;
29class KivioConnectorTarget;
30class KivioFillStyle;
31class KivioIntraStencilData;
32class KivioLineStyle;
33class KivioPage;
34class KivioStencilSpawner;
35class KivioTextStyle;
36
37#include "kivio_stencil.h"
38
39
40class KivioBaseTargetStencil : public KivioStencil
41{
42protected:
43 KivioLineStyle *m_pLineStyle;
44 KivioFillStyle *m_pFillStyle;
45 KivioTextStyle *m_pTextStyle;
46
47 TQPtrList<KivioConnectorTarget> *m_pTargets;
48
49 virtual TQDomElement createRootElement( TQDomDocument & );
50
51 virtual bool saveCustom( TQDomElement &, TQDomDocument & );
52 virtual TQDomElement saveProperties( TQDomDocument & );
53 virtual TQDomElement saveTargets( TQDomDocument & );
54
55 virtual bool loadCustom( const TQDomElement & );
56 virtual bool loadProperties( const TQDomElement & );
57 virtual bool loadTargets( const TQDomElement & );
58
59 virtual void copyBasicInto( KivioBaseTargetStencil * );
60
61public:
62 KivioBaseTargetStencil();
63 virtual ~KivioBaseTargetStencil();
64
65 virtual KivioStencil *duplicate() { return NULL; }
66
67
69 //
70 // KivioLineStyle
71 //
73 virtual TQColor fgColor();
74 virtual void setFGColor( TQColor c );
75
76 virtual void setLineWidth( double l );
77 virtual double lineWidth();
78
79
80
82 //
83 // KivioFillStyle
84 //
86 virtual void setBGColor( TQColor c );
87 virtual TQColor bgColor();
88
89 virtual KivioFillStyle *fillStyle();
90
91
92
94 //
95 // KivioTextStyle
96 //
98 virtual TQColor textColor();
99 virtual void setTextColor( TQColor c );
100
101 virtual TQFont textFont();
102 virtual void setTextFont( const TQFont &f );
103
104 virtual int hTextAlign();
105 virtual int vTextAlign();
106
107 virtual void setHTextAlign(int a);
108 virtual void setVTextAlign(int a);
109
110 virtual void setText( const TQString &a );
111 virtual TQString text();
112
113
114
116 //
117 // Paint Routines
118 //
120 virtual void paint( KivioIntraStencilData * );
121 virtual void paintOutline( KivioIntraStencilData * );
122 virtual void paintConnectorTargets( KivioIntraStencilData * );
123
124
125
127 //
128 // File I/O
129 //
131 virtual bool loadXML( const TQDomElement & );
132 virtual TQDomElement saveXML( TQDomDocument & );
133
134
135
137 //
138 // Geometry
139 //
141 virtual void updateGeometry();
142
143
144
146 //
147 // Connection Routines
148 //
150 // This attempts to connect based on position
151 virtual KivioConnectorTarget *connectToTarget( KivioConnectorPoint *, double );
152
153 // This attempts to connect based on a targetID. This should ***ONLY*** be used
154 // right after a load
155 virtual KivioConnectorTarget *connectToTarget( KivioConnectorPoint *, int );
156
157
159 //
160 // ID Generation
161 //
163 virtual int generateIds( int );
164
165
166
167 virtual int resizeHandlePositions();
168};
169
170#endif
171
172