filters

oodrawimport.h
1/* This file is part of the KDE project
2 Copyright (c) 2003 Rob Buis <buis@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 OODRAW_IMPORT_H__
21#define OODRAW_IMPORT_H__
22
23#include <KoFilter.h>
24#include <KoStore.h>
25
26#include <tqdom.h>
27#include <tqdict.h>
28#include <tqcolor.h>
29#include <KoStyleStack.h>
30#include <core/vdocument.h>
31#include <core/vcomposite.h>
32#include <core/vstroke.h>
33
34class KZip;
35
36class VGroup;
37
38class OoDrawImport : public KoFilter
39{
40 TQ_OBJECT
41
42public:
43 OoDrawImport( KoFilter *parent, const char *name, const TQStringList & );
44 virtual ~OoDrawImport();
45
46 virtual KoFilter::ConversionStatus convert( TQCString const & from, TQCString const & to );
47
48private:
49 void createDocumentInfo( TQDomDocument &docinfo );
50
51 void createStyleMap( TQDomDocument &docstyles );
52 void insertStyles( const TQDomElement& styles );
53 void insertDraws( const TQDomElement& styles );
54 void fillStyleStack( const TQDomElement& object );
55 void addStyles( const TQDomElement* style );
56 void storeObjectStyles( const TQDomElement& object );
57 void appendPen( VObject &obj );
58 void appendBrush( VObject &obj );
59 void appendPoints(VPath &path, const TQDomElement& object);
60 void convert();
61 void parseGroup( VGroup *parent, const TQDomElement& object );
62 void parseColor( VColor &color, const TQString &s );
63 double ymirror( double y );
64 KoRect parseViewBox( const TQDomElement& object );
65
66 KoFilter::ConversionStatus openFile();
67 KoFilter::ConversionStatus loadAndParse(const TQString& filename, TQDomDocument& doc);
68
69 VDocument m_document;
70 TQDomDocument m_content;
71 TQDomDocument m_meta;
72 TQDomDocument m_settings;
73 TQDict<TQDomElement> m_styles, m_draws;
74 KoStyleStack m_styleStack;
75 KZip * m_zip;
76
77};
78
79#endif