kivio_stencil_spawner_set.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 KIVIO_STENCIL_SPAWNER_SET_H
20#define KIVIO_STENCIL_SPAWNER_SET_H
21
22#include <tqptrlist.h>
23#include <tqdom.h>
24
25class KivioStencilSpawner;
26class TQStringList;
27
28class KivioStencilSpawnerSet
29{
30 protected:
31 TQString m_dir;
32 TQString m_name;
33 TQString m_id;
34
35 TQStringList m_files;
36
37 TQPtrList<KivioStencilSpawner> *m_pSpawners;
38 KivioStencilSpawner *m_pSelected;
39
40 bool m_hidden;
41
42 public:
43 KivioStencilSpawnerSet(const TQString& name=TQString());
44 virtual ~KivioStencilSpawnerSet();
45
46 bool loadDir( const TQString & );
47 KivioStencilSpawner* loadFile( const TQString & );
48
49 bool loadXML( const TQDomElement & );
50 TQDomElement saveXML( TQDomDocument & );
51
52 TQPtrList<KivioStencilSpawner> *spawners() { return m_pSpawners; }
53 KivioStencilSpawner *selected() { return m_pSelected; }
54
55 TQString dir() { return m_dir; }
56 TQString name() { return m_name; }
57 TQString id() { return m_id; }
58
59 void setDir( const TQString &s ) { m_dir=s; }
60 void setName( const TQString &s ) { m_name=s; }
61 void setId( const TQString &s ) { m_id=s; }
62
63 KivioStencilSpawner *spawnerAt( int i ) { return m_pSpawners->at(i); }
64 KivioStencilSpawner *find( const TQString& );
65
66 int count() { return m_pSpawners->count(); }
67
68 static TQString readTitle( const TQString & );
69 static TQString readId( const TQString & );
70 static TQString readDescription(const TQString&);
71
72 TQStringList files() const { return m_files; }
73
74 void addSpawner(KivioStencilSpawner* spawner);
75
76 void setHidden(bool hide) { m_hidden = hide; }
77 bool hidden() const { return m_hidden; }
78};
79
80#endif
81
82