kword

KWOasisSaver.h
1/* This file is part of the KDE project
2 Copyright (C) 2005 David Faure <faure@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17*/
18
19#ifndef KWOASISSAVER_H
20#define KWOASISSAVER_H
21
22#include <tqbuffer.h>
23#include <KoGenStyles.h>
24#include <KoOasisStore.h>
25
26class KWDocument;
27class KoSavingContext;
28class KoXmlWriter;
29class KoTextParag;
30class KoStore;
31template <class T> class TQValueList;
32
40{
41public:
43 KWOasisSaver( KWDocument* doc );
45
47 void saveParagraphs( const TQValueList<const KoTextParag *>& paragraphs );
48
50 void saveParagraph( const KoTextParag* parag );
51
54 KoXmlWriter& bodyWriter() { return *m_oasisStore->bodyWriter(); }
55 KoSavingContext& savingContext() { return *m_savingContext; }
56
59 bool finish();
60
62 TQByteArray data() const;
63
65 static void writeAutomaticStyles( KoXmlWriter& contentWriter, KoGenStyles& mainStyles, bool stylesDotXml );
66
67 static const char* selectionMimeType();
68
69private:
70 TQBuffer m_buffer;
71 KoStore* m_store;
72 KoOasisStore* m_oasisStore;
73 KoGenStyles m_mainStyles;
74 KoSavingContext* m_savingContext;
75 KWDocument* m_doc;
76};
77
78#endif
KWOasisSaver(KWDocument *doc)
TQByteArray data() const
Return the entire ZIP store as a byte array.
KoXmlWriter & bodyWriter()
Another way to save paragraphs is to use KoTextObject::saveOasisContent It needs a body writer and a ...
void saveParagraph(const KoTextParag *parag)
Save a paragraph.
bool finish()
You MUST call this after saving the paragraphs and before calling data() Return true on success.
static void writeAutomaticStyles(KoXmlWriter &contentWriter, KoGenStyles &mainStyles, bool stylesDotXml)
Helper function, also used by KWDocument.
void saveParagraphs(const TQValueList< const KoTextParag * > &paragraphs)
Save a list of paragraphs.