~ubuntu-branches/ubuntu/maverick/scribus-ng/maverick-backports

« back to all changes in this revision

Viewing changes to scribus/plugins/import/xfig/importxfig.h

  • Committer: Bazaar Package Importer
  • Author(s): Oleksandr Moskalenko
  • Date: 2010-07-15 12:43:00 UTC
  • mfrom: (0.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100715124300-2u304r2rvy55vpkv
Tags: 1.3.7.dfsg~svn20100715-1
* Upstream svn. update.
* debian/scribus-ng.lintian: Updated overrides.
* debian/control: Updated standards version to 3.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
 
3
to the COPYING file provided with the program. Following this notice may exist
 
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
 
5
for which a new license (GPL+exception) is in place.
 
6
*/
 
7
#ifndef IMPORTXFIG_H
 
8
#define IMPORTXFIG_H
 
9
 
 
10
#include "qglobal.h"
 
11
#include "qobject.h"
 
12
#include "qstring.h"
 
13
 
 
14
#include "pluginapi.h"
 
15
#include "pageitem.h"
 
16
#include "sccolor.h"
 
17
#include "fpointarray.h"
 
18
#include <QList>
 
19
#include <QMatrix>
 
20
#include <QMultiMap>
 
21
 
 
22
class MultiProgressDialog;
 
23
class ScribusDoc;
 
24
class Selection;
 
25
class TransactionSettings;
 
26
 
 
27
//! \brief Xfig importer plugin
 
28
class XfigPlug : public QObject
 
29
{
 
30
        Q_OBJECT
 
31
 
 
32
public:
 
33
        /*!
 
34
        \author Franz Schmid
 
35
        \date
 
36
        \brief Create the AI importer window.
 
37
        \param fName QString
 
38
        \param flags combination of loadFlags
 
39
        \param showProgress if progress must be displayed
 
40
        \retval EPSPlug plugin
 
41
        */
 
42
        XfigPlug( ScribusDoc* doc, int flags );
 
43
        ~XfigPlug();
 
44
 
 
45
        /*!
 
46
        \author Franz Schmid
 
47
        \date
 
48
        \brief Perform import.
 
49
        \param fn QString
 
50
        \param trSettings undo transaction settings
 
51
        \param flags combination of loadFlags
 
52
        \param showProgress if progress must be displayed
 
53
        \retval bool true if import was ok
 
54
         */
 
55
        bool import(QString fn, const TransactionSettings& trSettings, int flags, bool showProgress = true);
 
56
 
 
57
private:
 
58
        
 
59
        /*!
 
60
        \author Franz Schmid
 
61
        \date
 
62
        \brief Does the conversion.
 
63
        \param fn QString
 
64
        \param x X position
 
65
        \param y Y position
 
66
        \param b double
 
67
        \param h double
 
68
        \retval bool true if conversion was ok
 
69
         */
 
70
        bool parseHeader(QString fName, double &x, double &y, double &b, double &h);
 
71
        void parseColor(QString data);
 
72
        void useColor(int colorNum, int area_fill, bool forFill);
 
73
        QVector<double> getDashValues(double linewidth, int code);
 
74
        void processArrows(int forward_arrow, QString fArrowData, int backward_arrow, QString bArrowData, int depth, PageItem *ite);
 
75
        void processPolyline(QDataStream &ts, QString data);
 
76
        void processSpline(QDataStream &ts, QString data);
 
77
        void processArc(QDataStream &ts, QString data);
 
78
        void processEllipse(QString data);
 
79
        QString cleanText(QString text);
 
80
        void processText(QString data);
 
81
        void processData(QDataStream &ts, QString data);
 
82
        double fig2Pts(double in);
 
83
        void resortItems();
 
84
        bool convert(QString fn);
 
85
        
 
86
        QList<PageItem*> Elements;
 
87
        QList<PageItem*> PatternElements;
 
88
        QMultiMap<int, int> depthMap;
 
89
        int currentItemNr;
 
90
        QStack<QList<PageItem*> > groupStack;
 
91
        ColorList CustColors;
 
92
        double baseX, baseY;
 
93
        double docX;
 
94
        double docY;
 
95
        double docWidth;
 
96
        double docHeight;
 
97
 
 
98
        double LineW;
 
99
        QString CurrColorFill;
 
100
        QString CurrColorStroke;
 
101
        double CurrStrokeShade;
 
102
        double CurrFillShade;
 
103
 
 
104
        FPointArray Coords;
 
105
        FPointArray clipCoords;
 
106
        bool interactive;
 
107
        MultiProgressDialog * progressDialog;
 
108
        bool cancel;
 
109
        ScribusDoc* m_Doc;
 
110
        Selection* tmpSel;
 
111
        QMap<int, QString> importedColors;
 
112
        int importerFlags;
 
113
        bool patternMode;
 
114
        QString currentPatternDefName;
 
115
        QString currentPatternName;
 
116
        double patternX1;
 
117
        double patternY1;
 
118
        double patternX2;
 
119
        double patternY2;
 
120
        double currentPatternX;
 
121
        double currentPatternY;
 
122
        double currentPatternXScale;
 
123
        double currentPatternYScale;
 
124
        double currentPatternRotation;
 
125
        QString docCreator;
 
126
        QString docDate;
 
127
        QString docTime;
 
128
        QString docOrganisation;
 
129
        QString docTitle;
 
130
        int oldDocItemCount;
 
131
        QString baseFile;
 
132
 
 
133
public slots:
 
134
        void cancelRequested() { cancel = true; }
 
135
};
 
136
 
 
137
#endif