kivio

kivio_stencil_spawner_set.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_SET_H
00020 #define KIVIO_STENCIL_SPAWNER_SET_H
00021 
00022 #include <qptrlist.h>
00023 #include <qdom.h>
00024 
00025 class KivioStencilSpawner;
00026 class QStringList;
00027 
00028 class KivioStencilSpawnerSet
00029 {
00030   protected:
00031     QString m_dir;
00032     QString m_name;
00033     QString m_id;
00034 
00035     QStringList m_files;
00036 
00037     QPtrList<KivioStencilSpawner> *m_pSpawners;
00038     KivioStencilSpawner *m_pSelected;
00039 
00040     bool m_hidden;
00041 
00042   public:
00043     KivioStencilSpawnerSet(const QString& name=QString::null);
00044     virtual ~KivioStencilSpawnerSet();
00045 
00046     bool loadDir( const QString & );
00047     KivioStencilSpawner* loadFile( const QString & );
00048 
00049     bool loadXML( const QDomElement & );
00050     QDomElement saveXML( QDomDocument & );
00051 
00052     QPtrList<KivioStencilSpawner> *spawners() { return m_pSpawners; }
00053     KivioStencilSpawner *selected() { return m_pSelected; }
00054 
00055     QString dir() { return m_dir; }
00056     QString name() { return m_name; }
00057     QString id() { return m_id; }
00058 
00059     void setDir( const QString &s ) { m_dir=s; }
00060     void setName( const QString &s ) { m_name=s; }
00061     void setId( const QString &s ) { m_id=s; }
00062 
00063     KivioStencilSpawner *spawnerAt( int i ) { return m_pSpawners->at(i); }
00064     KivioStencilSpawner *find( const QString& );
00065 
00066     int count() { return m_pSpawners->count(); }
00067 
00068     static QString readTitle( const QString & );
00069     static QString readId( const QString & );
00070     static QString readDescription(const QString&);
00071 
00072     QStringList files() const { return m_files; }
00073 
00074     void addSpawner(KivioStencilSpawner* spawner);
00075 
00076     void setHidden(bool hide) { m_hidden = hide; }
00077     bool hidden() const { return m_hidden; }
00078 };
00079 
00080 #endif
00081 
00082 
KDE Home | KDE Accessibility Home | Description of Access Keys