Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Base class for the layout classes. More...
#include <ilviews/printing/layout.h>
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... | |
IlvPrintable * | getBackgroundPrintable () 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... | |
IlvPrintable * | getFooterPrintable () const |
Gets the IlvPrintable used to print the footer. More... | |
IlvPrintableArea const & | getForegroundArea (IlvPrintableJob &job, int pageIndex) const |
Gets the updated foreground area. More... | |
IlvPrintable * | getForegroundPrintable () 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... | |
IlvPrintable * | getHeaderPrintable () 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 | |
IlvPrintableArea & | getBackgroundArea () const |
Gets the background area. More... | |
IlvPrintableArea & | getFooterArea () const |
Gets the footer area. More... | |
IlvPrintableArea & | getForegroundArea () const |
Gets the foreground area. More... | |
IlvPrintableArea & | getHeaderArea () const |
Gets the header area. More... | |
IlvPrintableArea & | getMainArea () 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... | |
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.
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 |
Destructor.
The destructor actually does nothing, but it is declared as virtual so that inherited classes may override it.
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
.
job | The current print settings. |
pageIndex | The current logical page index (for this layout). |
updateBackgroundArea
.
|
protected |
Gets the background area.
IlvPrintable * IlvPrintableLayout::getBackgroundPrintable | ( | ) | const |
Gets the IlvPrintable
used to print the background.
IlvDim IlvPrintableLayout::getBottomMargin | ( | ) | const |
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
.
job | The current print settings. |
pageIndex | The current logical page index (for this layout). |
updateFooterArea
.
|
protected |
Gets the footer area.
|
pure virtual |
Returns the height of the footer area.
This pure virtual member function must be overloaded in inherited classes.
Implemented in IlvPrintableLayoutMultiplePages, and IlvPrintableLayoutOnePage.
IlvPrintable * IlvPrintableLayout::getFooterPrintable | ( | ) | const |
Gets the IlvPrintable
used to print the footer.
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
.
job | The current print settings. |
pageIndex | The current logical page index (for this layout). |
updateForegroundArea
.
|
protected |
Gets the foreground area.
IlvPrintable * IlvPrintableLayout::getForegroundPrintable | ( | ) | const |
Gets the IlvPrintable
used to print the foreground.
IlvDim IlvPrintableLayout::getGutterMargin | ( | ) | const |
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
.
job | The current print settings. |
pageIndex | The current logical page index (for this layout). |
updateHeaderArea
.
|
protected |
Gets the header area.
|
pure virtual |
Returns the height of the header area.
This pure virtual member function must be overloaded in inherited classes.
Implemented in IlvPrintableLayoutMultiplePages, and IlvPrintableLayoutOnePage.
IlvPrintable * IlvPrintableLayout::getHeaderPrintable | ( | ) | const |
Gets the IlvPrintable
used to print the header.
IlvDim IlvPrintableLayout::getLeftMargin | ( | ) | const |
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
.
job | The current print settings. |
pageIndex | The current logical page index (for this layout). |
updateMainArea
.
|
protected |
Gets the main area.
void IlvPrintableLayout::getMargins | ( | IlvDim & | left, |
IlvDim & | right, | ||
IlvDim & | top, | ||
IlvDim & | bottom, | ||
IlvDim & | gutter | ||
) | const |
Returns the margins.
left | The left margin. |
right | The right margin. |
top | The top margin. |
bottom | The bottom margin. |
gutter | The gutter margin. |
|
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.
job | The current print settings. |
Implemented in IlvPrintableLayoutFixedSize, IlvPrintableLayoutIdentity, IlvPrintableLayoutMultiplePages, and IlvPrintableLayoutOnePage.
IlUInt IlvPrintableLayout::getRefCount | ( | ) | const |
Returns the number of references on this instance.
IlvDim IlvPrintableLayout::getRightMargin | ( | ) | const |
Returns the right margin.
IlvDim IlvPrintableLayout::getTopMargin | ( | ) | const |
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 IlvWindowsPrinter
instance, before using this method,the internal attributes of the printer must be initialized through a call to IlvPrinter::initializeSettings()
.
printer | The printer from which the physical area is taken. |
isGutterOnLeft | IlTrue means that the gutter must be on the left side of the paper. |
|
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.
job | The current print settings. |
print
. Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.
|
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.
job | The current print settings. |
print
. Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.
|
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.
job | The current print settings. |
print
. Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.
|
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.
job | The current print settings. |
print
. Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.
|
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.
job | The current print settings. |
print
. Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.
IlBoolean IlvPrintableLayout::isRatioKept | ( | ) | const |
Returns 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.
job | The current printable job. |
copyNumber | The number of copies to print. |
IlFalse
when an error occurred during the print, IlTrue
otherwise.
|
protected |
Sets the background area.
This function is intended to be called in the constructors of the inherited classes.
area | The 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
.
printable | The printable to store. |
void IlvPrintableLayout::setBottomMargin | ( | IlvDim | margin | ) |
Sets the bottom margin.
margin | The new bottom margin. |
|
protected |
Sets the footer area.
This function is intended to be called in the constructors of the inherited classes.
area | The footer area. |
|
pure virtual |
Sets the height of the footer area.
This pure virtual member function must be overloaded in inherited classes.
height | The 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
.
printable | The printable to store. |
|
protected |
Sets the foreground area.
This function is intended to be called in the constructors of the inherited classes.
area | The 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
.
printable | The printable to store. |
void IlvPrintableLayout::setGutterMargin | ( | IlvDim | margin | ) |
Sets the gutter margin.
margin | The new gutter margin. |
|
protected |
Sets the header area.
This function is intended to be called in the constructors of the inherited classes.
area | The header area. |
|
pure virtual |
Sets the height of the header area.
This pure virtual member function must be overloaded in inherited classes.
height | The 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
.
printable | The printable to store. |
initHeaderArea
void IlvPrintableLayout::setKeepingRatio | ( | IlBoolean | keepRatio | ) |
Sets whether the ratio is kept.
keepRatio | A Boolean value. |
void IlvPrintableLayout::setLeftMargin | ( | IlvDim | margin | ) |
Sets the left margin.
margin | The new left margin. |
|
protected |
Sets the main area.
This function is intended to be called in the constructors of the inherited classes.
area | The main area. |
void IlvPrintableLayout::setMargins | ( | IlvDim | left, |
IlvDim | right, | ||
IlvDim | top, | ||
IlvDim | bottom, | ||
IlvDim | gutter = 0 |
||
) |
Sets the margins.
left | The new left margin. |
right | The new right margin. |
top | The new top margin. |
bottom | The new bottom margin. |
gutter | The new gutter margin. |
void IlvPrintableLayout::setRightMargin | ( | IlvDim | margin | ) |
Sets the right margin.
margin | The new right margin. |
void IlvPrintableLayout::setTopMargin | ( | IlvDim | margin | ) |
Sets the top margin.
margin | The 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.
|
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.
backgroundArea | A pointer to the background area to update. |
job | The current print settings. |
pageIndex | The current logical page index (for this layout). |
Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.
|
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.
job | The current print settings. |
pageIndex | The current logical page index (for this layout). |
Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.
|
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.
job | The current print settings. |
pageIndex | The current logical page index (for this layout). |
Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.
|
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.
job | The current print settings. |
pageIndex | The current logical page index (for this layout). |
Implemented in IlvPrintableLayoutOnePage, and IlvPrintableLayoutMultiplePages.
|
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.
job | The current print settings. |
pageIndex | The 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.