Scribus
Open source desktop publishing at your fingertips
importsml.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 IMPORTSML_H
8 #define IMPORTSML_H
9 
10 #include "pluginapi.h"
11 #include "pageitem.h"
12 #include "sccolor.h"
13 #include "fpointarray.h"
14 #include <QList>
15 #include <QTransform>
16 #include <QMultiMap>
17 #include <QtGlobal>
18 #include <QObject>
19 #include <QString>
20 #include <QDomElement>
21 
22 class MultiProgressDialog;
23 class ScribusDoc;
24 class Selection;
26 
28 class SmlPlug : public QObject
29 {
30  Q_OBJECT
31 
32 public:
42  SmlPlug( ScribusDoc* doc, int flags );
43  ~SmlPlug();
44 
55  bool import(QString fn, const TransactionSettings& trSettings, int flags, bool showProgress = true);
56  QImage readThumbnail(QString fn);
57 
58 private:
59  void parseHeader(QString fName, double &b, double &h);
60  bool convert(QString fn);
61  void finishItem(QDomElement &e, PageItem* ite);
62  void processShapeNode(QDomElement &elem);
63  QString processColor(QDomElement &elem);
64  void processStrokeNode(QDomElement &elem);
65  void processFillNode(QDomElement &elem);
66  void processLineNode(QDomElement &elem);
67  void processPointNode(QDomElement &elem);
68 
69  QList<PageItem*> Elements;
70  int currentItemNr;
71  QStack<QList<PageItem*> > groupStack;
72  double baseX, baseY;
73  double docWidth;
74  double docHeight;
75 
76  double LineW;
77  QString CurrColorFill;
78  QString CurrColorStroke;
79  double CurrStrokeShade;
80  double CurrFillShade;
81  Qt::PenStyle Dash;
82  Qt::PenCapStyle LineEnd;
83  Qt::PenJoinStyle LineJoin;
84  int fillStyle;
85  QStringList importedColors;
86  double currx, curry, startx, starty;
87  bool first;
88  int count;
89 
90  FPointArray Coords;
91  bool interactive;
92  MultiProgressDialog * progressDialog;
93  bool cancel;
94  ScribusDoc* m_Doc;
95  Selection* tmpSel;
96  int importerFlags;
97  int oldDocItemCount;
98  QString baseFile;
99 
100 public slots:
101  void cancelRequested() { cancel = true; }
102 };
103 
104 #endif
SmlPlug(ScribusDoc *doc, int flags)
Create the Sml importer window.
Definition: importsml.cpp:54
Sml importer plugin.
Definition: importsml.h:28
the Document Class
Definition: scribusdoc.h:90
Definition: undomanager.h:52
Definition: pageitem.h:92
Definition: fpointarray.h:42
Definition: selection.h:34