lib

KoOasisStore.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 David Faure <faure@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016  * Boston, MA 02110-1301, USA.
00017 */
00018 #ifndef KOOASISSTORE_H
00019 #define KOOASISSTORE_H
00020 
00021 class QString;
00022 class QDomDocument;
00023 class KTempFile;
00024 class KoXmlWriter;
00025 class KoStore;
00026 class KoStoreDevice;
00027 class QIODevice;
00028 
00049 #include <koffice_export.h>
00050 
00051 class KOFFICECORE_EXPORT KoOasisStore
00052 {
00053 public:
00055     KoOasisStore( KoStore* store );
00056 
00057     ~KoOasisStore();
00058 
00059     KoStore* store() const { return m_store; }
00060 
00062     KoXmlWriter* contentWriter();
00063 
00066     KoXmlWriter* bodyWriter();
00067 
00071     bool closeContentWriter();
00072 
00073     // For other files in the store, use open/addManifestEntry/KoStoreDevice/createOasisXmlWriter/close
00074 
00076     KoXmlWriter* manifestWriter( const char* mimeType );
00077 
00079     bool closeManifestWriter();
00080 
00082     bool loadAndParse( const QString& fileName, QDomDocument& doc, QString& errorMessage );
00083 
00085     static QString mimeForPath( const QDomDocument& doc, const QString& fullPath );
00086 
00087 private:
00088     KoStore* m_store;
00089     KoStoreDevice* m_storeDevice;
00090     KoXmlWriter* m_contentWriter;
00091     KoXmlWriter* m_bodyWriter;
00092     KoXmlWriter* m_manifestWriter;
00093     KTempFile* m_contentTmpFile;
00094 };
00095 
00096 #endif /* KOOASISSTORE_H */
KDE Home | KDE Accessibility Home | Description of Access Keys