filters

starwriterimport.h
1/*
2 This file is part of the KDE project
3 Copyright (C) 2002 Marco Zanon <info@marcozanon.com>
4 and Ariya Hidayat <ariya@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21
22#ifndef __STARWRITERIMPORT_H
23#define __STARWRITERIMPORT_H
24
25#include <KoFilter.h>
26#include <tqstring.h>
27#include <tqcstring.h>
28
29class StarWriterImport: public KoFilter
30{
31 TQ_OBJECT
32
33
34public:
35 StarWriterImport(KoFilter *parent, const char *name, const TQStringList&);
36 virtual ~StarWriterImport();
37 KoFilter::ConversionStatus convert(const TQCString& from, const TQCString& to);
38
39private:
40 // most important OLE streams
41 TQByteArray SwPageStyleSheets;
42 TQByteArray StarWriterDocument;
43
44 // supplementary variables
45 TQ_UINT8 tablesNumber;
46 TQString bodyStuff, tablesStuff, picturesStuff;
47
48 // needed for ATTRIBUTES
49 bool hasHeader;
50 bool hasFooter;
51
52 // Preliminary check
53 bool checkDocumentVersion();
54
55 // Formatting routines
56 bool addKWordHeader();
57 bool addPageProperties();
58 bool addStyles();
59 bool addHeaders();
60 bool addFooters();
61 bool addBody();
62 TQString convertToKWordString(TQByteArray s);
63
64 // Node routines
65 bool parseNodes(TQByteArray n);
66 bool parseText(TQByteArray n);
67 bool parseTable(TQByteArray n);
68 bool parseGraphics(TQByteArray n);
69
70 // finished KWord document
71 TQString maindoc;
72};
73
74#endif