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 Member Functions | Protected Member Functions
IlvPrintableLayout Class Referenceabstract

Base class for the layout classes. More...

#include <ilviews/printing/layout.h>

Inheritance diagram for IlvPrintableLayout:
IlvPrintableLayoutMultiplePages IlvPrintableLayoutOnePage IlvPrintableLayoutFixedSize IlvPrintableLayoutIdentity

Public Member Functions

 IlvPrintableLayout ()
 Default constructor. More...
 
virtual ~IlvPrintableLayout ()
 Destructor. More...
 
IlvPrintableArea const & getBackgroundArea (IlvPrintableJob &job, int pageIndex) const
 Gets the updated background area. More...
 
IlvPrintablegetBackgroundPrintable () const
 Gets the IlvPrintable used to print the background. More...
 
IlvDim getBottomMargin () const
 Returns the bottom margin. More...
 
IlvPrintableArea const & getFooterArea (IlvPrintableJob &job, int pageIndex) const
 Gets the updated footer area. More...
 
virtual IlvDim getFooterAreaHeight () const =0
 Returns the height of the footer area. More...
 
IlvPrintablegetFooterPrintable () const
 Gets the IlvPrintable used to print the footer. More...
 
IlvPrintableArea const & getForegroundArea (IlvPrintableJob &job, int pageIndex) const
 Gets the updated foreground area. More...
 
IlvPrintablegetForegroundPrintable () const
 Gets the IlvPrintable used to print the foreground. More...
 
IlvDim getGutterMargin () const
 Returns the gutter margin. More...
 
IlvPrintableArea const & getHeaderArea (IlvPrintableJob &job, int pageIndex) const
 Gets the updated header area. More...
 
virtual IlvDim getHeaderAreaHeight () const =0
 Returns the height of the header area. More...
 
IlvPrintablegetHeaderPrintable () const
 Gets the IlvPrintable used to print the header. More...
 
IlvDim getLeftMargin () const
 Returns the left margin. More...
 
IlvPrintableArea const & getMainArea (IlvPrintableJob &job, int pageIndex) const
 Gets the updated main area. More...
 
void getMargins (IlvDim &left, IlvDim &right, IlvDim &top, IlvDim &bottom, IlvDim &gutter) const
 Returns the margins. More...
 
IlUInt getRefCount () const
 Returns the number of references on this instance. More...
 
IlvDim getRightMargin () const
 Returns the right margin. More...
 
IlvDim getTopMargin () const
 Returns the top margin. More...
 
IlvRect getUsableArea (IlvPrinter const &printer, IlBoolean isGutterOnLeft=IlTrue) const
 Returns the usable logical printable area for a page. More...
 
IlBoolean isRatioKept () const
 Returns whether the ratio is kept. More...
 
void lock ()
 Locks the current instance. More...
 
IlBoolean print (IlvPrintableJob &job, int copyNumber) const
 Prints an IlvPrintable according to the layout specified by this object. More...
 
void setBackgroundPrintable (IlvPrintable *printable)
 Sets the IlvPrintable used to print the background. More...
 
void setBottomMargin (IlvDim margin)
 Sets the bottom margin. More...
 
virtual void setFooterAreaHeight (IlvDim height)=0
 Sets the height of the footer area. More...
 
void setFooterPrintable (IlvPrintable *printable)
 Sets the IlvPrintable used to print the footer. More...
 
void setForegroundPrintable (IlvPrintable *printable)
 Sets the IlvPrintable used to print the foreground. More...
 
void setGutterMargin (IlvDim margin)
 Sets the gutter margin. More...
 
virtual void setHeaderAreaHeight (IlvDim height)=0
 Sets the height of the header area. More...
 
void setHeaderPrintable (IlvPrintable *printable)
 Sets the IlvPrintable used to print the header. More...
 
void setKeepingRatio (IlBoolean keepRatio)
 Sets whether the ratio is kept. More...
 
void setLeftMargin (IlvDim margin)
 Sets the left margin. More...
 
void setMargins (IlvDim left, IlvDim right, IlvDim top, IlvDim bottom, IlvDim gutter=0)
 Sets the margins. More...
 
void setRightMargin (IlvDim margin)
 Sets the right margin. More...
 
void setTopMargin (IlvDim margin)
 Sets the top margin. More...
 
void unlock ()
 Unlocks the current instance. More...
 

Protected Member Functions

IlvPrintableAreagetBackgroundArea () const
 Gets the background area. More...
 
IlvPrintableAreagetFooterArea () const
 Gets the footer area. More...
 
IlvPrintableAreagetForegroundArea () const
 Gets the foreground area. More...
 
IlvPrintableAreagetHeaderArea () const
 Gets the header area. More...
 
IlvPrintableAreagetMainArea () const
 Gets the main area. More...
 
virtual int getPageNumber (IlvPrintableJob &job) const =0
 Gets the number of logical pages for this layout and the print settings given as argument. More...
 
virtual void initializeBackgroundArea (IlvPrintableJob &job) const =0
 Initializes the background area. More...
 
virtual void initializeFooterArea (IlvPrintableJob &job) const =0
 Initializes the footer area. More...
 
virtual void initializeForegroundArea (IlvPrintableJob &job) const =0
 Initializes the foreground area. More...
 
virtual void initializeHeaderArea (IlvPrintableJob &job) const =0
 Initializes the header area. More...
 
virtual void initializeMainArea (IlvPrintableJob &job) const =0
 Initializes the main area. More...
 
void setBackgroundArea (IlvPrintableArea *area) const
 Sets the background area. More...
 
void setFooterArea (IlvPrintableArea *area) const
 Sets the footer area. More...
 
void setForegroundArea (IlvPrintableArea *area) const
 Sets the foreground area. More...
 
void setHeaderArea (IlvPrintableArea *area) const
 Sets the header area. More...
 
void setMainArea (IlvPrintableArea *area) const
 Sets the main area. More...
 
virtual void updateBackgroundArea (IlvPrintableJob &job, int pageIndex) const =0
 Updates the background area. More...
 
virtual void updateFooterArea (IlvPrintableJob &job, int pageIndex) const =0
 Updates the footer area. More...
 
virtual void updateForegroundArea (IlvPrintableJob &job, int pageIndex) const =0
 Updates the foreground area. More...
 
virtual void updateHeaderArea (IlvPrintableJob &job, int pageIndex) const =0
 Updates the header area. More...
 
virtual void updateMainArea (IlvPrintableJob &job, int pageIndex) const =0
 Updates the main area. More...
 

Detailed Description

Base class for the layout classes.

Library: ilvprint

This class is intended to be inherited by implementing the virtual member functions.

Its purpose is to describe a way of mapping the IlvPrintable to the physical page layout.

This class defines left, right, top, bottom, and gutter margins as described in the following figure:

It also defines if the layout keeps the input's aspect ratio.

Warning
[note] The copy constructor and the assignment operator are available although they are not explicitly declared and defined.
See Also
IlvPrintableDocument::append

Constructor & Destructor Documentation

IlvPrintableLayout::IlvPrintableLayout ( )

Default constructor.

This is the default constructor. It initializes the object in a coherent state. The inherited classes must initialize the five areas. There are no additional margins by default.

virtual IlvPrintableLayout::~IlvPrintableLayout ( )
virtual

Destructor.

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

Member Function Documentation

IlvPrintableArea const& IlvPrintableLayout::getBackgroundArea ( IlvPrintableJob job,
int  pageIndex 
) const

Gets the updated background area.

The purpose of this function is to update and return the IlvPrintableArea background object. The job as well as the page index given as parameters may be used to update the current size of the area, done through the virtual member function updateForegroundArea.

Parameters
jobThe current print settings.
pageIndexThe current logical page index (for this layout).
Returns
The background area.
See Also
updateBackgroundArea.
IlvPrintableArea & IlvPrintableLayout::getBackgroundArea ( ) const
protected

Gets the background area.

Returns
A reference to the background area.
IlvPrintable * IlvPrintableLayout::getBackgroundPrintable ( ) const

Gets the IlvPrintable used to print the background.

Returns
The background printable.
IlvDim IlvPrintableLayout::getBottomMargin ( ) const

Returns the bottom margin.

Returns
The bottom margin.
IlvPrintableArea const& IlvPrintableLayout::getFooterArea ( IlvPrintableJob job,
int  pageIndex 
) const

Gets the updated footer area.

The purpose of this function is to update and return the IlvPrintableArea footer object. The job as well as the page index given as parameters may be used to update the current size of the area, done through the virtual member function updateFooterArea.

Parameters
jobThe current print settings.
pageIndexThe current logical page index (for this layout).
Returns
The footer area.
See Also
updateFooterArea.
IlvPrintableArea & IlvPrintableLayout::getFooterArea ( ) const
protected

Gets the footer area.

Returns
A reference to the footer area.
virtual IlvDim IlvPrintableLayout::getFooterAreaHeight ( ) const
pure virtual

Returns the height of the footer area.

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

Returns
The height of the footer area.

Implemented in IlvPrintableLayoutMultiplePages, and IlvPrintableLayoutOnePage.

IlvPrintable * IlvPrintableLayout::getFooterPrintable ( ) const

Gets the IlvPrintable used to print the footer.

Returns
The footer printable.
IlvPrintableArea const& IlvPrintableLayout::getForegroundArea ( IlvPrintableJob job,
int  pageIndex 
) const

Gets the updated foreground area.

The purpose of this function is to update and return the IlvPrintableArea foreground object. The job as well as the page index given as parameters may be used to update the current size of the area, done through the virtual member function updateForegroundArea.

Parameters
jobThe current print settings.
pageIndexThe current logical page index (for this layout).
Returns
The foreground area.
See Also
updateForegroundArea.
IlvPrintableArea & IlvPrintableLayout::getForegroundArea ( ) const
protected

Gets the foreground area.

Returns
A reference to the foreground area.
IlvPrintable * IlvPrintableLayout::getForegroundPrintable ( ) const

Gets the IlvPrintable used to print the foreground.

Returns
The foreground printable.
IlvDim IlvPrintableLayout::getGutterMargin ( ) const

Returns the gutter margin.

Returns
The gutter margin.
IlvPrintableArea const& IlvPrintableLayout::getHeaderArea ( IlvPrintableJob job,
int  pageIndex 
) const

Gets the updated header area.

The purpose of this function is to update and return the IlvPrintableArea header object. The job as well as the page index given as parameters may be used to update the current size of the area, done through the virtual member function updateHeaderArea.

Parameters
jobThe current print settings.
pageIndexThe current logical page index (for this layout).
Returns
The header area.
See Also
updateHeaderArea.
IlvPrintableArea & IlvPrintableLayout::getHeaderArea ( ) const
protected

Gets the header area.

Returns
A reference to the header area.
virtual IlvDim IlvPrintableLayout::getHeaderAreaHeight ( ) const
pure virtual

Returns the height of the header area.

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

Returns
The height of the header area.

Implemented in IlvPrintableLayoutMultiplePages, and IlvPrintableLayoutOnePage.

IlvPrintable * IlvPrintableLayout::getHeaderPrintable ( ) const

Gets the IlvPrintable used to print the header.

Returns
The header printable.
IlvDim IlvPrintableLayout::getLeftMargin ( ) const

Returns the left margin.

Returns
The left margin.
IlvPrintableArea const& IlvPrintableLayout::getMainArea ( IlvPrintableJob job,
int  pageIndex 
) const

Gets the updated main area.

The purpose of this function is to update and return the IlvPrintableArea main object. The job as well as the page index given as parameters may be used to update the current size of the area, done through the virtual member function updateMainArea.

Parameters
jobThe current print settings.
pageIndexThe current logical page index (for this layout).
Returns
The main area.
See Also
updateMainArea.
IlvPrintableArea & IlvPrintableLayout::getMainArea ( ) const
protected

Gets the main area.

Returns
A reference to the main area.
void IlvPrintableLayout::getMargins ( IlvDim left,
IlvDim right,
IlvDim top,
IlvDim bottom,
IlvDim gutter 
) const

Returns the margins.

Parameters
leftThe left margin.
rightThe right margin.
topThe top margin.
bottomThe bottom margin.
gutterThe gutter margin.
virtual int IlvPrintableLayout::getPageNumber ( IlvPrintableJob job) const
protectedpure virtual

Gets the number of logical pages for this layout and the print settings given as argument.

This pure virtual function must be overloaded in inherited classes.

Parameters
jobThe current print settings.
Returns
The number of logical pages.

Implemented in IlvPrintableLayoutFixedSize, IlvPrintableLayoutIdentity, IlvPrintableLayoutMultiplePages, and IlvPrintableLayoutOnePage.

IlUInt IlvPrintableLayout::getRefCount ( ) const

Returns the number of references on this instance.

Returns
The number of references.
IlvDim IlvPrintableLayout::getRightMargin ( ) const

Returns the right margin.

Returns
The right margin.
IlvDim IlvPrintableLayout::getTopMargin ( ) const

Returns the top margin.

Returns
The top margin.
IlvRect IlvPrintableLayout::getUsableArea ( IlvPrinter const &  printer,
IlBoolean  isGutterOnLeft = IlTrue 
) const

Returns the usable logical printable area for a page.

This is the size available for the printing.

The gutter is taken into account on the left or right side according to the Boolean parameter.

If printer is an IlvWindowsPrinterinstance, before using this method,the internal attributes of the printer must be initialized through a call to IlvPrinter::initializeSettings().

Parameters
printerThe printer from which the physical area is taken.
isGutterOnLeftIlTrue means that the gutter must be on the left side of the paper.
Returns
The usable logical printable area.
virtual void IlvPrintableLayout::initializeBackgroundArea ( IlvPrintableJob job) const
protectedpure virtual

Initializes the background area.

This pure virtual member function must be overloaded by inherited classes. Its purpose is to initialize the background area. It is called at the beginning of the print member function, before the loop on the pages.

Parameters
jobThe current print settings.
See Also
print.

Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.

virtual void IlvPrintableLayout::initializeFooterArea ( IlvPrintableJob job) const
protectedpure virtual

Initializes the footer area.

This pure virtual member function must be overloaded by inherited classes. Its purpose is to initialize the footer area. It is called at the beginning of the print member function, before the loop on the pages.

Parameters
jobThe current print settings.
See Also
print.

Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.

virtual void IlvPrintableLayout::initializeForegroundArea ( IlvPrintableJob job) const
protectedpure virtual

Initializes the foreground area.

This pure virtual member function must be overloaded by inherited classes. Its purpose is to initialize the foreground area. It is called at the beginning of the print member function, before the loop on the pages.

Parameters
jobThe current print settings.
See Also
print.

Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.

virtual void IlvPrintableLayout::initializeHeaderArea ( IlvPrintableJob job) const
protectedpure virtual

Initializes the header area.

This pure virtual member function must be overloaded by inherited classes. Its purpose is to initialize the header area. It is called at the beginning of the print member function, before the loop on the pages.

Parameters
jobThe current print settings.
See Also
print.

Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.

virtual void IlvPrintableLayout::initializeMainArea ( IlvPrintableJob job) const
protectedpure virtual

Initializes the main area.

This pure virtual member function must be overloaded by inherited classes. Its purpose is to initialize the main area. It is called at the beginning of the print member function, before the loop on the pages.

Parameters
jobThe current print settings.
See Also
print.

Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.

IlBoolean IlvPrintableLayout::isRatioKept ( ) const

Returns whether the ratio is kept.

Returns
A Boolean value indicating whether the ratio is kept.
void IlvPrintableLayout::lock ( )

Locks the current instance.

A reference counter is incremented internally.

IlBoolean IlvPrintableLayout::print ( IlvPrintableJob job,
int  copyNumber 
) const

Prints an IlvPrintable according to the layout specified by this object.

The IlvPrintableJob references the IlvPrintable as well as other settings.

The function calls the print method on every printable referenced by the current object and by the job for each page specified by this layout.

Parameters
jobThe current printable job.
copyNumberThe number of copies to print.
Returns
IlFalse when an error occurred during the print, IlTrue otherwise.
void IlvPrintableLayout::setBackgroundArea ( IlvPrintableArea area) const
protected

Sets the background area.

This function is intended to be called in the constructors of the inherited classes.

Parameters
areaThe background area.
void IlvPrintableLayout::setBackgroundPrintable ( IlvPrintable printable)

Sets the IlvPrintable used to print the background.

This function creates the background area. If the printable is null, an IlvPrintableNullArea is created; otherwise an IlvPrintableActualArea.

Parameters
printableThe printable to store.
void IlvPrintableLayout::setBottomMargin ( IlvDim  margin)

Sets the bottom margin.

Parameters
marginThe new bottom margin.
void IlvPrintableLayout::setFooterArea ( IlvPrintableArea area) const
protected

Sets the footer area.

This function is intended to be called in the constructors of the inherited classes.

Parameters
areaThe footer area.
virtual void IlvPrintableLayout::setFooterAreaHeight ( IlvDim  height)
pure virtual

Sets the height of the footer area.

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

Parameters
heightThe height of the footer area.

Implemented in IlvPrintableLayoutMultiplePages, and IlvPrintableLayoutOnePage.

void IlvPrintableLayout::setFooterPrintable ( IlvPrintable printable)

Sets the IlvPrintable used to print the footer.

This function creates the footer area. If the printable is null, an IlvPrintableNullArea is created; otherwise an IlvPrintableActualArea.

Parameters
printableThe printable to store.
void IlvPrintableLayout::setForegroundArea ( IlvPrintableArea area) const
protected

Sets the foreground area.

This function is intended to be called in the constructors of the inherited classes.

Parameters
areaThe foreground area.
void IlvPrintableLayout::setForegroundPrintable ( IlvPrintable printable)

Sets the IlvPrintable used to print the foreground.

This function creates the foreground area. If the printable is null, an IlvPrintableNullArea is created; otherwise an IlvPrintableActualArea.

Parameters
printableThe printable to store.
void IlvPrintableLayout::setGutterMargin ( IlvDim  margin)

Sets the gutter margin.

Parameters
marginThe new gutter margin.
void IlvPrintableLayout::setHeaderArea ( IlvPrintableArea area) const
protected

Sets the header area.

This function is intended to be called in the constructors of the inherited classes.

Parameters
areaThe header area.
virtual void IlvPrintableLayout::setHeaderAreaHeight ( IlvDim  height)
pure virtual

Sets the height of the header area.

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

Parameters
heightThe height of the header area.

Implemented in IlvPrintableLayoutMultiplePages, and IlvPrintableLayoutOnePage.

void IlvPrintableLayout::setHeaderPrintable ( IlvPrintable printable)

Sets the IlvPrintable used to print the header.

This function creates the header area. If the printable is null, an IlvPrintableNullArea is created; otherwise an IlvPrintableActualArea.

Parameters
printableThe printable to store.
See Also
initHeaderArea
void IlvPrintableLayout::setKeepingRatio ( IlBoolean  keepRatio)

Sets whether the ratio is kept.

Parameters
keepRatioA Boolean value.
void IlvPrintableLayout::setLeftMargin ( IlvDim  margin)

Sets the left margin.

Parameters
marginThe new left margin.
void IlvPrintableLayout::setMainArea ( IlvPrintableArea area) const
protected

Sets the main area.

This function is intended to be called in the constructors of the inherited classes.

Parameters
areaThe main area.
void IlvPrintableLayout::setMargins ( IlvDim  left,
IlvDim  right,
IlvDim  top,
IlvDim  bottom,
IlvDim  gutter = 0 
)

Sets the margins.

Parameters
leftThe new left margin.
rightThe new right margin.
topThe new top margin.
bottomThe new bottom margin.
gutterThe new gutter margin.
void IlvPrintableLayout::setRightMargin ( IlvDim  margin)

Sets the right margin.

Parameters
marginThe new right margin.
void IlvPrintableLayout::setTopMargin ( IlvDim  margin)

Sets the top margin.

Parameters
marginThe new top margin.
void IlvPrintableLayout::unlock ( )

Unlocks the current instance.

A reference counter is decremented internally. When the reference counter reaches 0 the instance is deleted.

virtual void IlvPrintableLayout::updateBackgroundArea ( IlvPrintableJob job,
int  pageIndex 
) const
protectedpure virtual

Updates the background area.

This pure virtual function must be overloaded in inherited classes. The purpose of this function is to update the IlvPrintableArea background object. The job as well as the page index given as parameters may be used to compute the current size of the area.

Parameters
backgroundAreaA pointer to the background area to update.
jobThe current print settings.
pageIndexThe current logical page index (for this layout).

Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.

virtual void IlvPrintableLayout::updateFooterArea ( IlvPrintableJob job,
int  pageIndex 
) const
protectedpure virtual

Updates the footer area.

This pure virtual function must be overloaded in inherited classes. The purpose of this function is to update the IlvPrintableArea footer object. The job as well as the page index given as parameters may be used to compute the current size of the area.

Parameters
jobThe current print settings.
pageIndexThe current logical page index (for this layout).

Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.

virtual void IlvPrintableLayout::updateForegroundArea ( IlvPrintableJob job,
int  pageIndex 
) const
protectedpure virtual

Updates the foreground area.

This pure virtual function must be overloaded in inherited classes. The purpose of this function is to update the IlvPrintableArea foreground object. The job as well as the page index given as parameters may be used to compute the current size of the area.

Parameters
jobThe current print settings.
pageIndexThe current logical page index (for this layout).

Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.

virtual void IlvPrintableLayout::updateHeaderArea ( IlvPrintableJob job,
int  pageIndex 
) const
protectedpure virtual

Updates the header area.

This pure virtual function must be overloaded in inherited classes. The purpose of this function is to update the IlvPrintableArea header object. The job as well as the page index given as parameters may be used to compute the current size of the area.

Parameters
jobThe current print settings.
pageIndexThe current logical page index (for this layout).

Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.

virtual void IlvPrintableLayout::updateMainArea ( IlvPrintableJob job,
int  pageIndex 
) const
protectedpure virtual

Updates the main area.

This pure virtual function must be overloaded in inherited classes. The purpose of this function is to update the IlvPrintableArea main object. The job as well as the page index given as parameters may be used to compute the current size of the area.

Parameters
jobThe current print settings.
pageIndexThe current logical page index (for this layout).

Implemented in IlvPrintableLayoutOnePage, IlvPrintableLayoutMultiplePages, IlvPrintableLayoutFixedSize, and IlvPrintableLayoutIdentity.


© 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.