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

okular

  • Okular
  • FilePrinter
Public Types | Static Public Member Functions | Protected Member Functions | List of all members
Okular::FilePrinter Class Reference

#include <fileprinter.h>

Public Types

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

Static Public Member Functions

static bool cupsAvailable ()
 
static QList< int > pageList (QPrinter &printer, int lastPage, int currentPage, const QList< int > &selectedPageList)
 
static QList< int > pageList (QPrinter &printer, int lastPage, const QList< int > &selectedPageList)
 
static QString pageListToPageRange (const QList< int > &pageList)
 
static QString pageRange (QPrinter &printer, int lastPage, const QList< int > &selectedPageList)
 
static bool pdf2psAvailable ()
 
static Generator::PrintError printError (int c)
 
static int printFile (QPrinter &printer, const QString file, QPrinter::Orientation documentOrientation, FileDeletePolicy fileDeletePolicy=FilePrinter::ApplicationDeletesFiles, PageSelectPolicy pageSelectPolicy=FilePrinter::ApplicationSelectsPages, const QString &pageRange=QString())
 
static bool ps2pdfAvailable ()
 
static QSize psPaperSize (QPrinter &printer)
 

Protected Member Functions

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

Detailed Description

Definition at line 28 of file fileprinter.h.

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 37 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 49 of file fileprinter.h.

Member Function Documentation

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

Definition at line 409 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 236 of file fileprinter.cpp.

QStringList FilePrinter::cupsOptions ( QPrinter &  printer,
QPrinter::Orientation  documentOrientation 
)
protected

Definition at line 486 of file fileprinter.cpp.

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

Definition at line 441 of file fileprinter.cpp.

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

Definition at line 396 of file fileprinter.cpp.

bool FilePrinter::detectCupsConfig ( )
protected

Definition at line 261 of file fileprinter.cpp.

bool FilePrinter::detectCupsService ( )
protected

Definition at line 252 of file fileprinter.cpp.

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

Definition at line 45 of file fileprinter.cpp.

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

Definition at line 424 of file fileprinter.cpp.

QString FilePrinter::mediaPageSize ( QPrinter &  printer)
protected

Definition at line 541 of file fileprinter.cpp.

QString FilePrinter::mediaPaperSource ( QPrinter &  printer)
protected

Definition at line 582 of file fileprinter.cpp.

QStringList FilePrinter::optionCollateCopies ( QPrinter &  printer)
protected

Definition at line 640 of file fileprinter.cpp.

QStringList FilePrinter::optionCupsProperties ( QPrinter &  printer)
protected

Definition at line 662 of file fileprinter.cpp.

QStringList FilePrinter::optionDoubleSidedPrinting ( QPrinter &  printer)
protected

Definition at line 617 of file fileprinter.cpp.

QStringList FilePrinter::optionMedia ( QPrinter &  printer)
protected

Definition at line 519 of file fileprinter.cpp.

QStringList FilePrinter::optionOrientation ( QPrinter &  printer,
QPrinter::Orientation  documentOrientation 
)
protected

Definition at line 603 of file fileprinter.cpp.

QStringList FilePrinter::optionPageMargins ( QPrinter &  printer)
protected

Definition at line 648 of file fileprinter.cpp.

QStringList FilePrinter::optionPageOrder ( QPrinter &  printer)
protected

Definition at line 632 of file fileprinter.cpp.

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

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

Parameters
printerthe print settings to use
lastPagethe last page number, needed if AllPages option is selected
currentPagethe current page number, needed if CurrentPage option is selected
selectedPageListlist of pages to use if Selection option is selected
Returns
Returns list of pages to print

Definition at line 150 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
printerthe print settings to use
lastPagethe last page number, needed if AllPages option is selected
selectedPageListlist of pages to use if Selection option is selected
Returns
Returns list of pages to print

Definition at line 145 of file fileprinter.cpp.

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

convert a Page List into a Page Range

Parameters
pageListlist of pages to convert
Returns
Returns equivalent page range

Definition at line 193 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
printerthe print settings to use
lastPagethe last page number, needed if AllPages option is selected
selectedPageListlist of pages to use if Selection option is selected
Returns
Returns range of pages to print

Definition at line 180 of file fileprinter.cpp.

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

Definition at line 450 of file fileprinter.cpp.

bool FilePrinter::pdf2psAvailable ( )
static

Return if Ghostscript pdf2ps is available on this system.

Returns
Returns true if Ghostscript pdf2ps available

Definition at line 231 of file fileprinter.cpp.

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

Definition at line 358 of file fileprinter.cpp.

Generator::PrintError FilePrinter::printError ( int  c)
static

Convert the code returned by printFile* to PrintError.

Since
0.11 (KDE 4.5)

Definition at line 318 of file fileprinter.cpp.

int FilePrinter::printFile ( QPrinter &  printer,
const QString  file,
QPrinter::Orientation  documentOrientation,
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.

The documentOrientation parameter was added in version 0.14.

Parameters
printerthe print settings to use
filethe file to print
documentOrientationthe orientation stored in the document itself
fileDeletePolicyif the application or system deletes the file
pageSelectPolicyif the application or system selects the pages to print
pageRangepage 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 -5 if print to file copy failed -2 if the KProcess could not be started -1 if the KProcess crashed otherwise the KProcess exit code
Since
0.14 (KDE 4.8)

Definition at line 36 of file fileprinter.cpp.

bool FilePrinter::ps2pdfAvailable ( )
static

Return if Ghostscript ps2pdf is available on this system.

Returns
Returns true if Ghostscript ps2pdf available

Definition at line 226 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 271 of file fileprinter.cpp.


The documentation for this class was generated from the following files:
  • fileprinter.h
  • fileprinter.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

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

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal