00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef koPictureCollection_h
00023 #define koPictureCollection_h
00024
00025 #include <QMap>
00026 #include <QDomDocument>
00027 #include <QDomElement>
00028 #include <q3valuelist.h>
00029
00030 #include "KoPicture.h"
00031
00032 class KUrl;
00033
00034 class KoStore;
00035 class KoXmlWriter;
00036
00041 class KOFFICECORE_EXPORT KoPictureCollection : public QMap<KoPictureKey, KoPicture>
00042 {
00043 public:
00044 enum Type {
00046 CollectionPicture=0,
00048 CollectionImage,
00050 CollectionClipart
00051 };
00052
00056 KoPicture findPicture( const KoPictureKey &key ) const;
00057
00061 KoPicture insertPicture( const KoPictureKey& key, const KoPicture& picture );
00062
00067 KoPicture insertPicture( const KoPicture& picture );
00068
00078 KoPicture downloadPicture(const KUrl& url, QWidget *window);
00079
00087 KoPicture loadPicture( const QString &fileName );
00088
00100 bool saveToStore(const Type pictureType, KoStore * store, const Q3ValueList<KoPictureKey>& keys );
00101
00110 QDomElement saveXML(const Type pictureType, QDomDocument &doc,
00111 Q3ValueList<KoPictureKey> keys );
00112
00113 bool saveOasisToStore( KoStore *store, Q3ValueList<KoPictureKey> keys, KoXmlWriter* manifestWriter );
00114
00115
00116 typedef QMap<KoPictureKey, QString> StoreMap;
00124 StoreMap readXML( QDomElement &pixmapsElem );
00125
00129 void readXML( QDomElement& pixmapsElem, QMap <KoPictureKey, QString>& map );
00130
00136 void readFromStore( KoStore * store, const StoreMap & storeMap );
00137
00148 KoPicture findOrLoad(const QString& fileName, const QDateTime& dateTime);
00149
00154 QString getOasisFileName(const KoPicture& picture) const;
00155
00159 void assignUniqueIds();
00160
00161
00162 private:
00166 QString getFileName(const Type pictureType, KoPicture& picture, int& counter);
00167
00168 class Private;
00169 Private* d;
00170 };
00171
00172 #endif