kivio
kivio_dia_stencil_spawner.h
00001 /* 00002 * Kivio - Visual Modelling and Flowcharting 00003 * Copyright (C) 2001 Nikolas Zimmermann <wildfox@kde.org> 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 #ifndef KIVIO_DIA_STENCIL_SPAWNER_H 00020 #define KIVIO_DIA_STENCIL_SPAWNER_H 00021 00022 #include <qdom.h> 00023 #include <qvaluelist.h> 00024 #include <qptrlist.h> 00025 #include <qstring.h> 00026 00027 #include "kivio_connector_target.h" 00028 //#define protected public // ewww... what a gory hack 00029 #include "kivio_stencil_spawner.h" 00030 //#undef protected 00031 #include "kivio_sml_stencil_spawner.h" 00032 00033 class KivioDiaStencilSpawner : public KivioStencilSpawner 00034 { 00035 public: 00036 KivioDiaStencilSpawner(KivioStencilSpawnerSet *); 00037 virtual ~KivioDiaStencilSpawner(); 00038 00039 virtual bool load(const QString &file); 00040 virtual bool loadXML(const QString &file, QDomDocument &d); 00041 00042 virtual QDomElement saveXML(QDomDocument &d); 00043 00044 virtual QString &filename() { return m_filename; } 00045 00046 virtual KivioStencil *newStencil(); 00047 00048 QPtrList<KivioConnectorTarget> *targets() { return m_smlStencilSpawner->targets(); } 00049 00050 protected: 00051 void calculateDimensions(float x, float y); 00052 float diaPointToKivio(float point, bool xpoint); 00053 00054 KivioSMLStencilSpawner *m_smlStencilSpawner; 00055 QString m_filename; 00056 00057 QValueList<float> m_xlist; 00058 QValueList<float> m_ylist; 00059 float m_lowestx; 00060 float m_lowesty; 00061 float m_highestx; 00062 float m_highesty; 00063 float m_xscale; 00064 float m_yscale; 00065 }; 00066 00067 #endif 00068 00069