kword

KWOasisSaver.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 
00019 #ifndef KWOASISSAVER_H
00020 #define KWOASISSAVER_H
00021 
00022 #include <qbuffer.h>
00023 #include <KoGenStyles.h>
00024 #include <KoOasisStore.h>
00025 
00026 class KWDocument;
00027 class KoSavingContext;
00028 class KoXmlWriter;
00029 class KoTextParag;
00030 class KoStore;
00031 template <class T> class QValueList;
00032 
00039 class KWOasisSaver
00040 {
00041 public:
00043     KWOasisSaver( KWDocument* doc );
00044     ~KWOasisSaver();
00045 
00047     void saveParagraphs( const QValueList<const KoTextParag *>& paragraphs );
00048 
00050     void saveParagraph( const KoTextParag* parag );
00051 
00054     KoXmlWriter& bodyWriter() { return *m_oasisStore->bodyWriter(); }
00055     KoSavingContext& savingContext() { return *m_savingContext; }
00056 
00059     bool finish();
00060 
00062     QByteArray data() const;
00063 
00065     static void writeAutomaticStyles( KoXmlWriter& contentWriter, KoGenStyles& mainStyles, bool stylesDotXml );
00066 
00067     static const char* selectionMimeType();
00068 
00069 private:
00070     QBuffer m_buffer;
00071     KoStore* m_store;
00072     KoOasisStore* m_oasisStore;
00073     KoGenStyles m_mainStyles;
00074     KoSavingContext* m_savingContext;
00075     KWDocument* m_doc;
00076 };
00077 
00078 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys