kivio_dia_stencil_spawner.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2001 Nikolas Zimmermann <wildfox@kde.org>
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_DIA_STENCIL_SPAWNER_H
20#define KIVIO_DIA_STENCIL_SPAWNER_H
21
22#include <tqdom.h>
23#include <tqvaluelist.h>
24#include <tqptrlist.h>
25#include <tqstring.h>
26
27#include "kivio_connector_target.h"
28//#define protected public // ewww... what a gory hack
29#include "kivio_stencil_spawner.h"
30//#undef protected
31#include "kivio_sml_stencil_spawner.h"
32
33class KivioDiaStencilSpawner : public KivioStencilSpawner
34{
35 public:
36 KivioDiaStencilSpawner(KivioStencilSpawnerSet *);
37 virtual ~KivioDiaStencilSpawner();
38
39 virtual bool load(const TQString &file);
40 virtual bool loadXML(const TQString &file, TQDomDocument &d);
41
42 virtual TQDomElement saveXML(TQDomDocument &d);
43
44 virtual TQString &filename() { return m_filename; }
45
46 virtual KivioStencil *newStencil();
47
48 TQPtrList<KivioConnectorTarget> *targets() { return m_smlStencilSpawner->targets(); }
49
50 protected:
51 void calculateDimensions(float x, float y);
52 float diaPointToKivio(float point, bool xpoint);
53
54 KivioSMLStencilSpawner *m_smlStencilSpawner;
55 TQString m_filename;
56
57 TQValueList<float> m_xlist;
58 TQValueList<float> m_ylist;
59 float m_lowestx;
60 float m_lowesty;
61 float m_highestx;
62 float m_highesty;
63 float m_xscale;
64 float m_yscale;
65};
66
67#endif
68
69