Subversion Repositories Scribus

Rev

Rev 5653 | Rev 5980 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5653 cbradney 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 SCRIBUS134FORMAT_H
8
#define SCRIBUS134FORMAT_H
9
 
10
#include "pluginapi.h"
11
#include "loadsaveplugin.h"
12
#include "scfonts.h"
13
#include "scribusstructs.h"
14
 
15
#include <qdom.h>
16
#include <qmap.h>
17
#include <qptrlist.h>
18
#include <qstring.h>
19
#include <qvaluelist.h>
20
 
21
class PLUGIN_API Scribus134Format : public LoadSavePlugin
22
{
23
        Q_OBJECT
24
 
25
        public:
26
                // Standard plugin implementation
27
                Scribus134Format();
28
                virtual ~Scribus134Format();
29
                virtual const QString fullTrName() const;
30
                virtual const AboutData* getAboutData() const;
31
                virtual void deleteAboutData(const AboutData* about) const;
32
                virtual void languageChange();
5685 cbradney 33
                //Not the same as readSLA. This one only reads max 4k of the file for speed.
5653 cbradney 34
                virtual bool fileSupported(QIODevice* file, const QString & fileName=QString::null) const;
35
 
36
                virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
37
                virtual bool saveFile(const QString & fileName, const FileFormat & fmt);
38
                virtual void addToMainWindowMenu(ScribusMainWindow *) {};
39
 
40
                // Special features - .sla page extraction support
41
                virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName=QString::null);
42
                virtual bool readStyles(const QString& fileName, ScribusDoc* doc, QValueList<ParagraphStyle> &docParagraphStyles);
43
                virtual bool readLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty);
44
                virtual bool readColors(const QString& fileName, ColorList & colors);
45
                virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
46
                virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QPtrList<Foi> &getDummyFois);
47
 
48
        private:
49
                void registerFormats();
50
                //Scribus Doc vars, not plugin vars
51
                void GetItemText(QDomElement *it, ScribusDoc *doc, PageItem* obj, LastStyles* last, bool impo=false, bool VorLFound=false);
52
                void readParagraphStyle(ParagraphStyle& vg, const QDomElement& pg, SCFonts &avail, ScribusDoc *doc);
53
                PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc);
54
                void GetStyle(QDomElement *pg, ParagraphStyle *vg, QValueList<ParagraphStyle> &docParagraphStyles, ScribusDoc* doc, bool fl);
55
                QString readSLA(const QString & fileName);
56
                QString AskForFont(SCFonts &avail, QString fStr, ScribusDoc *doc);
57
                void WritePages(ScribusDoc *doc, QDomDocument *docu, QDomElement *dc, QProgressBar *dia2, uint maxC, bool master);
58
                void WriteObjects(ScribusDoc *doc, QDomDocument *docu, QDomElement *dc, QProgressBar *dia2, uint maxC, int master);
59
                void SetItemProps(QDomElement *ob, PageItem* item, bool newFormat);
60
                QValueList<int> LFrames;
61
                QPtrList<Foi> dummyFois;
62
                bool newReplacement;
63
                QMap<QString,QString> ReplacedFonts;
64
                QMap<uint,QString> DoVorl;
65
                uint VorlC;
66
};
67
 
68
extern "C" PLUGIN_API int scribus134format_getPluginAPIVersion();
69
extern "C" PLUGIN_API ScPlugin* scribus134format_getPlugin();
70
extern "C" PLUGIN_API void scribus134format_freePlugin(ScPlugin* plugin);
71
 
72
#endif