rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave 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 (IlvRegion const *newClip)
 Sets a new clip to the printer. More...
 
void setClip (IlvRect 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...
 

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

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

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 IlvPSPrinter, IlvWindowsPrinter, 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.

Parameters
forceThe new value of the flag to force the display of the dialog.
IlvRegion const * IlvPrinter::getClip ( ) const

Gets the current clip of the printer.

Returns
The current clip.
IlvDisplay * IlvPrinter::getDisplay ( ) const

Returns the display.

Returns
The display.
IlString IlvPrinter::getDocumentName ( ) const

Returns the document name.

Returns
The document name.
IlvRect const * IlvPrinter::getInitClip ( ) const

Gets the global clip of the printer.

Returns
The global clip.
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.
IlvPrinter::Orientation IlvPrinter::getOrientation ( ) const

Returns the printing orientation.

Returns
The printing orientation.
IlvPaperFormat const & IlvPrinter::getPaperFormat ( ) const

Returns the paper format.

Returns
The paper format.
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 IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

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 IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

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 IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

IlvPort * IlvPrinter::getPort ( ) const

Returns the printer port.

Returns
The printer port.
IlvTransformer const & IlvPrinter::getTransformer ( ) const

Gets the current transformer of the printer.

Returns
The current transformer.
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 IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

void IlvPrinter::initClip ( IlvRect const &  newClip)

Sets the global clip of the printer.

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

Returns
IlFalse if an error or a cancellation occurred, IlTrue otherwise.
See Also
internalInitialize().
end().
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 IlvPSPrinter, IlvPrinterPreview, and IlvWindowsPrinter.

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 IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

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 IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

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 IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

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 IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

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

Implements the actual printing orientation change.

Parameters
orientThe new orientation.

Implemented in IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

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 IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

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 IlvPSPrinter, IlvWindowsPrinter, 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.

Returns
Whether the dialog must be displayed.
IlBoolean IlvPrinter::isDumping ( ) const

Returns the dumping status.

Returns
IlTrue if it is dumping, IlFalse otherwise.
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 IlvPSPrinter, IlvWindowsPrinter, and IlvPrinterPreview.

void IlvPrinter::setClip ( IlvRegion const *  newClip)

Sets a new clip to the printer.

Calls internalSetClip.

Parameters
newClipThe new clip.
See Also
internalSetClip.
void IlvPrinter::setClip ( IlvRect const &  newClip)

Sets a new clip to the printer.

Parameters
newClipThe new clip.
void IlvPrinter::setDocumentName ( IlString const &  name)

Sets the document name.

Parameters
nameThe new document name.
void IlvPrinter::setDumpingStatus ( IlBoolean  status)
protected

Sets the dumping status.

Parameters
statusIlTrue if it is dumping, IlFalse otherwise.
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.
void IlvPrinter::setOrientation ( Orientation  orientation)

Sets the printing orientation.

Parameters
orientationThe new orientation.
void IlvPrinter::setPaperFormat ( IlvPaperFormat const &  format)

Sets the paper format.

Parameters
formatThe new paper format.
void IlvPrinter::setPort ( IlvPort port)

Sets the port used when printing on a real printer.

Parameters
portThe new printing port.
void IlvPrinter::setTransformer ( IlvTransformer const &  newTransformer)

Sets a new transformer to the printer.

Parameters
newTransformerThe new transformer.

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.