Scribus
Open source desktop publishing at your fingertips
fileloader.h
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 SCRIBUS_FILELOADER_H
8 #define SCRIBUS_FILELOADER_H
9 #include <QObject>
10 #include <QString>
11 #include <QStringList>
12 #include <QMap>
13 #include <QHash>
14 #include <QList>
15 
16 #include "scribusapi.h"
17 #include "styles/styleset.h"
18 #include "styles/paragraphstyle.h"
19 #include "styles/charstyle.h"
20 
21 class QDomElement;
22 class QProgressBar;
23 class ScribusDoc;
24 class ScribusView;
25 class SCFonts;
26 class PrefsManager;
27 class FileFormat;
28 class multiLine;
29 
30 class SCRIBUS_API FileLoader : public QObject
31 {
32  Q_OBJECT
33 public:
34  FileLoader(const QString & fileName);
35  ~FileLoader() {};
36 
37  int fileType() const { return m_fileType; }
38  int testFile();
39 
40  bool loadPage(ScribusDoc* currDoc, int PageToLoad, bool Mpage, QString renamedPageName=QString::null);
41  bool loadFile(ScribusDoc* currDoc);
42  bool saveFile(const QString& fileName, ScribusDoc *doc, QString *savedFile = NULL);
43  bool readStyles(ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
44  bool readCharStyles(ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles);
45  bool readPageCount(int *num1, int *num2, QStringList & masterPageNames);
46  bool readColors(ColorList & colors);
47  bool readLineStyles(QHash<QString, multiLine> *Sty);
48  QImage readThumbnail();
49  bool postLoad(ScribusDoc* currDoc);
50  void informReplacementFonts();
51 
52  const FileFormat * const formatSLA12x;
53  const FileFormat * const formatSLA13x;
54  const FileFormat * const formatSLA134;
55  const FileFormat * const formatSLA150;
56 
57  static const QString getLoadFilterString();
58 private:
59  QMap<QString, QString> ReplacedFonts;
60  bool newReplacement;
61  void readParagraphStyle(ParagraphStyle& vg, const QDomElement& pg, SCFonts &avail, ScribusDoc *doc);
62  bool findFormat(uint formatId, QList<FileFormat>::const_iterator &it);
63  PrefsManager* prefsManager;
64 
65  QString m_fileName;
66  int m_fileType;
67 };
68 
69 #endif
Definition: loadsaveplugin.h:190
Definition: paragraphstyle.h:27
Definition: sccolor.h:155
the Document Class
Definition: scribusdoc.h:90
Definition: fileloader.h:30
Definition: scribusstructs.h:250
Definition: scribusview.h:87
Main class SCFonts. Subclass of QDict. This class replaces the previous SCFonts typedef...
Definition: scfonts.h:36
Manage Scribus preferences here, and here alone Start to move the preferences out of scribus...
Definition: prefsmanager.h:43