filters

kword13oasisgenerator.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Nicolas GOUTTE <goutte@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 as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KWORD_1_3_OASIS_GENERATOR
21#define KWORD_1_3_OASIS_GENERATOR
22
23#define STRICT_OOWRITER_VERSION_1
24
25class TQString;
26class TQTextStream;
27class KZip;
28class KoStore;
29class KoGenStyle;
30class KoXmlWriter;
31class KWord13Document;
32
33#include <KoGenStyles.h>
34
35class KWord13OasisGenerator
36{
37public:
38 KWord13OasisGenerator( void );
39 ~KWord13OasisGenerator( void );
40
41 bool prepare( KWord13Document& kwordDocument );
42 bool generate( const TQString& fileName, KWord13Document& kwordDocument );
43protected: // Generating phase
45 void generateTextFrameset( KoXmlWriter& writer, KWordTextFrameset* frameset, bool main );
46 void writeStylesXml( void );
47 void writeContentXml( void );
48 void writeMetaXml( void );
49 void writePreviewFile(void);
50 void writePictures( void );
51protected: // Preparing phase
53 void preparePageLayout( void );
54 void prepareTextFrameset( KWordTextFrameset* frameset );
56 void declareLayout( KWord13Layout& layout );
58 void declareStyle( KWord13Layout& layout );
59 double numberOrNull( const TQString& str ) const;
60 double positiveNumberOrNull( const TQString& str ) const;
61 void fillGenStyleWithFormatOne( const KWord13FormatOneData& one, KoGenStyle& gs, const bool style ) const;
62 void fillGenStyleWithLayout( const KWord13Layout& layout, KoGenStyle& gs, const bool style ) const;
63protected:
64 KWord13Document* m_kwordDocument;
65 KoStore* m_store;
66 TQString m_contentAutomaticStyles;
67 KoGenStyles m_oasisGenStyles;
68 KoXmlWriter* m_manifestWriter;
69};
70
71#endif // KWORD_1_3_OASIS_GENERATOR