Subversion Repositories Scribus

Rev

Rev 12337 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 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
*/
3644 craig 7
#ifndef SCRIBUS_FILELOADER_H
8
#define SCRIBUS_FILELOADER_H
10223 cbradney 9
#include <QObject>
10
#include <QString>
11
#include <QStringList>
12
#include <QMap>
9803 fschmid 13
#include <QList>
2969 craig 14
 
15
#include "scribusapi.h"
12337 pierre 16
// #include "styles/styleset.h"
17
// #include "styles/paragraphstyle.h"
18
// #include "styles/charstyle.h"
19
#include "styles/styleslibrary.h"
1525 cbradney 20
 
21
class QDomElement;
9953 cbradney 22
class QProgressBar;
838 cbradney 23
class ScribusDoc;
24
class ScribusView;
25
class SCFonts;
2834 cbradney 26
class PrefsManager;
4024 craig 27
class FileFormat;
10601 mrdocs 28
class multiLine;
506 fschmid 29
 
3644 craig 30
class SCRIBUS_API FileLoader : public QObject
506 fschmid 31
{
3825 cbradney 32
        Q_OBJECT
506 fschmid 33
public:
3644 craig 34
        FileLoader(const QString & fileName);
506 fschmid 35
        ~FileLoader() {};
36
        int TestFile();
5642 cbradney 37
//      int CheckScribus();
5781 cbradney 38
        bool LoadPage(ScribusDoc* currDoc, int PageToLoad, bool Mpage, QString renamedPageName=QString::null);
39
        bool LoadFile(ScribusDoc* currDoc);
11212 jghali 40
        bool SaveFile(const QString& fileName, ScribusDoc *doc, QString *savedFile = NULL);
12343 pierre 41
        bool ReadStyles(const QString& fileName, ScribusDoc* doc);
42
        bool ReadCharStyles(const QString& fileName, ScribusDoc* doc);
5642 cbradney 43
        bool ReadPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
44
        bool ReadColors(const QString& fileName, ColorList & colors);
45
        bool ReadLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty);
5781 cbradney 46
        bool postLoad(ScribusDoc* currDoc);
5642 cbradney 47
        void informReplacementFonts();
506 fschmid 48
        QString FileName;
49
        int FileType;
5642 cbradney 50
        const FileFormat * const formatSLA12x;
51
        const FileFormat * const formatSLA13x;
5653 cbradney 52
        const FileFormat * const formatSLA134;
4024 craig 53
        const FileFormat * const formatPS;
54
        const FileFormat * const formatSVG;
55
        const FileFormat * const formatSXD;
56
        const FileFormat * const formatODG;
9803 fschmid 57
        QList<int> LFrames;
517 fschmid 58
        QMap<uint,QString> DoVorl;
3197 fschmid 59
        uint VorlC;
3644 craig 60
 
3646 craig 61
        static const QString getLoadFilterString();
2834 cbradney 62
private:
8775 cbradney 63
        QMap<QString, QString> ReplacedFonts;
64
        bool newReplacement;
65
        void readParagraphStyle(ParagraphStyle& vg, const QDomElement& pg, SCFonts &avail, ScribusDoc *doc);
9803 fschmid 66
        bool findFormat(uint formatId, QList<FileFormat>::const_iterator &it);
2834 cbradney 67
        PrefsManager* prefsManager;
3675 fschmid 68
        double maximumX;
69
        double maximumY;
506 fschmid 70
};
71
 
72
#endif