filters

oodrawimport.h

00001 /* This file is part of the KDE project
00002    Copyright (c) 2003 Rob Buis <buis@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 OODRAW_IMPORT_H__
00021 #define OODRAW_IMPORT_H__
00022 
00023 #include <KoFilter.h>
00024 #include <KoStore.h>
00025 
00026 #include <qdom.h>
00027 #include <qdict.h>
00028 #include <qcolor.h>
00029 #include <KoStyleStack.h>
00030 #include <core/vdocument.h>
00031 #include <core/vcomposite.h>
00032 #include <core/vstroke.h>
00033 
00034 class KZip;
00035 
00036 class VGroup;
00037 
00038 class OoDrawImport : public KoFilter
00039 {
00040     Q_OBJECT
00041 public:
00042     OoDrawImport( KoFilter *parent, const char *name, const QStringList & );
00043     virtual ~OoDrawImport();
00044 
00045     virtual KoFilter::ConversionStatus convert( QCString const & from, QCString const & to );
00046 
00047 private:
00048     void createDocumentInfo( QDomDocument &docinfo );
00049 
00050     void createStyleMap( QDomDocument &docstyles );
00051     void insertStyles( const QDomElement& styles );
00052     void insertDraws( const QDomElement& styles );
00053     void fillStyleStack( const QDomElement& object );
00054     void addStyles( const QDomElement* style );
00055     void storeObjectStyles( const QDomElement& object );
00056     void appendPen( VObject &obj );
00057     void appendBrush( VObject &obj );
00058     void appendPoints(VPath &path, const QDomElement& object);
00059     void convert();
00060     void parseGroup( VGroup *parent, const QDomElement& object );
00061     void parseColor( VColor &color, const QString &s );
00062     double ymirror( double y );
00063     KoRect parseViewBox( const QDomElement& object );
00064 
00065     KoFilter::ConversionStatus openFile();
00066     KoFilter::ConversionStatus loadAndParse(const QString& filename, QDomDocument& doc);
00067 
00068     VDocument           m_document;
00069     QDomDocument            m_content;
00070     QDomDocument            m_meta;
00071     QDomDocument            m_settings;
00072     QDict<QDomElement>      m_styles, m_draws;
00073     KoStyleStack            m_styleStack;
00074     KZip * m_zip;
00075 
00076 };
00077 
00078 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys