• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdegraphics
  • Sitemap
  • Contact Us
 

okular

Okular::FilePrinter

Okular::FilePrinter Class Reference

#include <fileprinter.h>

List of all members.


Detailed Description

Definition at line 27 of file fileprinter.h.


Public Types

enum  FileDeletePolicy { ApplicationDeletesFiles, SystemDeletesFiles }
enum  PageSelectPolicy { ApplicationSelectsPages, SystemSelectsPages }

Static Public Member Functions

static int printFile (QPrinter &printer, const QString file, FileDeletePolicy fileDeletePolicy=FilePrinter::ApplicationDeletesFiles, PageSelectPolicy pageSelectPolicy=FilePrinter::ApplicationSelectsPages, const QString &pageRange=QString())
static int printFiles (QPrinter &printer, const QStringList &fileList, FileDeletePolicy fileDeletePolicy=FilePrinter::ApplicationDeletesFiles)
static QList< int > pageList (QPrinter &printer, int lastPage, const QList< int > &selectedPageList)
static QString pageRange (QPrinter &printer, int lastPage, const QList< int > &selectedPageList)
static QString pageListToPageRange (const QList< int > &pageList)
static bool cupsAvailable ()
static QSize psPaperSize (QPrinter &printer)

Protected Member Functions

bool detectCupsService ()
bool detectCupsConfig ()
int doPrintFiles (QPrinter &printer, const QStringList fileList, FileDeletePolicy fileDeletePolicy, PageSelectPolicy pageSelectPolicy, const QString &pageRange)
QStringList printArguments (QPrinter &printer, FileDeletePolicy fileDeletePolicy, PageSelectPolicy pageSelectPolicy, bool useCupsOptions, const QString &pageRange, const QString &version)
QStringList destination (QPrinter &printer, const QString &version)
QStringList copies (QPrinter &printer, const QString &version)
QStringList jobname (QPrinter &printer, const QString &version)
QStringList deleteFile (QPrinter &printer, FileDeletePolicy fileDeletePolicy, const QString &version)
QStringList pages (QPrinter &printer, PageSelectPolicy pageSelectPolicy, const QString &pageRange, bool useCupsOptions, const QString &version)
QStringList cupsOptions (QPrinter &printer)
QStringList optionMedia (QPrinter &printer)
QString mediaPageSize (QPrinter &printer)
QString mediaPaperSource (QPrinter &printer)
QStringList optionOrientation (QPrinter &printer)
QStringList optionDoubleSidedPrinting (QPrinter &printer)
QStringList optionPageOrder (QPrinter &printer)
QStringList optionCollateCopies (QPrinter &printer)

Member Enumeration Documentation

enum Okular::FilePrinter::FileDeletePolicy

Whether file(s) get deleted by the application or by the print system.

You may need to chose system deletion if your temp file clean-up deletes the file before the print system is finished with it.

Enumerator:
ApplicationDeletesFiles 
SystemDeletesFiles 

Definition at line 36 of file fileprinter.h.

enum Okular::FilePrinter::PageSelectPolicy

Whether pages to be printed are selected by the application or the print system.

If application side, then the generated file will only contain those pages selected by the user, so FilePrinter will print all the pages in the file.

If system side, then the file will contain all the pages in the document, and the print system will print the users selected print range from out of the file.

Note system side only works in CUPS, not LPR.

Enumerator:
ApplicationSelectsPages 
SystemSelectsPages 

Definition at line 48 of file fileprinter.h.


Member Function Documentation

int FilePrinter::printFile ( QPrinter &  printer,
const QString  file,
FileDeletePolicy  fileDeletePolicy = FilePrinter::ApplicationDeletesFiles,
PageSelectPolicy  pageSelectPolicy = FilePrinter::ApplicationSelectsPages,
const QString &  pageRange = QString() 
) [static]

Print a file using the settings in QPrinter.

Only supports CUPS and LPR on *NIX. Page Range only supported in CUPS. Most settings unsupported by LPR, some settings unsupported by CUPS.

Parameters:
printer the print settings to use
file the file to print
fileDeletePolicy if the application or system deletes the file
pageSelectPolicy if the application or system selects the pages to print
pageRange page range to print if SystemSlectsPages and user chooses Selection in Print Dialog
Returns:
Returns exit code: -9 if lpr not found -8 if empty file name -7 if unable to find file -6 if invalid printer state -2 if the KProcess could not be started -1 if the KProcess crashed otherwise the KProcess exit code

Definition at line 35 of file fileprinter.cpp.

int FilePrinter::printFiles ( QPrinter &  printer,
const QStringList &  fileList,
FileDeletePolicy  fileDeletePolicy = FilePrinter::ApplicationDeletesFiles 
) [static]

Print a list of files using the settings in QPrinter.

Only supports CUPS and LPR on *NIX. Most settings unsupported by LPR, some settings unsupported by CUPS.

Parameters:
printer the print settings to use
fileList the files to print
fileDeletePolicy if the application or system deletes the file
Returns:
Returns exit code: -9 if lpr not found -8 if empty file list -7 if unable to find a file -6 if invalid printer state -2 if the KProcess could not be started -1 if the KProcess crashed otherwise the KProcess exit code

Definition at line 42 of file fileprinter.cpp.

QList< int > FilePrinter::pageList ( QPrinter &  printer,
int  lastPage,
const QList< int > &  selectedPageList 
) [static]

Return the list of pages selected by the user in the Print Dialog.

Parameters:
printer the print settings to use
lastPage the last page number, needed if AllPages option is selected
selectedPageList list of pages to use if Selection option is selected
Returns:
Returns list of pages to print

Definition at line 114 of file fileprinter.cpp.

QString FilePrinter::pageRange ( QPrinter &  printer,
int  lastPage,
const QList< int > &  selectedPageList 
) [static]

Return the range of pages selected by the user in the Print Dialog.

Parameters:
printer the print settings to use
lastPage the last page number, needed if AllPages option is selected
selectedPageList list of pages to use if Selection option is selected
Returns:
Returns range of pages to print

Definition at line 137 of file fileprinter.cpp.

QString FilePrinter::pageListToPageRange ( const QList< int > &  pageList  )  [static]

convert a Page List into a Page Range

Parameters:
pageList list of pages to convert
Returns:
Returns equivalent page range

Definition at line 150 of file fileprinter.cpp.

bool FilePrinter::cupsAvailable (  )  [static]

Return if CUPS Print System is available on this system.

Returns:
Returns true if CUPS available

Definition at line 183 of file fileprinter.cpp.

QSize FilePrinter::psPaperSize ( QPrinter &  printer  )  [static]

Returns the postscript standard page size.

Returns:
Returns paper size in ps points

Definition at line 212 of file fileprinter.cpp.

bool FilePrinter::detectCupsService (  )  [protected]

Definition at line 189 of file fileprinter.cpp.

bool FilePrinter::detectCupsConfig (  )  [protected]

Definition at line 202 of file fileprinter.cpp.

int FilePrinter::doPrintFiles ( QPrinter &  printer,
const QStringList  fileList,
FileDeletePolicy  fileDeletePolicy,
PageSelectPolicy  pageSelectPolicy,
const QString &  pageRange 
) [protected]

Definition at line 48 of file fileprinter.cpp.

QStringList FilePrinter::printArguments ( QPrinter &  printer,
FileDeletePolicy  fileDeletePolicy,
PageSelectPolicy  pageSelectPolicy,
bool  useCupsOptions,
const QString &  pageRange,
const QString &  version 
) [protected]

Definition at line 262 of file fileprinter.cpp.

QStringList FilePrinter::destination ( QPrinter &  printer,
const QString &  version 
) [protected]

Definition at line 299 of file fileprinter.cpp.

QStringList FilePrinter::copies ( QPrinter &  printer,
const QString &  version 
) [protected]

Definition at line 312 of file fileprinter.cpp.

QStringList FilePrinter::jobname ( QPrinter &  printer,
const QString &  version 
) [protected]

Definition at line 328 of file fileprinter.cpp.

QStringList FilePrinter::deleteFile ( QPrinter &  printer,
FileDeletePolicy  fileDeletePolicy,
const QString &  version 
) [protected]

Definition at line 344 of file fileprinter.cpp.

QStringList FilePrinter::pages ( QPrinter &  printer,
PageSelectPolicy  pageSelectPolicy,
const QString &  pageRange,
bool  useCupsOptions,
const QString &  version 
) [protected]

Definition at line 353 of file fileprinter.cpp.

QStringList FilePrinter::cupsOptions ( QPrinter &  printer  )  [protected]

Definition at line 389 of file fileprinter.cpp.

QStringList FilePrinter::optionMedia ( QPrinter &  printer  )  [protected]

Definition at line 416 of file fileprinter.cpp.

QString FilePrinter::mediaPageSize ( QPrinter &  printer  )  [protected]

Definition at line 438 of file fileprinter.cpp.

QString FilePrinter::mediaPaperSource ( QPrinter &  printer  )  [protected]

Definition at line 479 of file fileprinter.cpp.

QStringList FilePrinter::optionOrientation ( QPrinter &  printer  )  [protected]

Definition at line 500 of file fileprinter.cpp.

QStringList FilePrinter::optionDoubleSidedPrinting ( QPrinter &  printer  )  [protected]

Definition at line 509 of file fileprinter.cpp.

QStringList FilePrinter::optionPageOrder ( QPrinter &  printer  )  [protected]

Definition at line 521 of file fileprinter.cpp.

QStringList FilePrinter::optionCollateCopies ( QPrinter &  printer  )  [protected]

Definition at line 529 of file fileprinter.cpp.


The documentation for this class was generated from the following files:
  • fileprinter.h
  • fileprinter.cpp

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdegraphics

Skip menu "kdegraphics"
  • okular
Generated for kdegraphics by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal