Back to index

scribus-ng  1.3.4.dfsg+svn20071115
scribus134format.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef SCRIBUS134FORMAT_H
00008 #define SCRIBUS134FORMAT_H
00009 
00010 #include "pluginapi.h"
00011 #include "loadsaveplugin.h"
00012 #include "scfonts.h"
00013 #include "scribusstructs.h"
00014 #include "styles/styleset.h"
00015 
00016 #include <qdom.h>
00017 #include <qmap.h>
00018 #include <qstring.h>
00019 #include <qvaluelist.h>
00020 
00021 class PLUGIN_API Scribus134Format : public LoadSavePlugin
00022 {
00023        Q_OBJECT
00024 
00025        public:
00026               // Standard plugin implementation
00027               Scribus134Format();
00028               virtual ~Scribus134Format();
00029               virtual const QString fullTrName() const;
00030               virtual const AboutData* getAboutData() const;
00031               virtual void deleteAboutData(const AboutData* about) const;
00032               virtual void languageChange();
00033               //Not the same as readSLA. This one only reads max 4k of the file for speed.
00034               virtual bool fileSupported(QIODevice* file, const QString & fileName=QString::null) const;
00035 
00036               virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
00037               virtual bool saveFile(const QString & fileName, const FileFormat & fmt);
00038               virtual void addToMainWindowMenu(ScribusMainWindow *) {};
00039 
00040               // Special features - .sla page extraction support
00041               virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null);
00042               virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
00043               virtual bool readCharStyles(const QString& fileName, ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles);
00044               virtual bool readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty);
00045               virtual bool readColors(const QString& fileName, ColorList & colors);
00046               virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
00047               virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QValueList<ScFace> &getDummyScFaces);
00048 
00049        private:
00050               void registerFormats();
00051               //Scribus Doc vars, not plugin vars
00052               void GetItemText(QDomElement *it, ScribusDoc *doc, PageItem* obj, LastStyles* last, bool impo=false, bool VorLFound=false);
00053               void GetCStyle(const QDomElement *it, ScribusDoc *doc, CharStyle & newStyle);
00054               void readParagraphStyle(ParagraphStyle& vg, const QDomElement& pg, SCFonts &avail, ScribusDoc *doc);
00055               PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc);
00056               void GetStyle(QDomElement *pg, ParagraphStyle *vg, StyleSet<ParagraphStyle> *docParagraphStyles, ScribusDoc* doc, bool fl);
00057               QString readSLA(const QString & fileName);
00058               void writeCheckerProfiles(QDomDocument & docu);
00059               void writeLinestyles(QDomDocument & docu);
00060               void writeJavascripts(QDomDocument & docu);
00061               void writeBookmarks(QDomDocument & docu);
00062               void writeColors(QDomDocument & docu);
00063               void writePStyles(QDomDocument & docu);
00064               void writeCStyles(QDomDocument & docu);
00065               void putPStyle(QDomDocument & docu, QDomElement & fo, const ParagraphStyle & style);
00066               void putCStyle(QDomDocument & docu, QDomElement & fo, const CharStyle & style);
00067               void writeITEXTs(ScribusDoc *doc, QDomDocument *docu, QDomElement ob, PageItem* item);
00068               void writeLayers(QDomDocument & docu);
00069               void writePrintOptions(QDomDocument & docu);
00070               void writePdfOptions(QDomDocument & docu);
00071               void writeDocItemAttributes(QDomDocument & docu);
00072               void writeTOC(QDomDocument & docu);
00073               void writePageSets(QDomDocument & docu);
00074               void writeSections(QDomDocument & docu);
00075               void writePatterns(QDomDocument & docu);
00076               void writeContent(QDomDocument & docu);
00077               void WritePages(ScribusDoc *doc, QDomDocument *docu, QDomElement *dc, QProgressBar *dia2, uint maxC, bool master);
00078               void WriteObjects(ScribusDoc *doc, QDomDocument *docu, QDomElement *dc, QProgressBar *dia2, uint maxC, int master, QPtrList<PageItem> *items = 0);
00079               void SetItemProps(QDomElement *ob, PageItem* item, bool newFormat);
00080               QMap<int, int> itemRemap;
00081               QMap<int, int> itemNext;
00082               QMap<int, int> itemRemapF;
00083               QMap<int, int> itemNextF;
00084               QMap<int, int> itemRemapM;
00085               QMap<int, int> itemNextM;
00086               int itemCount;
00087               int itemCountM;
00088               int itemCountF;
00089               QMap<uint,QString> DoVorl;
00090               uint VorlC;
00091 };
00092 
00093 extern "C" PLUGIN_API int scribus134format_getPluginAPIVersion();
00094 extern "C" PLUGIN_API ScPlugin* scribus134format_getPlugin();
00095 extern "C" PLUGIN_API void scribus134format_freePlugin(ScPlugin* plugin);
00096 
00097 #endif