filters
kword13oasisgenerator.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2004 Nicolas GOUTTE <goutte@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 as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KWORD_1_3_OASIS_GENERATOR 00021 #define KWORD_1_3_OASIS_GENERATOR 00022 00023 #define STRICT_OOWRITER_VERSION_1 00024 00025 class QString; 00026 class QTextStream; 00027 class KZip; 00028 class KoStore; 00029 class KoGenStyle; 00030 class KoXmlWriter; 00031 class KWord13Document; 00032 00033 #include <KoGenStyles.h> 00034 00035 class KWord13OasisGenerator 00036 { 00037 public: 00038 KWord13OasisGenerator( void ); 00039 ~KWord13OasisGenerator( void ); 00040 00041 bool prepare( KWord13Document& kwordDocument ); 00042 bool generate( const QString& fileName, KWord13Document& kwordDocument ); 00043 protected: // Generating phase 00045 void generateTextFrameset( KoXmlWriter& writer, KWordTextFrameset* frameset, bool main ); 00046 void writeStylesXml( void ); 00047 void writeContentXml( void ); 00048 void writeMetaXml( void ); 00049 void writePreviewFile(void); 00050 void writePictures( void ); 00051 protected: // Preparing phase 00053 void preparePageLayout( void ); 00054 void prepareTextFrameset( KWordTextFrameset* frameset ); 00056 void declareLayout( KWord13Layout& layout ); 00058 void declareStyle( KWord13Layout& layout ); 00059 double numberOrNull( const QString& str ) const; 00060 double positiveNumberOrNull( const QString& str ) const; 00061 void fillGenStyleWithFormatOne( const KWord13FormatOneData& one, KoGenStyle& gs, const bool style ) const; 00062 void fillGenStyleWithLayout( const KWord13Layout& layout, KoGenStyle& gs, const bool style ) const; 00063 protected: 00064 KWord13Document* m_kwordDocument; 00065 KoStore* m_store; 00066 QString m_contentAutomaticStyles; 00067 KoGenStyles m_oasisGenStyles; 00068 KoXmlWriter* m_manifestWriter; 00069 }; 00070 00071 #endif // KWORD_1_3_OASIS_GENERATOR