Back to index

scribus-ng  1.3.4.dfsg+svn20071115
scribus12format.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 SCRIBUS12FORMAT_H
00008 #define SCRIBUS12FORMAT_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 LastStyles;
00022 
00023 class PLUGIN_API Scribus12Format : public LoadSavePlugin
00024 {
00025        Q_OBJECT
00026 
00027        public:
00028               // Standard plugin implementation
00029               Scribus12Format();
00030               virtual ~Scribus12Format();
00031               virtual const QString fullTrName() const;
00032               virtual const AboutData* getAboutData() const;
00033               virtual void deleteAboutData(const AboutData* about) const;
00034               virtual void languageChange();
00035               //Not the same as readSLA. This one only reads max 4k of the file for speed.
00036               virtual bool fileSupported(QIODevice* file, const QString & fileName=QString::null) const;
00037 
00038               virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
00039               virtual bool saveFile(const QString & fileName, const FileFormat & fmt);
00040               virtual void addToMainWindowMenu(ScribusMainWindow *) {};
00041 
00042               // Special features - .sla page extraction support
00043               virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null);
00044               virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
00045               virtual bool readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty);
00046               virtual bool readColors(const QString& fileName, ColorList & colors);
00047               virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
00048               virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QValueList<ScFace> &getDummyScFaces);
00049 
00050        private:
00051               void registerFormats();
00052               //Scribus Doc vars, not plugin vars
00053               void GetItemText(QDomElement *it, ScribusDoc *doc, bool VorLFound, bool impo, PageItem* obj, LastStyles* last);
00054               void GetStyle(QDomElement *pg, ParagraphStyle *vg, StyleSet<ParagraphStyle> *tempParagraphStyles, ScribusDoc* doc, bool fl);
00055               QString readSLA(const QString & fileName);
00056 //            QString AskForFont(SCFonts &avail, QString fStr, ScribusDoc *doc);
00057 //            QValueList<ScFace> dummyScFaces;
00058 //            bool newReplacement;
00059 //            QMap<QString,QString> ReplacedFonts;
00060 //            QMap<QString,QString> DoFonts;
00061               QMap<long long,int> itemRemap;
00062               QMap<int,long long> itemNext;
00063               QMap<uint,QString> DoVorl;
00064               uint VorlC;
00065               
00066 };
00067 
00068 extern "C" PLUGIN_API int scribus12format_getPluginAPIVersion();
00069 extern "C" PLUGIN_API ScPlugin* scribus12format_getPlugin();
00070 extern "C" PLUGIN_API void scribus12format_freePlugin(ScPlugin* plugin);
00071 
00072 #endif