sml_connector.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 SML_CONNECTOR_H
20#define SML_CONNECTOR_H
21
22
23#include "kivio_arrowhead.h"
24#include "kivio_connector_point.h"
25#include "kivio_custom_drag_data.h"
26#include "kivio_intra_stencil_data.h"
27#include "kiviostencilfactory.h"
28#include "kivio_text_style.h"
29#include "kivio_point.h"
30#include "kivio_stencil.h"
31
32class KivioPage;
33class KivioShape;
34#include <tqstringlist.h>
35#include <tqcolor.h>
36#include <tqdom.h>
37
38#include "kivio_1d_stencil.h"
39
40
41class KivioSMLConnector : public Kivio1DStencil
42{
43private:
44 bool loadPath(const TQString &file);
45 //void drawOpenPath( KivioShape *, KivioIntraStencilData * );
46 KivioShape *m_shape;
47 TQPtrList<KivioConnectorPoint> m_PointList;
48
49 TQString m_name;
50protected:
51
52 KivioArrowHead *m_startAH;
53 KivioArrowHead *m_endAH;
54
55 bool loadArrowHeads( const TQDomElement & );
56 TQDomElement saveArrowHeads( TQDomDocument & );
57 virtual bool loadCustom( const TQDomElement & );
58 virtual bool saveCustom( TQDomElement &, TQDomDocument & );
59
60public:
61 KivioSMLConnector(const TQString& name);
62 virtual ~KivioSMLConnector();
63
64 virtual void setStartPoint( double, double );
65 virtual void setEndPoint( double, double );
66
67 virtual KivioCollisionType checkForCollision( KivioPoint *, double );
68
69 virtual KivioStencil* duplicate();
70
71 virtual void paint( KivioIntraStencilData * );
72 virtual void paintOutline( KivioIntraStencilData * );
73
74
75
76
77 virtual void setStartAHType( int i ) { m_startAH->setType(i); }
78 virtual void setStartAHWidth( double f ) { m_startAH->setWidth(f); }
79 virtual void setStartAHLength( double f ) { m_startAH->setLength(f); }
80 virtual void setEndAHType( int i ) { m_endAH->setType(i); }
81 virtual void setEndAHWidth( double f ) { m_endAH->setWidth(f); }
82 virtual void setEndAHLength( double f ) { m_endAH->setLength(f); }
83
84 virtual int startAHType() { return m_startAH->type(); }
85 virtual double startAHWidth() { return m_startAH->width(); }
86 virtual double startAHLength() { return m_startAH->length(); }
87 virtual int endAHType() { return m_endAH->type(); }
88 virtual double endAHWidth() { return m_endAH->width(); }
89 virtual double endAHLength() { return m_endAH->length(); }
90
91};
92
93class KivioSMLConnectorFactory : public KivioStencilFactory
94{
95 TQ_OBJECT
96
97 public:
98 KivioSMLConnectorFactory(TQObject *parent=0, const char* name=0, const TQStringList& args = TQStringList());
99 KivioStencil *NewStencil(const TQString& name);
100 KivioStencil *NewStencil();
101 TQPixmap *GetIcon();
102 KivioStencilSpawnerInfo *GetSpawnerInfo();
103};
104#endif
105