Scribus
Open source desktop publishing at your fingertips
scribus12format.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 SCRIBUS12FORMAT_H
8 #define SCRIBUS12FORMAT_H
9 
10 #include "pluginapi.h"
11 #include "loadsaveplugin.h"
12 #include "scfonts.h"
13 #include "scribusstructs.h"
14 #include "styles/styleset.h"
15 
16 #include <QDomElement>
17 #include <QMap>
18 #include <QHash>
19 #include <QString>
20 #include <QList>
21 
22 class LastStyles;
23 
24 class PLUGIN_API Scribus12Format : public LoadSavePlugin
25 {
26  Q_OBJECT
27 
28  public:
29  // Standard plugin implementation
31  virtual ~Scribus12Format();
32  virtual const QString fullTrName() const;
33  virtual const AboutData* getAboutData() const;
34  virtual void deleteAboutData(const AboutData* about) const;
35  virtual void languageChange();
36  //Not the same as readSLA. This one only reads max 4k of the file for speed.
37  virtual bool fileSupported(QIODevice* file, const QString & fileName=QString::null) const;
38 
39  virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
40  virtual bool saveFile(const QString & fileName, const FileFormat & fmt);
42 
43  // Special features - .sla page extraction support
44  virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null);
45  virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
46  virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
47  virtual bool readColors(const QString& fileName, ColorList & colors);
48  virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
49  virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
50 
51  private:
52  void registerFormats();
53  //Scribus Doc vars, not plugin vars
54  void GetItemText(QDomElement *it, ScribusDoc *doc, bool VorLFound, bool impo, PageItem* obj, LastStyles* last);
55  void GetStyle(QDomElement *pg, ParagraphStyle *vg, StyleSet<ParagraphStyle> *tempParagraphStyles, ScribusDoc* doc, bool fl);
56  QString readSLA(const QString & fileName);
64  //TODO: void PasteItem(struct CopyPasteBuffer *Buffer, bool loading, bool drag = false);
65  QMap<int,int> groupRemap;
66  QMap<long long,int> itemRemap;
67  QMap<int,long long> itemNext;
68  QMap<uint,QString> DoVorl;
69  QList<PDFPresentationData> EffVal;
70  uint VorlC;
71  struct CopyPasteBuffer
72  {
73  PageItem::ItemType PType;
74  double Xpos;
75  double Ypos;
76  double Width;
77  double Height;
78  double RadRect;
79  int FrameType;
80  bool ClipEdited;
81  double Pwidth;
82  QString Pcolor;
83  QString Pcolor2;
84  double Shade;
85  double Shade2;
86  int FillRule;
87  QString GrColor;
88  QString GrColor2;
89  int GrShade;
90  int GrShade2;
91  VGradient fill_gradient;
92  int GrType;
93  QString pattern;
94  double patternScaleX;
95  double patternScaleY;
96  double patternOffsetX;
97  double patternOffsetY;
98  double patternRotation;
99  double patternSkewX;
100  double patternSkewY;
101  bool patternMirrorX;
102  bool patternMirrorY;
103  double GrStartX;
104  double GrStartY;
105  double GrEndX;
106  double GrEndY;
107  double GrFocalX;
108  double GrFocalY;
109  double GrScale;
110  double GrSkew;
111  VGradient stroke_gradient;
112  int GrTypeStroke;
113  double GrStrokeStartX;
114  double GrStrokeStartY;
115  double GrStrokeEndX;
116  double GrStrokeEndY;
117  double GrStrokeFocalX;
118  double GrStrokeFocalY;
119  double GrStrokeScale;
120  double GrStrokeSkew;
121  int GrMask;
122  double GrMaskStartX;
123  double GrMaskStartY;
124  double GrMaskEndX;
125  double GrMaskEndY;
126  double GrMaskFocalX;
127  double GrMaskFocalY;
128  double GrMaskScale;
129  double GrMaskSkew;
130  double patternMaskScaleX;
131  double patternMaskScaleY;
132  double patternMaskOffsetX;
133  double patternMaskOffsetY;
134  double patternMaskRotation;
135  double patternMaskSkewX;
136  double patternMaskSkewY;
137  bool patternMaskMirrorX;
138  bool patternMaskMirrorY;
139  double GrCol1transp;
140  double GrCol2transp;
141  double GrCol3transp;
142  double GrCol4transp;
143  int GrCol1Shade;
144  int GrCol2Shade;
145  int GrCol3Shade;
146  int GrCol4Shade;
147  QString patternMaskVal;
148  VGradient mask_gradient;
149  FPoint GrControl1;
150  FPoint GrControl2;
151  FPoint GrControl3;
152  FPoint GrControl4;
153  FPoint GrControl5;
154  QString GrColorP1;
155  QString GrColorP2;
156  QString GrColorP3;
157  QString GrColorP4;
158  QList<QList<meshPoint> > meshGradientArray;
159  int mGArrayRows;
160  int mGArrayCols;
161  QString TxtStroke;
162  QString TxtFill;
163  int ShTxtStroke;
164  int ShTxtFill;
165  int TxtScale;
166  int TxtScaleV;
167  int TxTStyle;
168  int TxTBase;
169  int TxtShadowX;
170  int TxtShadowY;
171  int TxtOutline;
172  int TxtUnderPos;
173  int TxtUnderWidth;
174  int TxtStrikePos;
175  int TxtStrikeWidth;
176  double Rot;
177  int PLineArt;
178  int PLineJoin;
179  int PLineEnd;
180  double LineSp;
181  int LineSpMode;
182  int ExtraV;
183  double LocalScX;
184  double LocalScY;
185  double LocalX;
186  double LocalY;
187  double LocalRot;
188  bool PicArt;
189  bool flippedH;
190  bool flippedV;
191  bool isPrintable;
192  bool isBookmark;
193  bool m_isAnnotation;
194  Annotation m_annotation;
195  QString AnName;
196  double Extra;
197  double TExtra;
198  double BExtra;
199  double RExtra;
200  FirstLineOffsetPolicy firstLineOffsetP;
201  QString Pfile;
202  QString Pfile2;
203  QString Pfile3;
204  QString IProfile;
205  QString EmProfile;
206  eRenderIntent IRender;
207  bool UseEmbedded;
208  bool OverrideCompressionMethod;
209  int CompressionMethodIndex;
210  bool OverrideCompressionQuality;
211  int CompressionQualityIndex;
212  QString itemText;
213  QPolygon Clip;
214  FPointArray PoLine;
215  FPointArray ContourLine;
216  bool PoShow;
217  double BaseOffs;
218  int textPathType;
219  bool textPathFlipped;
220  int TextflowMode;
221  int textAlignment;
222  QString IFont;
223  int ISize;
224  QStack<int> Groups;
225  double groupHeight;
226  double groupWidth;
227  int LayerID;
228  bool ScaleType;
229  bool AspectRatio;
230  bool Locked;
231  bool LockRes;
232  double Transparency;
233  double TranspStroke;
234  int TransBlend;
235  int TransBlendS;
236  bool Reverse;
237  QString NamedLStyle;
238  QString Language;
239  QString guiLanguage;
240  int Cols;
241  double ColGap;
242  QList<ParagraphStyle::TabRecord> TabValues;
243  QVector<double> DashValues;
244  double DashOffset;
245  bool isTableItem;
246  bool TopLine;
247  bool LeftLine;
248  bool RightLine;
249  bool BottomLine;
250  int LeftLinkID;
251  int RightLinkID;
252  int TopLinkID;
253  int BottomLinkID;
254  int startArrowIndex;
255  int endArrowIndex;
256  int startArrowScale;
257  int endArrowScale;
258  ObjAttrVector pageItemAttributes;
259  };
260  void PasteItem(struct CopyPasteBuffer *Buffer, bool drag = false, bool noResize = true);
261  void GetItemProps(QDomElement *obj, struct CopyPasteBuffer *OB, const QString& baseDir, bool newVersion);
262 
263 };
264 
265 extern "C" PLUGIN_API int scribus12format_getPluginAPIVersion();
266 extern "C" PLUGIN_API ScPlugin* scribus12format_getPlugin();
267 extern "C" PLUGIN_API void scribus12format_freePlugin(ScPlugin* plugin);
268 
269 #endif
Definition: loadsaveplugin.h:190
virtual const QString fullTrName() const =0
Plug-in's human-readable, translated name.
Abstract super class for all Scribus plug-ins.
Definition: scplugin.h:90
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
virtual void addToMainWindowMenu(ScribusMainWindow *)
Allow plugins to add to a main menu.
Definition: scribus12format.h:41
virtual void languageChange()=0
Update all user-visible text to reflect current UI language.
Definition: vgradient.h:78
Definition: paragraphstyle.h:27
Definition: sccolor.h:155
A point with floating point precision.
Definition: fpoint.h:43
Definition: scribus12format.h:24
the Document Class
Definition: scribusdoc.h:90
ScPlugin provides an interface to ask plugins for information about themselves.
Definition: scplugin.h:103
Superclass for all file import/export/load/save plugins.
Definition: loadsaveplugin.h:33
ItemType
Item Type.
Definition: pageitem.h:174
virtual const AboutData * getAboutData() const =0
Return descriptive information about the plug-in.
Definition: pageitem.h:92
Definition: annotation.h:35
Definition: fpointarray.h:42
Definition: scribusstructs.h:338