Scribus
Open source desktop publishing at your fingertips
collect4output.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 COLLECT4OUTPUT_H
8 #define COLLECT4OUTPUT_H
9 
10 #include <QObject>
11 #include <QMap>
12 
13 #include "scribusstructs.h"
14 
15 class QString;
16 class ScribusDoc;
17 class PrefsContext;
18 class PageItem;
19 
20 
27 class CollectForOutput : public QObject
28 {
29  Q_OBJECT
30 
31  public:
38  CollectForOutput(ScribusDoc* doc, QString outputDirectory=QString::null, bool withFonts=false, bool withProfiles=false, bool compressDoc=false);
39  ~CollectForOutput(){};
40 
44  virtual QString collect(QString &newFileName);
45 
46  protected:
58  QString newName;
61  QMap<QString, QString> collectedFiles;
64 
67  bool newDirDialog();
70  bool collectDocument();
73  bool collectItems();
75  void processItem(PageItem *ite);
78  bool collectFonts();
80  QStringList findFontMetrics(const QString& baseDir, const QString& baseName) const;
83  bool collectProfiles();
93  QString collectFile(QString oldFile, QString newFile);
94 
95  ProfilesL docProfiles;
96  QStringList patterns;
97  int profileCount;
98  int itemCount;
99  int fontCount;
100  int patternCount;
101  bool uiCollect;
102 
103  signals:
104  void fontsCollected(int);
105  void patternsCollected(int);
106  void profilesCollected(int);
107  void itemsCollected(int);
108 };
109 
110 #endif
PrefsContext * dirs
Definition: collect4output.h:63
bool collectDocument()
Definition: collect4output.cpp:155
void processItem(PageItem *ite)
Definition: collect4output.cpp:272
bool m_compressDoc
Definition: collect4output.h:50
the Document Class
Definition: scribusdoc.h:90
bool collectItems()
Definition: collect4output.cpp:191
Performs "Collect for Output" tasks. collect() method copies the document, fonts and images into user...
Definition: collect4output.h:27
virtual QString collect(QString &newFileName)
Main method doing everything. It calls all related methods.
Definition: collect4output.cpp:110
bool collectFonts()
Definition: collect4output.cpp:349
ScribusDoc * m_Doc
Definition: collect4output.h:48
bool m_withFonts
Definition: collect4output.h:52
QString collectFile(QString oldFile, QString newFile)
Copy used file into new location with magic checks. It looks into collectedFiles map. If there is newFile (key) already found - it will construct new filename to prevent overwriting. E.g. newFile.png can be newFile_0.png. It checks already collected files not to collect one item 2 times.
Definition: collect4output.cpp:499
CollectForOutput(ScribusDoc *doc, QString outputDirectory=QString::null, bool withFonts=false, bool withProfiles=false, bool compressDoc=false)
Setup the attributes.
Definition: collect4output.cpp:33
Definition: prefscontext.h:40
Definition: pageitem.h:92
bool collectProfiles()
Definition: collect4output.cpp:467
QString newName
Definition: collect4output.h:58
bool m_withProfiles
Definition: collect4output.h:54
QMap< QString, QString > collectedFiles
Remember already collected files to collect the same files only once. It's QMap - newFile...
Definition: collect4output.h:61
QStringList findFontMetrics(const QString &baseDir, const QString &baseName) const
Definition: collect4output.cpp:425
bool newDirDialog()
Definition: collect4output.cpp:62
QString m_outputDirectory
Definition: collect4output.h:56