Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Types | Public Member Functions | Protected Member Functions
IlvPrinter Class Referenceabstract

Base class for the printer classes. More...

#include <ilviews/printing/printer.h>

Inheritance diagram for IlvPrinter:
IlvPrinterPreview IlvPSPrinter IlvWindowsPrinter

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...
 
IlvDisplaygetDisplay () 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...
 
IlvPortgetPort () 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 IlvPortmakePort () 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 internalEnd ()=0
 Performs specific cleanup for the dump device. More...
 
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...
 

Detailed Description

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.

See also
IlvPaperFormat

Member Enumeration Documentation

◆ Orientation

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.

Constructor & Destructor Documentation

◆ IlvPrinter()

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.

◆ ~IlvPrinter()

virtual IlvPrinter::~IlvPrinter ( )
virtual

Destructor.

The destructor actually does nothing, but it is declared as virtual so that inherited classes may overload it.

Member Function Documentation

◆ checkErrorStatus()

virtual IlBoolean IlvPrinter::checkErrorStatus ( ) const
pure virtual

Checks the error status of the printer.

This pure virtual member function must be overloaded in inherited classes.

Returns
IlTrue when the status is no error, IlFalse otherwise.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ end()

void IlvPrinter::end ( )

Closes the dump device.

Closes the dump device and does all the necessary cleaning.

◆ forceDialogDisplay()

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.

Parameters
forceThe new value of the flag to force the display of the dialog.

◆ getClip()

IlvRegion const * IlvPrinter::getClip ( ) const

Gets the current clip of the printer.

Returns
The current clip.

◆ getDisplay()

IlvDisplay * IlvPrinter::getDisplay ( ) const

Returns the display.

Returns
The display.

◆ getDocumentName()

IlString IlvPrinter::getDocumentName ( ) const

Returns the document name.

Returns
The document name.

◆ getInitClip()

IlvRect const * IlvPrinter::getInitClip ( ) const

Gets the global clip of the printer.

Returns
The global clip.

◆ getMargins()

void IlvPrinter::getMargins ( IlvDim left,
IlvDim right,
IlvDim top,
IlvDim bottom 
) const

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.

Parameters
leftThe left margin.
rightThe right margin.
topThe top margin.
bottomThe bottom margin.

◆ getOrientation()

IlvPrinter::Orientation IlvPrinter::getOrientation ( ) const

Returns the printing orientation.

Returns
The printing orientation.

◆ getPaperFormat()

IlvPaperFormat const & IlvPrinter::getPaperFormat ( ) const

Returns the paper format.

Returns
The paper format.

◆ getPaperHeight()

virtual IlvDim IlvPrinter::getPaperHeight ( ) const
pure virtual

Returns the height of the paper.

This pure virtual member function must be overloaded in inherited classes.

Returns
The height of the paper.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ getPaperSize()

virtual IlvRect IlvPrinter::getPaperSize ( ) const
pure virtual

Returns the size of the paper.

This pure virtual member function must be overloaded in inherited classes.

Returns
The size of the paper.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ getPaperWidth()

virtual IlvDim IlvPrinter::getPaperWidth ( ) const
pure virtual

Returns the width of the paper.

This pure virtual member function must be overloaded in inherited classes.

Returns
The width of the paper.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ getPort()

IlvPort * IlvPrinter::getPort ( ) const

Returns the printer port.

Returns
The printer port.

◆ getTransformer()

IlvTransformer const & IlvPrinter::getTransformer ( ) const

Gets the current transformer of the printer.

Returns
The current transformer.

◆ getUsableArea()

virtual IlvRect IlvPrinter::getUsableArea ( ) const
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.

Returns
The usable physical printable area.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ initClip()

void IlvPrinter::initClip ( IlvRect const &  newClip)

Sets the global clip of the printer.

Parameters
newClipThe new global clip.

◆ initialize()

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().

Returns
IlFalse if an error or a cancellation occurred, IlTrue otherwise.
See also
internalInitialize().
end().

◆ initializeSettings()

virtual IlBoolean IlvPrinter::initializeSettings ( )
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().

Returns
IlFalse if an error occurred, IlTrue otherwise.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ internalEnd()

virtual void IlvPrinter::internalEnd ( )
protectedpure virtual

Performs specific cleanup for the dump device.

This pure virtual member function must be overloaded in inherited classes.

See also
internalInitialize().

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ internalInitClip()

virtual void IlvPrinter::internalInitClip ( IlvRect const &  newClip)
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.

Parameters
newClipThe new global clip.
See also
IlvPrinter::initClip.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ internalInitialize()

virtual IlBoolean IlvPrinter::internalInitialize ( )
protectedpure virtual

Does specific initialization for the dump device.

This pure virtual member function must be overloaded in inherited classes.

Returns
IlFalse if an error occurred, IlTrue otherwise.
See also
initialize().

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ internalSetClip()

virtual void IlvPrinter::internalSetClip ( IlvRegion const *  newClip)
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.

Parameters
newClipThe new clip.
See also
IlvPrinter::setClip.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ internalSetMargins()

virtual void IlvPrinter::internalSetMargins ( IlvDim  left,
IlvDim  right,
IlvDim  top,
IlvDim  bottom 
)
protectedpure virtual

Sets the actual physical margins for the printer.

Parameters
leftThe left margin.
rightThe right margin.
topThe top margin.
bottomThe bottom margin.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ internalSetOrientation()

virtual void IlvPrinter::internalSetOrientation ( Orientation  orient)
protectedpure virtual

Implements the actual printing orientation change.

Parameters
orientThe new orientation.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ internalSetPaperFormat()

virtual void IlvPrinter::internalSetPaperFormat ( IlvPaperFormat const &  format)
protectedpure virtual

Implements the actual paper format selection.

This pure virtual member function must be overloaded in inherited classes.

Parameters
formatThe new paper format.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ internalSetTransformer()

virtual void IlvPrinter::internalSetTransformer ( IlvTransformer const &  transformer)
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.

Parameters
transformerThe new transformer.
See also
IlvPrinter::setTransformer.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ isDialogDisplayForced()

IlBoolean IlvPrinter::isDialogDisplayForced ( ) const

Returns whether the dialog must be displayed.

This is meaningful only if a setting dialog is attached to the printer.

Returns
Whether the dialog must be displayed.

◆ isDumping()

IlBoolean IlvPrinter::isDumping ( ) const

Returns the dumping status.

Returns
IlTrue if it is dumping, IlFalse otherwise.

◆ makePort()

virtual IlvPort* IlvPrinter::makePort ( ) const
pure virtual

Creates the port for printing on a real printer.

This pure virtual member function must be overloaded in inherited classes.

Returns
The printer port.

Implemented in IlvWindowsPrinter, IlvPSPrinter, and IlvPrinterPreview.

◆ setClip() [1/2]

void IlvPrinter::setClip ( IlvRect const &  newClip)

Sets a new clip to the printer.

Parameters
newClipThe new clip.

◆ setClip() [2/2]

void IlvPrinter::setClip ( IlvRegion const *  newClip)

Sets a new clip to the printer.

Calls internalSetClip.

Parameters
newClipThe new clip.
See also
internalSetClip.

◆ setDocumentName()

void IlvPrinter::setDocumentName ( IlString const &  name)

Sets the document name.

Parameters
nameThe new document name.

◆ setDumpingStatus()

void IlvPrinter::setDumpingStatus ( IlBoolean  status)
protected

Sets the dumping status.

Parameters
statusIlTrue if it is dumping, IlFalse otherwise.

◆ setMargins()

void IlvPrinter::setMargins ( IlvDim  left,
IlvDim  right,
IlvDim  top,
IlvDim  bottom 
)

Sets the physical margins for the printer.

Parameters
leftThe left margin.
rightThe right margin.
topThe top margin.
bottomThe bottom margin.

◆ setOrientation()

void IlvPrinter::setOrientation ( Orientation  orientation)

Sets the printing orientation.

Parameters
orientationThe new orientation.

◆ setPaperFormat()

void IlvPrinter::setPaperFormat ( IlvPaperFormat const &  format)

Sets the paper format.

Parameters
formatThe new paper format.

◆ setPort()

void IlvPrinter::setPort ( IlvPort port)

Sets the port used when printing on a real printer.

Parameters
portThe new printing port.

◆ setTransformer()

void IlvPrinter::setTransformer ( IlvTransformer const &  newTransformer)

Sets a new transformer to the printer.

Parameters
newTransformerThe new transformer.