Scribus
Open source desktop publishing at your fingertips
importxfig.h
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 "pluginapi.h"
11 #include "sccolor.h"
12 #include "fpointarray.h"
13 #include <QList>
14 #include <QStack>
15 #include <QTransform>
16 #include <QMultiMap>
17 #include <QtGlobal>
18 #include <QObject>
19 #include <QString>
20 
22 class PageItem;
23 class ScribusDoc;
24 class Selection;
26 
28 class XfigPlug : public QObject
29 {
30  Q_OBJECT
31 
32 public:
42  XfigPlug( ScribusDoc* doc, int flags );
43  ~XfigPlug();
44 
55  bool import(QString fn, const TransactionSettings& trSettings, int flags, bool showProgress = true);
56  QImage readThumbnail(QString fn);
57 
58 private:
59 
71  bool parseHeader(QString fName, double &x, double &y, double &b, double &h);
72  void parseColor(QString data);
73  void useColor(int colorNum, int area_fill, bool forFill);
74  QVector<double> getDashValues(double linewidth, int code);
75  void processArrows(int forward_arrow, QString fArrowData, int backward_arrow, QString bArrowData, int depth, PageItem *ite);
76  void processPolyline(QDataStream &ts, QString data);
77  void processSpline(QDataStream &ts, QString data);
78  void processArc(QDataStream &ts, QString data);
79  void processEllipse(QString data);
80  QString cleanText(QString text);
81  void processText(QString data);
82  void processData(QDataStream &ts, QString data);
83  double fig2Pts(double in);
84  void resortItems();
85  bool convert(QString fn);
86 
87  QList<PageItem*> Elements;
88  QList<PageItem*> PatternElements;
89  QMultiMap<int, int> depthMap;
90  int currentItemNr;
91  QStack<QList<PageItem*> > groupStack;
92  ColorList CustColors;
93  double baseX, baseY;
94  double docX;
95  double docY;
96  double docWidth;
97  double docHeight;
98 
99  double LineW;
100  QString CurrColorFill;
101  QString CurrColorStroke;
102  double CurrStrokeShade;
103  double CurrFillShade;
104 
105  FPointArray Coords;
106  FPointArray clipCoords;
107  bool interactive;
108  MultiProgressDialog * progressDialog;
109  bool cancel;
110  ScribusDoc* m_Doc;
111  Selection* tmpSel;
112  QMap<int, QString> importedColors;
113  int importerFlags;
114  bool patternMode;
115  QString currentPatternDefName;
116  QString currentPatternName;
117  double patternX1;
118  double patternY1;
119  double patternX2;
120  double patternY2;
121  double currentPatternX;
122  double currentPatternY;
123  double currentPatternXScale;
124  double currentPatternYScale;
125  double currentPatternRotation;
126  QString docCreator;
127  QString docDate;
128  QString docTime;
129  QString docOrganisation;
130  QString docTitle;
131  int oldDocItemCount;
132  QString baseFile;
133 
134 public slots:
135  void cancelRequested() { cancel = true; }
136 };
137 
138 #endif
Definition: sccolor.h:155
the Document Class
Definition: scribusdoc.h:90
Xfig importer plugin.
Definition: importxfig.h:28
Definition: undomanager.h:52
Definition: multiprogressdialog.h:44
Definition: pageitem.h:92
Definition: fpointarray.h:42
XfigPlug(ScribusDoc *doc, int flags)
Create the AI importer window.
Definition: importxfig.cpp:55
Definition: selection.h:34