Base class for the printer classes. More...
#include <ilviews/printing/printer.h>
Public Types | |
enum | Orientation { , Portrait, Landscape } |
This enumeration defines the possible values for the printing orientation. More... | |
Public Member Functions | |
IlvPrinter (IlvDisplay *display) | |
Constructor. More... | |
virtual | ~IlvPrinter () |
Destructor. More... | |
virtual IlBoolean | checkErrorStatus () const =0 |
Checks the error status of the printer. More... | |
void | end () |
Closes the dump device. More... | |
void | forceDialogDisplay (IlBoolean force) |
Sets whether the dialog must be displayed. More... | |
IlvRegion const * | getClip () const |
Gets the current clip of the printer. More... | |
IlvDisplay * | getDisplay () const |
Returns the display. More... | |
IlString | getDocumentName () const |
Returns the document name. More... | |
IlvRect const * | getInitClip () const |
Gets the global clip of the printer. More... | |
void | getMargins (IlvDim &left, IlvDim &right, IlvDim &top, IlvDim &bottom) const |
Returns the printer's physical margins. More... | |
Orientation | getOrientation () const |
Returns the printing orientation. More... | |
IlvPaperFormat const & | getPaperFormat () const |
Returns the paper format. More... | |
virtual IlvDim | getPaperHeight () const =0 |
Returns the height of the paper. More... | |
virtual IlvRect | getPaperSize () const =0 |
Returns the size of the paper. More... | |
virtual IlvDim | getPaperWidth () const =0 |
Returns the width of the paper. More... | |
IlvPort * | getPort () const |
Returns the printer port. More... | |
IlvTransformer const & | getTransformer () const |
Gets the current transformer of the printer. More... | |
virtual IlvRect | getUsableArea () const =0 |
Returns the physical printable area. More... | |
void | initClip (IlvRect const &newClip) |
Sets the global clip of the printer. More... | |
IlBoolean | initialize () |
Initializes the dump device. More... | |
virtual IlBoolean | initializeSettings ()=0 |
Initializes the settings of the printer. More... | |
IlBoolean | isDialogDisplayForced () const |
Returns whether the dialog must be displayed. More... | |
IlBoolean | isDumping () const |
Returns the dumping status. More... | |
virtual IlvPort * | makePort () const =0 |
Creates the port for printing on a real printer. More... | |
void | setClip (IlvRect const &newClip) |
Sets a new clip to the printer. More... | |
void | setClip (IlvRegion const *newClip) |
Sets a new clip to the printer. More... | |
void | setDocumentName (IlString const &name) |
Sets the document name. More... | |
void | setMargins (IlvDim left, IlvDim right, IlvDim top, IlvDim bottom) |
Sets the physical margins for the printer. More... | |
void | setOrientation (Orientation orientation) |
Sets the printing orientation. More... | |
void | setPaperFormat (IlvPaperFormat const &format) |
Sets the paper format. More... | |
void | setPort (IlvPort *port) |
Sets the port used when printing on a real printer. More... | |
void | setTransformer (IlvTransformer const &newTransformer) |
Sets a new transformer to the printer. More... | |
Protected Member Functions | |
virtual void | internalInitClip (IlvRect const &newClip)=0 |
Sets a new global clip to the printer. More... | |
virtual IlBoolean | internalInitialize ()=0 |
Does specific initialization for the dump device. More... | |
virtual void | internalSetClip (IlvRegion const *newClip)=0 |
Sets a new clip to the printer. More... | |
virtual void | internalSetMargins (IlvDim left, IlvDim right, IlvDim top, IlvDim bottom)=0 |
Sets the actual physical margins for the printer. More... | |
virtual void | internalSetOrientation (Orientation orient)=0 |
Implements the actual printing orientation change. More... | |
virtual void | internalSetPaperFormat (IlvPaperFormat const &format)=0 |
Implements the actual paper format selection. More... | |
virtual void | internalSetTransformer (IlvTransformer const &transformer)=0 |
Sets a new transformer to the printer. More... | |
void | setDumpingStatus (IlBoolean status) |
Sets the dumping status. More... | |
Base class for the printer classes.
Library: ilvprint
This class is intended to be derived by implementing the member function makePort()
. Its purpose is to encapsulate the printer information and handling.
IlvPaperFormat
This enumeration defines the possible values for the printing orientation.
mode of the IlvPrinter
.
This mode defines if the printer will print in portrait or landscape.
Enumerator | |
---|---|
Portrait | The orientation is portrait. |
Landscape | The orientation is landscape. |
IlvPrinter::IlvPrinter | ( | IlvDisplay * | display | ) |
Constructor.
This is the constructor. It initializes the object in a coherent state. The default paper size is A4. The default paper mode is IlvPrinter::Printing
. The default paper orientation is IlvPrinter::Portrait
.
|
virtual |
Destructor.
The destructor actually does nothing, but it is declared as virtual so that inherited classes may overload it.
|
pure virtual |
Checks the error status of the printer.
This pure virtual member function must be overloaded in inherited classes.
IlTrue
when the status is no error, IlFalse
otherwise. Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
void IlvPrinter::end | ( | ) |
Closes the dump device.
Closes the dump device and does all the necessary cleaning.
void IlvPrinter::forceDialogDisplay | ( | IlBoolean | force | ) |
Sets whether the dialog must be displayed.
This is meaningful only if a setting dialog is attached to the printer.
force | The new value of the flag to force the display of the dialog. |
IlvRegion const * IlvPrinter::getClip | ( | ) | const |
Gets the current clip of the printer.
IlvDisplay * IlvPrinter::getDisplay | ( | ) | const |
Returns the display.
IlString IlvPrinter::getDocumentName | ( | ) | const |
Returns the document name.
IlvRect const * IlvPrinter::getInitClip | ( | ) | const |
Gets the global clip of the printer.
Returns the printer's physical margins.
Note that a modification of the orientation exchanges the axes, the previous left margin is now the top one, and so on.
left | The left margin. |
right | The right margin. |
top | The top margin. |
bottom | The bottom margin. |
IlvPrinter::Orientation IlvPrinter::getOrientation | ( | ) | const |
Returns the printing orientation.
IlvPaperFormat const & IlvPrinter::getPaperFormat | ( | ) | const |
Returns the paper format.
|
pure virtual |
Returns the height of the paper.
This pure virtual member function must be overloaded in inherited classes.
Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
|
pure virtual |
Returns the size of the paper.
This pure virtual member function must be overloaded in inherited classes.
Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
|
pure virtual |
Returns the width of the paper.
This pure virtual member function must be overloaded in inherited classes.
Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
IlvPort * IlvPrinter::getPort | ( | ) | const |
Returns the printer port.
IlvTransformer const & IlvPrinter::getTransformer | ( | ) | const |
Gets the current transformer of the printer.
|
pure virtual |
Returns the physical printable area.
This is the real size of a sheet of paper minus the printer's borders.
This pure virtual member function must be overloaded in inherited classes.
Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
void IlvPrinter::initClip | ( | IlvRect const & | newClip | ) |
Sets the global clip of the printer.
newClip | The new global clip. |
IlBoolean IlvPrinter::initialize | ( | ) |
Initializes the dump device.
This member function calls the pure virtual member function internalInitialize
.
If this function returns false, it is not necessary to call end()
.
IlFalse
if an error or a cancellation occurred, IlTrue
otherwise. internalInitialize()
. end()
.
|
pure virtual |
Initializes the settings of the printer.
This pure virtual member function must be overloaded in inherited classes.
This function is internally called by IlvPrintableDocument::print()
and IlvPrinterPreviewDialog::get()
.
IlFalse
if an error occurred, IlTrue
otherwise. Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
|
protectedpure virtual |
Sets a new global clip to the printer.
This pure virtual member function must be overloaded in inherited classes. This function is called by IlvPrinter::initClip
.
newClip | The new global clip. |
IlvPrinter::initClip
. Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
|
protectedpure virtual |
Does specific initialization for the dump device.
This pure virtual member function must be overloaded in inherited classes.
IlFalse
if an error occurred, IlTrue
otherwise. initialize()
. Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
|
protectedpure virtual |
Sets a new clip to the printer.
This pure virtual member function must be overloaded in inherited classes. This function is called by IlvPrinter::setClip
.
newClip | The new clip. |
IlvPrinter::setClip
. Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
|
protectedpure virtual |
Sets the actual physical margins for the printer.
left | The left margin. |
right | The right margin. |
top | The top margin. |
bottom | The bottom margin. |
Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
|
protectedpure virtual |
Implements the actual printing orientation change.
orient | The new orientation. |
Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
|
protectedpure virtual |
Implements the actual paper format selection.
This pure virtual member function must be overloaded in inherited classes.
format | The new paper format. |
Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
|
protectedpure virtual |
Sets a new transformer to the printer.
This pure virtual member function must be overloaded in inherited classes. This function is called by IlvPrinter::setTransformer
.
transformer | The new transformer. |
IlvPrinter::setTransformer
. Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
IlBoolean IlvPrinter::isDialogDisplayForced | ( | ) | const |
Returns whether the dialog must be displayed.
This is meaningful only if a setting dialog is attached to the printer.
IlBoolean IlvPrinter::isDumping | ( | ) | const |
Returns the dumping status.
IlTrue
if it is dumping, IlFalse
otherwise.
|
pure virtual |
Creates the port for printing on a real printer.
This pure virtual member function must be overloaded in inherited classes.
Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.
void IlvPrinter::setClip | ( | IlvRect const & | newClip | ) |
Sets a new clip to the printer.
newClip | The new clip. |
void IlvPrinter::setClip | ( | IlvRegion const * | newClip | ) |
Sets a new clip to the printer.
Calls internalSetClip
.
newClip | The new clip. |
internalSetClip
. void IlvPrinter::setDocumentName | ( | IlString const & | name | ) |
Sets the document name.
name | The new document name. |
|
protected |
Sets the dumping status.
status | IlTrue if it is dumping, IlFalse otherwise. |
Sets the physical margins for the printer.
left | The left margin. |
right | The right margin. |
top | The top margin. |
bottom | The bottom margin. |
void IlvPrinter::setOrientation | ( | Orientation | orientation | ) |
Sets the printing orientation.
orientation | The new orientation. |
void IlvPrinter::setPaperFormat | ( | IlvPaperFormat const & | format | ) |
Sets the paper format.
format | The new paper format. |
void IlvPrinter::setPort | ( | IlvPort * | port | ) |
Sets the port used when printing on a real printer.
port | The new printing port. |
void IlvPrinter::setTransformer | ( | IlvTransformer const & | newTransformer | ) |
Sets a new transformer to the printer.
newTransformer | The new transformer. |