kivio

kivio_stencil_spawner.h

00001 /*
00002  * Kivio - Visual Modelling and Flowcharting
00003  * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
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_STENCIL_SPAWNER_H
00020 #define KIVIO_STENCIL_SPAWNER_H
00021 
00022 #include <qstring.h>
00023 #include <qpixmap.h>
00024 #include <qdom.h>
00025 #include <qobject.h>
00026 
00027 class QPainter;
00028 class QRect;
00029 class KivioStencilSpawnerInfo;
00030 class KivioStencilSpawnerSet;
00031 class KivioStencil;
00032 
00033 class KivioStencilSpawner
00034 {
00035 protected:
00036     QString m_fileName;
00037     QPixmap m_icon;
00038     KivioStencilSpawnerSet *m_pSet;
00039     KivioStencilSpawnerInfo *m_pInfo;
00040 
00041     // Default width and height
00042     float m_defWidth, m_defHeight;
00043 
00044 public:
00045     KivioStencilSpawner( KivioStencilSpawnerSet * );
00046     virtual ~KivioStencilSpawner();
00047 
00048     virtual bool load( const QString & );
00049     virtual bool loadXML( const QString &, QDomDocument & );
00050     virtual QDomElement saveXML( QDomDocument & );
00051 
00052     virtual KivioStencil *newStencil();
00053     virtual KivioStencil *newStencil(const QString& args);
00054 
00055     virtual QString fileName() { return m_fileName; }
00056     virtual KivioStencilSpawnerSet *set() { return m_pSet; }
00057     virtual KivioStencilSpawnerInfo *info() { return m_pInfo; }
00058 
00059     virtual float defWidth() { return m_defWidth; }
00060     virtual float defHeight() { return m_defHeight; }
00061 
00062     virtual QPixmap *icon() { return &m_icon; }
00063 
00064 
00065 //    virtual void drawIcon( QPainter *, QRect *, bool );
00066 };
00067 
00068 #endif
00069 
00070 
KDE Home | KDE Accessibility Home | Description of Access Keys