KoPictureCollection.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3 Copyright (c) 2001 David Faure <faure@kde.org>
4 Copyright (C) 2002 Nicolas GOUTTE <goutte@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21
22#ifndef koPictureCollection_h
23#define koPictureCollection_h
24
25#include <tqmap.h>
26#include <tqdom.h>
27#include <tqvaluelist.h>
28
29#include "KoPicture.h"
30
31class KURL;
32
33class KoStore;
34class KoXmlWriter;
35
40class KOFFICECORE_EXPORT KoPictureCollection : public TQMap<KoPictureKey, KoPicture>
41{
42public:
43 enum Type {
45 CollectionPicture=0,
49 CollectionClipart
50 };
51
55 KoPicture findPicture( const KoPictureKey &key ) const;
56
60 KoPicture insertPicture( const KoPictureKey& key, const KoPicture& picture );
61
66 KoPicture insertPicture( const KoPicture& picture );
67
77 KoPicture downloadPicture(const KURL& url, TQWidget *window);
78
86 KoPicture loadPicture( const TQString &fileName );
87
99 bool saveToStore(const Type pictureType, KoStore * store, const TQValueList<KoPictureKey>& keys );
100
109 TQDomElement saveXML(const Type pictureType, TQDomDocument &doc,
110 TQValueList<KoPictureKey> keys );
111
112 bool saveOasisToStore( KoStore *store, TQValueList<KoPictureKey> keys, KoXmlWriter* manifestWriter );
113
114
115 typedef TQMap<KoPictureKey, TQString> StoreMap;
123 StoreMap readXML( TQDomElement &pixmapsElem );
124
128 void readXML( TQDomElement& pixmapsElem, TQMap <KoPictureKey, TQString>& map );
129
135 void readFromStore( KoStore * store, const StoreMap & storeMap );
136
147 KoPicture findOrLoad(const TQString& fileName, const TQDateTime& dateTime);
148
153 TQString getOasisFileName(const KoPicture& picture) const;
154
158 void assignUniqueIds();
159
160
161private:
165 TQString getFileName(const Type pictureType, KoPicture& picture, int& counter);
166
167 class Private;
168 Private* d;
169};
170
171#endif /* __koPictureCollection_h_- */
A collection of pictures (a key and the picture itself).
@ CollectionImage
collection with images only
KoPictureKey is the structure describing a picture in a unique way.
KoPicture is a container class for various types of pictures supported by KOffice.
Definition KoPicture.h:44
Saves and loads KOffice documents using various backends.
Definition KoStore.h:40
A class for writing out XML (to any TQIODevice), with a special attention on performance.
Definition KoXmlWriter.h:37