Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

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>

Collaboration diagram for CollectForOutput:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CollectForOutput (ScribusDoc *doc, bool withFontsA=false, bool withProfilesA=false, bool compressDocA=false)
 Setup the attributes.
 ~CollectForOutput ()
QString collect ()
 Main method doing everything. It calls all related methods.

Private Member Functions

bool newDirDialog ()
bool collectDocument ()
bool collectItems ()
void processItem (PageItem *ite)
bool collectFonts ()
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.

Private Attributes

ScribusDocm_Doc
bool compressDoc
bool withFonts
bool withProfiles
QString outputDirectory
QString newName
QMap< QString, QString > collectedFiles
 Remember already collected files to collect the same files only once. It's QMap - newFile, oldFile.
PrefsContextdirs


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

Definition at line 25 of file collect4output.h.


Constructor & Destructor Documentation

CollectForOutput::CollectForOutput ( ScribusDoc doc,
bool  withFontsA = false,
bool  withProfilesA = false,
bool  compressDocA = false 
)

Setup the attributes.

Parameters:
withFonts collect/move fonts into output directory too
compressDoc use gzipped document

Definition at line 28 of file collect4output.cpp.

References collectedFiles, compressDoc, dirs, PrefsFile::getContext(), PrefsManager::instance(), m_Doc, outputDirectory, PrefsManager::prefsFile, withFonts, and withProfiles.

CollectForOutput::~CollectForOutput (  )  [inline]

Definition at line 35 of file collect4output.h.


Member Function Documentation

QString CollectForOutput::collect (  ) 

bool CollectForOutput::newDirDialog (  )  [private]

bool CollectForOutput::collectDocument (  )  [private]

Check permissions and export document itself.

Return values:
true on success

Definition at line 104 of file collect4output.cpp.

References compressDoc, ScribusDoc::DocName, ScribusMainWindow::DoFileSave(), ScribusDoc::hasName, m_Doc, newName, outputDirectory, overwrite(), ScribusCore::primaryMainWindow(), and ScCore.

Referenced by collect().

bool CollectForOutput::collectItems (  )  [private]

Collect all related items, esp. images.

Return values:
true on success

Definition at line 140 of file collect4output.cpp.

References ScribusDoc::DocItems, ScribusDoc::docPatterns, ScribusDoc::FrameItems, ScribusDoc::getUsedPatterns(), ScPattern::items, m_Doc, ScribusDoc::MasterItems, and processItem().

Referenced by collect().

void CollectForOutput::processItem ( PageItem ite  )  [private]

bool CollectForOutput::collectFonts (  )  [private]

Collect used fonts if requested.

Return values:
true on success

Definition at line 240 of file collect4output.cpp.

References PrefsManager::appPrefs, ApplicationPrefs::AvailFonts, copyFile(), PrefsManager::instance(), m_Doc, outputDirectory, and ScribusDoc::UsedFonts.

Referenced by collect().

bool CollectForOutput::collectProfiles (  )  [private]

Collect used profiles if requested.

Return values:
true on success

Definition at line 253 of file collect4output.cpp.

References copyFile(), ScribusDoc::getUsedProfiles(), m_Doc, and outputDirectory.

Referenced by collect().

QString CollectForOutput::collectFile ( QString  oldFile,
QString  newFile 
) [private]

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:
oldFile full path of the original file
newFile suggested fullpath of the collected file
Return values:
QString really used fullpath of the new file

Definition at line 267 of file collect4output.cpp.

References collectedFiles, copy(), copyFile(), and outputDirectory.

Referenced by processItem().


Member Data Documentation

Doc to collect

Definition at line 44 of file collect4output.h.

Referenced by collectDocument(), collectFonts(), CollectForOutput(), collectItems(), and collectProfiles().

Use compressed document. See the constructor

Definition at line 46 of file collect4output.h.

Referenced by collectDocument(), CollectForOutput(), and newDirDialog().

Collect fonts too. See the constructor

Definition at line 48 of file collect4output.h.

Referenced by collect(), CollectForOutput(), and newDirDialog().

Collect icc profiles too. See the constructor

Definition at line 50 of file collect4output.h.

Referenced by collect(), CollectForOutput(), and newDirDialog().

User defined directory via GUI

Definition at line 52 of file collect4output.h.

Referenced by collect(), collectDocument(), collectFile(), collectFonts(), CollectForOutput(), collectProfiles(), and newDirDialog().

QString CollectForOutput::newName [private]

Name of the moved file with the new directory path

Definition at line 54 of file collect4output.h.

Referenced by collect(), and collectDocument().

QMap<QString, QString> CollectForOutput::collectedFiles [private]

Remember already collected files to collect the same files only once. It's QMap - newFile, oldFile.

Definition at line 57 of file collect4output.h.

Referenced by collect(), collectFile(), and CollectForOutput().

Reference to the preferences

Definition at line 59 of file collect4output.h.

Referenced by collect(), CollectForOutput(), and newDirDialog().


The documentation for this class was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.