Subversion Repositories Scribus

Rev

Rev 550 | Rev 991 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
541 fschmid 1
#ifndef OODPLUG_H
2
#define OODPLUG_H
3
 
766 cbradney 4
#include <qobject.h>
541 fschmid 5
#include <qdom.h>
6
#include <qdict.h>
766 cbradney 7
#include <qptrlist.h>
8
class QWidget;
9
 
10
class ScribusApp;
11
class ScribusDoc;
12
class PageItem;
13
class FPointArray;
541 fschmid 14
#include "stylestack.h"
15
 
16
/** Calls the Plugin with the main Application window as parent
17
  * and the main Application Class as parameter */
18
extern "C" void Run(QWidget *d, ScribusApp *plug);
19
/** Returns the Name of the Plugin.
20
  * This name appears in the relevant Menue-Entrys */
21
extern "C" QString Name();
22
/** Returns the Type of the Plugin.
23
  * 1 = the Plugin is a normal Plugin, which appears in the Extras Menue
24
  * 2 = the Plugins is a import Plugin, which appears in the Import Menue
25
  * 3 = the Plugins is a export Plugin, which appears in the Export Menue */
26
extern "C" int Type();
27
extern "C" int ID();
28
 
29
class OODPlug : public QObject
30
{
31
        Q_OBJECT
32
 
33
public:
34
        OODPlug( ScribusApp *plug, QString fName );
35
        ~OODPlug();
36
        void convert();
37
        void parseGroup(const QDomElement &e);
38
        void createStyleMap( QDomDocument &docstyles );
545 fschmid 39
        void insertDraws( const QDomElement& styles );
541 fschmid 40
        void insertStyles( const QDomElement& styles );
41
        void fillStyleStack( const QDomElement& object );
42
        void addStyles( const QDomElement* style );
43
        void storeObjectStyles( const QDomElement& object );
44
        static double parseUnit(const QString &unit);
45
        QColor parseColorN( const QString &rgbColor );
46
        QString parseColor( const QString &s );
546 fschmid 47
        void parseTransform(FPointArray *composite, const QString &transform);
544 fschmid 48
        void parseViewBox( const QDomElement& object, double *x, double *y, double *w, double *h );
49
        void appendPoints(FPointArray *composite, const QDomElement& object);
50
        const char * getCoord( const char *ptr, double &number );
51
        bool parseSVG( const QString &s, FPointArray *ite );
52
        void calculateArc(FPointArray *ite, bool relative, double &curx, double &cury, double angle, double x, double y, double r1, double r2, bool largeArcFlag, bool sweepFlag);
53
        void svgClosePath(FPointArray *i);
54
        void svgMoveTo(double x1, double y1);
55
        void svgLineTo(FPointArray *i, double x1, double y1);
56
        void svgCurveToCubic(FPointArray *i, double x1, double y1, double x2, double y2, double x3, double y3);
541 fschmid 57
 
58
        ScribusDoc* Doku;
59
        ScribusApp* Prog;
60
        QDomDocument inpContents;
61
        QDomDocument inpStyles;
550 fschmid 62
        QDomDocument inpMeta;
545 fschmid 63
        QDict<QDomElement> m_styles, m_draws;
541 fschmid 64
        StyleStack m_styleStack;
65
        QString stylePath;
66
        QString contentPath;
550 fschmid 67
        QString metaPath;
541 fschmid 68
        double CurrX, CurrY, StartX, StartY;
69
        int PathLen;
70
        QPtrList<PageItem> Elements;
550 fschmid 71
        bool FirstM, WasM, PathClosed, HaveMeta;
541 fschmid 72
};
73
 
74
#endif
75