Scribus
Open source desktop publishing at your fingertips
ScPrintEngine_GDI Class Reference
Inheritance diagram for ScPrintEngine_GDI:
Collaboration diagram for ScPrintEngine_GDI:

Public Member Functions

void setForceGDI (bool force)
 Force use of gdi even on ps printers. More...
 
virtual bool print (ScribusDoc &doc, PrintOptions &options)
 Print a document using gdi or ps methods. More...
 
bool gdiPrintPreview (ScribusDoc *doc, ScPage *page, QImage *image, PrintOptions &options, double scale=1.0)
 Draw print preview to an image using gdi method. More...
 
- Public Member Functions inherited from ScPrintEngine
virtual const QString & errorMessage (void)
 

Static Public Member Functions

static QString getDefaultPrinter (void)
 Get the default printer name. More...
 

Protected Types

typedef bool(ScPrintEngine_GDI::* PrintPageFunc) (ScribusDoc *doc, ScPage *page, PrintOptions &options, HDC printerDC, cairo_t *context)
 

Protected Member Functions

void resetData (void)
 
bool printPages (ScribusDoc *doc, PrintOptions &options, HDC printerDC, DEVMODEW *devMode, QString &fileName)
 Print selected pages to a printer or a file. More...
 
bool printPage_GDI (ScribusDoc *doc, ScPage *page, PrintOptions &options, HDC printerDC, cairo_t *context)
 Print a page to a gdi printer Print a page using GDI drawing code ( works on all printers : PS, PCL, GDI... ) More...
 
bool printPage_PS (ScribusDoc *doc, ScPage *page, PrintOptions &options, HDC printerDC, cairo_t *context)
 Print a page to a PostScript printer using passthroughs Print a page using PS drawing code and PS passthroughs ( works on PS printers only ) More...
 
bool printPage_PS_Sep (ScribusDoc *doc, ScPage *page, PrintOptions &options, HDC printerDC, cairo_t *context)
 Print a page separations to a PostScript printer using passthroughs Print a page using PS drawing code and PS passthroughs ( works on PS printers only ) More...
 
bool sendPSFile (QString filePath, HDC printerDC, int pageWidth, int pageHeight, bool landscape)
 Send a file to printer using PostScript Passthrough Send a postscript file to a printer using ps passthrough ( works on PS printers only ) More...
 
void setDeviceParams (ScribusDoc *doc, PrintOptions &options, DEVMODEW *devMode)
 Set device params into DEVMODE structure according to print options Set printing params according to options and DEVMODE structure. More...
 
int getPSPassthroughSupport (HDC printerDC)
 Get support for PostScript Passthrough Get ps passthrough support and escape code. More...
 
bool printerUseFilePort (QString &printerName)
 Check if a specified printer use the FILE: port. More...
 
bool isPostscriptPrinter (HDC dc)
 Check if PostScript is supported by a printer device context. More...
 

Protected Attributes

bool m_forceGDI
 
- Protected Attributes inherited from ScPrintEngine
bool m_abort
 
QString m_errorMessage
 

Additional Inherited Members

- Public Slots inherited from ScPrintEngine
void cancelRequested (void)
 

Member Function Documentation

bool ScPrintEngine_GDI::gdiPrintPreview ( ScribusDoc doc,
ScPage page,
QImage *  image,
PrintOptions options,
double  scale = 1.0 
)

Draw print preview to an image using gdi method.

Parameters
docthe document whose page is to be preview
pagethe page to be previewed
imagethe image on which preview is to be drawn
optionsprint options
scaleoptional double value for scaling. 1:1 = 1.0
Return values
booltrue on success
Author
Jean Ghali
QString ScPrintEngine_GDI::getDefaultPrinter ( void  )
static

Get the default printer name.

Return values
QStringthe default printer name on success or an empty string
Author
Jean Ghali
int ScPrintEngine_GDI::getPSPassthroughSupport ( HDC  printerDC)
protected

Get support for PostScript Passthrough Get ps passthrough support and escape code.

Parameters
printerDCthe printer device context
Return values
intthe postscript passthrough escape code if success, 0 if the function fails
Author
Jean Ghali
bool ScPrintEngine_GDI::isPostscriptPrinter ( HDC  dc)
protected

Check if PostScript is supported by a printer device context.

Parameters
dcthe printer device context
Return values
boolreturn true if PostScript is supported
Author
Jean Ghali
bool ScPrintEngine_GDI::print ( ScribusDoc doc,
PrintOptions options 
)
virtual

Print a document using gdi or ps methods.

Parameters
docthe document whose pages are to be printer
optionsprint options
Return values
boolreturn true if no error occurred
Author
Jean Ghali

Implements ScPrintEngine.

bool ScPrintEngine_GDI::printerUseFilePort ( QString &  printerName)
protected

Check if a specified printer use the FILE: port.

Parameters
printerNamethe printer name
Return values
boolreturn true if the specified printer print to the FILE: port
Author
Jean Ghali
bool ScPrintEngine_GDI::printPage_GDI ( ScribusDoc doc,
ScPage page,
PrintOptions options,
HDC  printerDC,
cairo_t *  context 
)
protected

Print a page to a gdi printer Print a page using GDI drawing code ( works on all printers : PS, PCL, GDI... )

Parameters
docthe document whose page is to be printed
pagethe page to print
optionsprint options
printerDCan initialized printer device context
contextcairo context (not used by this function)
Return values
booltrue on success
Author
Jean Ghali
bool ScPrintEngine_GDI::printPage_PS ( ScribusDoc doc,
ScPage page,
PrintOptions options,
HDC  printerDC,
cairo_t *  context 
)
protected

Print a page to a PostScript printer using passthroughs Print a page using PS drawing code and PS passthroughs ( works on PS printers only )

Parameters
docthe document whose page is to be printed
pagethe page to print
optionsprint options
printerDCan initialized printer device context
contextcairo context (not used by this function)
Return values
booltrue on success
Author
Jean Ghali
bool ScPrintEngine_GDI::printPage_PS_Sep ( ScribusDoc doc,
ScPage page,
PrintOptions options,
HDC  printerDC,
cairo_t *  context 
)
protected

Print a page separations to a PostScript printer using passthroughs Print a page using PS drawing code and PS passthroughs ( works on PS printers only )

Parameters
docthe document whose page is to be printed
pagethe page to print
optionsprint options
printerDCan initialized printer device context
contextcairo context (not used by this function)
Return values
booltrue on success
Author
Jean Ghali
bool ScPrintEngine_GDI::printPages ( ScribusDoc doc,
PrintOptions options,
HDC  printerDC,
DEVMODEW *  devMode,
QString &  fileName 
)
protected

Print selected pages to a printer or a file.

Parameters
docthe document whose pages are to be printer
optionsprint options
printerDCan initialized printer device context
devModethe DEVMODE structure used for creating printerDC
fileNamefile name to print into
Return values
booltrue on success
Author
Jean Ghali
bool ScPrintEngine_GDI::sendPSFile ( QString  filePath,
HDC  printerDC,
int  pageWidth,
int  pageHeight,
bool  landscape 
)
protected

Send a file to printer using PostScript Passthrough Send a postscript file to a printer using ps passthrough ( works on PS printers only )

Parameters
filePaththe Postscript file path
printerDCthe printer deice context
pageWidthwidth
pageHeightheight landscape the page is to be printer in landscape mode
Return values
booltrue on success
Author
Jean Ghali
void ScPrintEngine_GDI::setDeviceParams ( ScribusDoc doc,
PrintOptions options,
DEVMODEW *  devMode 
)
protected

Set device params into DEVMODE structure according to print options Set printing params according to options and DEVMODE structure.

Parameters
optionsprint options
devModepointer to a DEVMODE structure
Author
Jean Ghali
void ScPrintEngine_GDI::setForceGDI ( bool  force)

Force use of gdi even on ps printers.

Parameters
forceif gdi should be forced
Author
Jean Ghali

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