filters

starwriterimport.h

00001 /*
00002    This file is part of the KDE project
00003    Copyright (C) 2002 Marco Zanon <info@marcozanon.com>
00004                   and Ariya Hidayat <ariya@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef __STARWRITERIMPORT_H
00023 #define __STARWRITERIMPORT_H
00024 
00025 #include <KoFilter.h>
00026 #include <qstring.h>
00027 #include <qcstring.h>
00028 
00029 class StarWriterImport: public KoFilter
00030 {
00031     Q_OBJECT
00032 
00033 public:
00034     StarWriterImport(KoFilter *parent, const char *name, const QStringList&);
00035     virtual ~StarWriterImport();
00036     KoFilter::ConversionStatus convert(const QCString& from, const QCString& to);
00037 
00038 private:
00039     // most important OLE streams
00040     QByteArray SwPageStyleSheets;
00041     QByteArray StarWriterDocument;
00042 
00043     // supplementary variables
00044     Q_UINT8 tablesNumber;
00045     QString bodyStuff, tablesStuff, picturesStuff;
00046 
00047     // needed for ATTRIBUTES
00048     bool hasHeader;
00049     bool hasFooter;
00050 
00051     // Preliminary check
00052     bool checkDocumentVersion();
00053 
00054     // Formatting routines
00055     bool addKWordHeader();
00056     bool addPageProperties();
00057     bool addStyles();
00058     bool addHeaders();
00059     bool addFooters();
00060     bool addBody();
00061     QString convertToKWordString(QByteArray s);
00062 
00063     // Node routines
00064     bool parseNodes(QByteArray n);
00065     bool parseText(QByteArray n);
00066     bool parseTable(QByteArray n);
00067     bool parseGraphics(QByteArray n);
00068 
00069     // finished KWord document
00070     QString maindoc;
00071 };
00072 
00073 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys