Scribus
Open source desktop publishing at your fingertips
importshape.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 IMPORTSHAPE_H
8 #define IMPORTSHAPE_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 ShapePlug : public QObject
29 {
30  Q_OBJECT
31 
32 public:
42  ShapePlug( ScribusDoc* doc, int flags );
43  ~ShapePlug();
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(PageItem* ite);
62  void parseGroup(QDomNode &DOC);
63  void parseGroupProperties(QDomNode &DOC, double &minXCoor, double &minYCoor, double &maxXCoor, double &maxYCoor, bool &firstCheck);
64  double parseUnit(const QString &unit);
65  const char * getCoord( const char *ptr, double &number );
66  bool parseSVG( const QString &s, FPointArray *ite );
67  void svgClosePath(FPointArray *i);
68  void svgMoveTo(double x1, double y1);
69  void svgLineTo(FPointArray *i, double x1, double y1);
70  void svgCurveToCubic(FPointArray *i, double x1, double y1, double x2, double y2, double x3, double y3);
71 
72  QList<PageItem*> Elements;
73  QStack<QList<PageItem*> > groupStack;
74  double baseX, baseY;
75  double docWidth;
76  double docHeight;
77  QStringList importedColors;
78  bool first;
79  int count;
80  bool FirstM, WasM, PathClosed;
81  double CurrX, CurrY, StartX, StartY, Conversion;
82  int PathLen;
83 
84  bool interactive;
85  MultiProgressDialog * progressDialog;
86  bool cancel;
87  ScribusDoc* m_Doc;
88  Selection* tmpSel;
89  int importerFlags;
90  int oldDocItemCount;
91  QString baseFile;
92 
93 public slots:
94  void cancelRequested() { cancel = true; }
95 };
96 
97 #endif
Sml importer plugin.
Definition: importshape.h:28
the Document Class
Definition: scribusdoc.h:90
ShapePlug(ScribusDoc *doc, int flags)
Create the Sml importer window.
Definition: importshape.cpp:55
Definition: undomanager.h:52
Definition: pageitem.h:92
Definition: fpointarray.h:42
Definition: selection.h:34