Scribus
Open source desktop publishing at your fingertips
CollectForOutput Class Reference

Performs "Collect for Output" tasks. collect() method copies the document, fonts and images into user defined directory. QObject inheritance mainly due moc speedup and tr() methods. More...

#include <collect4output.h>

Inheritance diagram for CollectForOutput:
Collaboration diagram for CollectForOutput:

Signals

void fontsCollected (int)
 
void patternsCollected (int)
 
void profilesCollected (int)
 
void itemsCollected (int)
 

Public Member Functions

 CollectForOutput (ScribusDoc *doc, QString outputDirectory=QString::null, bool withFonts=false, bool withProfiles=false, bool compressDoc=false)
 Setup the attributes. More...
 
virtual QString collect (QString &newFileName)
 Main method doing everything. It calls all related methods.
 

Protected Member Functions

bool newDirDialog ()
 
bool collectDocument ()
 
bool collectItems ()
 
void processItem (PageItem *ite)
 
bool collectFonts ()
 
QStringList findFontMetrics (const QString &baseDir, const QString &baseName) const
 
bool collectProfiles ()
 
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. More...
 

Protected Attributes

ScribusDocm_Doc
 
bool m_compressDoc
 
bool m_withFonts
 
bool m_withProfiles
 
QString m_outputDirectory
 
QString newName
 
QMap< QString, QString > collectedFiles
 Remember already collected files to collect the same files only once. It's QMap - newFile, oldFile.
 
PrefsContextdirs
 
ProfilesL docProfiles
 
QStringList patterns
 
int profileCount
 
int itemCount
 
int fontCount
 
int patternCount
 
bool uiCollect
 

Detailed Description

Performs "Collect for Output" tasks. collect() method copies the document, fonts and images into user defined directory. QObject inheritance mainly due moc speedup and tr() methods.

Author
Petr Vanek, Franz Schmid

Constructor & Destructor Documentation

CollectForOutput::CollectForOutput ( ScribusDoc doc,
QString  outputDirectory = QString::null,
bool  withFonts = false,
bool  withProfiles = false,
bool  compressDoc = false 
)

Setup the attributes.

Parameters
doca Scribus doecument reference
withFontscollect/move fonts into output directory too
withProfilescollect/move CMS profiles into output directory too
compressDocuse gzipped document

Member Function Documentation

bool CollectForOutput::collectDocument ( )
protected

Check permissions and export document itself.

Return values
trueon success
QString CollectForOutput::collectFile ( QString  oldFile,
QString  newFile 
)
protected

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.

Parameters
oldFilefull path of the original file
newFilesuggested fullpath of the collected file
Return values
QStringreally used fullpath of the new file
bool CollectForOutput::collectFonts ( )
protected

Collect used fonts if requested.

Return values
trueon success
bool CollectForOutput::collectItems ( )
protected

Collect all related items, esp. images.

Return values
trueon success
bool CollectForOutput::collectProfiles ( )
protected

Collect used profiles if requested.

Return values
trueon success
QStringList CollectForOutput::findFontMetrics ( const QString &  baseDir,
const QString &  baseName 
) const
protected

Helper function for collectFonts()

bool CollectForOutput::newDirDialog ( )
protected

Ask user for output directory via GUI.

Return values
trueon success
void CollectForOutput::processItem ( PageItem ite)
protected

Processes the item, helper function for collectItems()

Member Data Documentation

PrefsContext* CollectForOutput::dirs
protected

Reference to the preferences

bool CollectForOutput::m_compressDoc
protected

Use compressed document. See the constructor

ScribusDoc* CollectForOutput::m_Doc
protected

Doc to collect

QString CollectForOutput::m_outputDirectory
protected

User defined directory via GUI

bool CollectForOutput::m_withFonts
protected

Collect fonts too. See the constructor

bool CollectForOutput::m_withProfiles
protected

Collect icc profiles too. See the constructor

QString CollectForOutput::newName
protected

Name of the moved file with the new directory path


The documentation for this class was generated from the following files: