class PPrintInfo: public PObject

This class defines the setup parameters for a printer.

Inheritance:


Public Classes

[more]enum Forms
Standard paper sizes for printer setup.
[more]enum SelectionOnly
Options for printing selected "items" only.

Public Methods

[more] PPrintInfo ()
Create an object to encapsulate printing information.
[more]PString GetPrinter () const
Get the printer type name that this printer setup information is for.
[more]PString GetDevice () const
Get the printer device name that this printer setup information is for.
[more]void SetForm ( Forms newForm )
Set the print form used.
[more]Forms GetForm () const
Get the print form used.
[more]void SetPaperSize ( const PDim & dim )
Set the paper size in tenths of a millimeter.
[more]PDim GetPaperSize () const
Get the paper size in tenths of a millimeter.
[more]PDim GetResolution () const
Get the printer device resolution in dots per inch for the horizontal and vertical dimensions.
[more]void SetCopies ( unsigned count )
Set the number of copies to be produced by the print job.
[more]unsigned GetCopies () const
Get the number of copies to be produced by the print job.
[more]void SetPortrait ( BOOL port = TRUE )
Set the paper orientation.
[more]void SetLandscape ()
Set the paper orientation to landscape.
[more]BOOL IsPortrait () const
Determine the paper orientation.
[more]BOOL IsDraftQuality () const
Determine if printer quality is in draft mode, otherwise final or letter quality mode is used.
[more]void SetStartPage ( unsigned page )
Set the starting page for the print job.
[more]unsigned GetStartPage () const
Get the starting page for the print job.
[more]void SetEndPage ( unsigned page )
Set the ending page for the print job.
[more]unsigned GetEndPage () const
Set the ending page for the print job.
[more]void SetSelectionOnly ( SelectionOnly selOnly )
Set the flag for if the selection in the document is to be printed.
[more]SelectionOnly GetSelectionOnly () const
Get the flag for if the selection in the document is to be printed.
[more]BOOL IsSelectionOnly () const
Simplification of the GetSelectionOnly() function which indicates that the document selection is to be printed.

Public

[more] New members for class

Protected Fields

[more]PString printer
Printer type string.
[more]PString device
Printer device string.
[more]Forms form
Standard paper size for setup.
[more]PDim paperSize
Current forms paper fize in tenths of a millimeter.
[more]PDim resolution
Current printer types resultion in dots per inch.
[more]unsigned startPage
First page to print.
[more]unsigned endPage
Last page to print.
[more]SelectionOnly selectionOnly
Print the selection
[more]unsigned copies
Number of copies to print.
[more]BOOL orientation
Page orientation, TRUE is portrait mode.
[more]BOOL draftQuality
Printer is to print in draft quality.


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Documentation

This class defines the setup parameters for a printer. Instances of this class are usually created by the PPrintJobDialog or PPrinterSetupDialog standard dialogs.

Not all of the specified parameters will have an effect on all platforms, or even on all printers for a particular platform.

o PPrintInfo()
Create an object to encapsulate printing information. The first form selects the system default printer and port, the second allows an arbitrary printer and port to be specified by the application.

It is possible for there to be a different setup for the same printer type on different devices, eg a "postscript" printer type on "LPT1" is only A4 but on "LPT2" is capabile of A3.

Explicit selection of a printer type and device is rare as the string contents are platform dependent. It is possible though that they may come from a configuration file that is itself platform dependent.

o New members for class

oPString GetPrinter() const
Get the printer type name that this printer setup information is for.

Returns:
string name of the printer type.

oPString GetDevice() const
Get the printer device name that this printer setup information is for.

Returns:
string name of the printer device.

oenum Forms
Standard paper sizes for printer setup.

o Custom
Custom form size, the page size must be set by the SetPaperSize() function if this form type is used

o A3
Standard metric A3 size paper.

o A4
Standard metric A4 size paper.

o A5
Standard metric A5 size paper.

o B4
Standard metric B4 size paper.

o B5
Standard metric B5 size paper.

o USLetter
Standard US letter size paper.

o USLegal
Standard US legal size paper.

o MaxForm
Total number of form types thsi setup can understand.

ovoid SetForm( Forms newForm )
Set the print form used. This can be a standard paper size or the Custom value which allows arbitrary paper sizes.

Note that not all printers will take any notice of this parameter.

Parameters:
newForm - New standard paper size for printer setup.

oForms GetForm() const
Get the print form used. This can be a standard paper size or the Custom value which allows arbitrary paper sizes.

Note that not all printers will take any notice of this parameter.

Returns:
current form for printer setup.

ovoid SetPaperSize( const PDim & dim )
Set the paper size in tenths of a millimeter. A call to this function will automatically set the form type to Custom.

Note that not all printers will take any notice of this parameter.

Parameters:
dim - Dimensions of the paper page.

oPDim GetPaperSize() const
Get the paper size in tenths of a millimeter. If the form is Custom then the value set in SetPaperSize() is returned. If a standard form is selected, eg A4, then the size of the standard form is returned.

Returns:
current paper size.

oPDim GetResolution() const
Get the printer device resolution in dots per inch for the horizontal and vertical dimensions. Usually these are the same but some dot matrix or ink jet printers cannot render vertically as well as horizontally.

Returns:
printer resolution in DPI.

ovoid SetCopies( unsigned count )
Set the number of copies to be produced by the print job.
Parameters:
count - Number of copies to print.

ounsigned GetCopies() const
Get the number of copies to be produced by the print job.

Returns:
total copies to print.

ovoid SetPortrait( BOOL port = TRUE )
Set the paper orientation. The printing can be either portrait or landscape.
Parameters:
port - Flag for portrait (TRUE) or landscape (FALSE).

ovoid SetLandscape()
Set the paper orientation to landscape. This is equivalent to SetPortrait(FALSE).

oBOOL IsPortrait() const
Determine the paper orientation.

Returns:
TRUE if paper is in portait mode, FALSE if landscape.

oBOOL IsDraftQuality() const
Determine if printer quality is in draft mode, otherwise final or letter quality mode is used. Some printers, eg lasers, are never in draft quality mode.

Returns:
TRUE if printing is in draft quality.

ovoid SetStartPage( unsigned page )
Set the starting page for the print job. This is effectively a count of pages to skip before outputing data. Page 1 is the first page and will print from the start of the print job.

Note if the Start page is set to zero, then the ability to set the page range is disabled.

Parameters:
page - First page to print.

ounsigned GetStartPage() const
Get the starting page for the print job. This is effectively a count of pages to skip before outputing data. Page 1 is the first page and will print from the start of the print job.

Note if the Start page is set to zero, then the ability to set the page range is disabled.

Returns:
first page to print.

ovoid SetEndPage( unsigned page )
Set the ending page for the print job. Page 1 is the first page and will print only that page. Use 0 or a very large number to print through to the end of the print job.
Parameters:
page - Last page to print.

ounsigned GetEndPage() const
Set the ending page for the print job. Page 1 is the first page and will print only that page. Use 0 or a very large number to print through to the end of the print job.

Returns:
last page to print.

oenum SelectionOnly
Options for printing selected "items" only.

o NoSelectionOnly
There is no such option as print selection.

o SelectionOnlyOff
Print selection is available but is not required.

o SelectionOnlyOn
Only print the selection.

ovoid SetSelectionOnly( SelectionOnly selOnly )
Set the flag for if the selection in the document is to be printed. If the NoSelectionOnly valus is used then there is no provision for the user to indicate that only the selction is to be printed.

oSelectionOnly GetSelectionOnly() const
Get the flag for if the selection in the document is to be printed. If the NoSelectionOnly valus is used then there is no provision for the user to indicate that only the selction is to be printed.

Returns:
Current selection only print flag state.

oBOOL IsSelectionOnly() const
Simplification of the GetSelectionOnly() function which indicates that the document selection is to be printed.

Returns:
TRUE if selection is to be printed.

oPString printer
Printer type string.

oPString device
Printer device string.

oForms form
Standard paper size for setup.

oPDim paperSize
Current forms paper fize in tenths of a millimeter.

oPDim resolution
Current printer types resultion in dots per inch.

ounsigned startPage
First page to print.

ounsigned endPage
Last page to print.

oSelectionOnly selectionOnly
Print the selection

ounsigned copies
Number of copies to print.

oBOOL orientation
Page orientation, TRUE is portrait mode.

oBOOL draftQuality
Printer is to print in draft quality.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.