F:/KPlato/koffice/libs/kofficecore/KoPictureCollection.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00003    Copyright (c) 2001 David Faure <faure@kde.org>
00004    Copyright (C) 2002 Nicolas GOUTTE <goutte@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
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 /* __koPictureCollection_h_- */

Généré le Wed Nov 22 23:41:03 2006 pour KPlato par  doxygen 1.5.1-p1