Back to index

scribus-ng  1.3.4.dfsg+svn20071115
fileloader.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 SCRIBUS_FILELOADER_H
00008 #define SCRIBUS_FILELOADER_H
00009 #include <qobject.h>
00010 #include <qstring.h>
00011 #include <qstringlist.h>
00012 #include <qvaluelist.h>
00013 #include <qmap.h>
00014 
00015 #include "scribusapi.h"
00016 #include "scribusstructs.h"
00017 #include "styles/styleset.h"
00018 
00019 class QDomElement;
00020 class QProgressBar;
00021 class ScribusDoc;
00022 class ScribusView;
00023 class SCFonts;
00024 class PrefsManager;
00025 class FileFormat;
00026 
00027 class SCRIBUS_API FileLoader : public QObject
00028 {
00029        Q_OBJECT
00030 public:
00031        FileLoader(const QString & fileName);
00032        ~FileLoader() {};
00033        int TestFile();
00034 //     int CheckScribus();
00035        bool LoadPage(ScribusDoc* currDoc, int PageToLoad, bool Mpage, QString renamedPageName=QString::null);
00036        bool LoadFile(ScribusDoc* currDoc);
00037        bool SaveFile(const QString& fileName, ScribusDoc *doc, QProgressBar *dia2);
00038        bool ReadStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
00039        bool ReadCharStyles(const QString& fileName, ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles);
00040        bool ReadPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
00041        bool ReadColors(const QString& fileName, ColorList & colors);
00042        bool ReadLineStyles(const QString& fileName, QMap<QString,multiLine> *Sty);
00043        bool postLoad(ScribusDoc* currDoc);
00044        void informReplacementFonts();
00045        QString FileName;
00046        int FileType;
00047        const FileFormat * const formatSLA12x;
00048        const FileFormat * const formatSLA13x;
00049        const FileFormat * const formatSLA134;
00050        const FileFormat * const formatPS;
00051        const FileFormat * const formatSVG;
00052        const FileFormat * const formatSXD;
00053        const FileFormat * const formatODG;
00054        QValueList<int> LFrames;
00055        QMap<uint,QString> DoVorl;
00056        uint VorlC;
00057 //     QValueList<ScFace> dummyScFaces;
00058 
00059        static const QString getLoadFilterString();
00060 private:
00061        QMap<QString,QString> ReplacedFonts;
00062        bool newReplacement;
00063        void readParagraphStyle(ParagraphStyle& vg, const QDomElement& pg, SCFonts &avail, ScribusDoc *doc);
00064        bool findFormat(uint formatId, QValueList<FileFormat>::const_iterator &it);
00065        PrefsManager* prefsManager;
00066        double maximumX;
00067        double maximumY;
00068 };
00069 
00070 #endif