Scribus
Open source desktop publishing at your fingertips
scribus13format.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 SCRIBUS13FORMAT_H
8 #define SCRIBUS13FORMAT_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 <QString>
19 #include <QList>
20 #include <QProgressBar>
21 
22 class PLUGIN_API Scribus13Format : public LoadSavePlugin
23 {
24  Q_OBJECT
25 
26  public:
27  // Standard plugin implementation
29  virtual ~Scribus13Format();
30  virtual const QString fullTrName() const;
31  virtual const AboutData* getAboutData() const;
32  virtual void deleteAboutData(const AboutData* about) const;
33  virtual void languageChange();
34  //Not the same as readSLA. This one only reads max 4k of the file for speed.
35  virtual bool fileSupported(QIODevice* file, const QString & fileName=QString::null) const;
36 
37  virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
38  virtual bool saveFile(const QString & fileName, const FileFormat & fmt) { return false; };
40 
41  // Special features - .sla page extraction support
42  virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null);
43  virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
44  virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
45  virtual bool readColors(const QString& fileName, ColorList & colors);
46  virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
47  virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
48 
49  private:
50  void registerFormats();
51  //Scribus Doc vars, not plugin vars
52  void GetItemText(QDomElement *it, ScribusDoc *doc, PageItem* obj, LastStyles* last, bool impo=false, bool VorLFound=false);
53  void readParagraphStyle(ParagraphStyle& vg, const QDomElement& pg, ScribusDoc *doc);
54  PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir, int pagenr = -2 /* currentPage*/);
55  void GetStyle(QDomElement *pg, ParagraphStyle *vg, StyleSet<ParagraphStyle> *tempParagraphStyles, ScribusDoc* doc, bool fl);
56  QString readSLA(const QString & fileName);
57  QString AskForFont(QString fStr, ScribusDoc *doc);
58  const ScFace& findFont(ScribusDoc *doc, const QString& fontname);
59 
60  QMap<int, int> itemRemap;
61  QMap<int, int> itemNext;
62  QList<PageItem*> FrameItems;
63  int itemCount;
64  bool newReplacement;
65  QMap<QString,QString> ReplacedFonts;
66  QMap<uint,QString> DoVorl;
67  uint VorlC;
68  QList<PDFPresentationData> EffVal;
69 };
70 
71 extern "C" PLUGIN_API int scribus13format_getPluginAPIVersion();
72 extern "C" PLUGIN_API ScPlugin* scribus13format_getPlugin();
73 extern "C" PLUGIN_API void scribus13format_freePlugin(ScPlugin* plugin);
74 
75 #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 languageChange()=0
Update all user-visible text to reflect current UI language.
Definition: paragraphstyle.h:27
Definition: sccolor.h:155
the Document Class
Definition: scribusdoc.h:90
virtual void addToMainWindowMenu(ScribusMainWindow *)
Allow plugins to add to a main menu.
Definition: scribus13format.h:39
ScPlugin provides an interface to ask plugins for information about themselves.
Definition: scplugin.h:103
Base Class ScFace : This is a total rewrite of the old Foi class.
Definition: scface.h:73
Superclass for all file import/export/load/save plugins.
Definition: loadsaveplugin.h:33
virtual const AboutData * getAboutData() const =0
Return descriptive information about the plug-in.
Definition: pageitem.h:92
Definition: scribusstructs.h:338
Definition: scribus13format.h:22