lib Library API Documentation

koPictureCollection.h

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., 59 Temple Place - Suite 330,
00019    Boston, MA 02111-1307, USA.
00020 */
00021 
00022 #ifndef koPictureCollection_h
00023 #define koPictureCollection_h
00024 
00025 #include <qmap.h>
00026 #include <qdom.h>
00027 #include <qvaluelist.h>
00028 
00029 #include "koPicture.h"
00030 
00031 class KURL;
00032 
00033 class KoStore;
00034 class KoXmlWriter;
00035 
00040 class KOFFICECORE_EXPORT KoPictureCollection : public QMap<KoPictureKey, KoPicture>
00041 {
00042 public:
00043     enum Type {
00045         CollectionPicture=0,
00047         CollectionImage,
00049         CollectionClipart
00050     };
00051 
00055     KoPicture findPicture( const KoPictureKey &key ) const;
00056 
00060     KoPicture insertPicture( const KoPictureKey& key, const KoPicture& picture );
00061 
00066     KoPicture insertPicture( const KoPicture& picture );
00067 
00077     KoPicture downloadPicture(const KURL& url, QWidget *window);
00078 
00086     KoPicture loadPicture( const QString &fileName );
00087 
00096     bool saveToStore(const Type pictureType, KoStore * store, QValueList<KoPictureKey> keys );
00097 
00105     bool saveToStoreAsKOffice1Dot1(const Type pictureType, KoStore * store, QValueList<KoPictureKey> keys );
00106 
00115     QDomElement saveXML(const Type pictureType, QDomDocument &doc,
00116         QValueList<KoPictureKey> keys );
00117 
00118     void saveXMLAsKOffice1Dot1(QDomDocument &doc, QDomElement& parent, QValueList<KoPictureKey> keys);
00119 
00120     bool saveOasisToStore( KoStore *store, QValueList<KoPictureKey> keys, KoXmlWriter* manifestWriter );
00121 
00122 
00123     typedef QMap<KoPictureKey, QString> StoreMap;
00131     StoreMap readXML( QDomElement &pixmapsElem );
00132 
00136     void readXML( QDomElement& pixmapsElem, QMap <KoPictureKey, QString>& map );
00137 
00143     void readFromStore( KoStore * store, const StoreMap & storeMap );
00144 
00155     KoPicture findOrLoad(const QString& fileName, const QDateTime& dateTime);
00156 
00161     QString getOasisFileName(const KoPicture& picture) const;
00162 
00166     void assignUniqueIds();
00167 
00168 
00169 private:
00173     QString getFileName(const Type pictureType, KoPicture& picture, int& counter);
00174 
00178     QString getFileNameAsKOffice1Dot1(const Type pictureType, KoPicture& picture, int& counter);
00179 
00183     bool saveToStoreInternal(const Type pictureType, KoStore *store,
00184                              QValueList<KoPictureKey>& keys, const bool koffice11);
00185 
00186     class Private;
00187     Private* d;
00188 };
00189 
00190 #endif /* __koPictureCollection_h_- */
KDE Logo
This file is part of the documentation for lib Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:40:04 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003