Class that manages the document to print. More...
#include <ilviews/printing/document.h>
Classes | |
class | Iterator |
Iterator class to walk through the objects stored in an IlvPrintableDocument . More... | |
class | ThresholdHook |
Hook class to decide what to do when there are too many pages to print. More... | |
Public Types | |
enum | PrintingMode { WholeDocument, Page } |
The possible values for the printing mode. More... | |
Public Member Functions | |
IlvPrintableDocument (IlvPrintableLayout *layout, PrintingMode mode=WholeDocument) | |
Constructor. More... | |
~IlvPrintableDocument () | |
Destructor. More... | |
Iterator | append (IlvPrintable *printable) |
Appends a printable object. More... | |
Iterator | append (IlvPrintable *printable, IlvPrintableLayout *layout) |
Appends a printable object. More... | |
Iterator | begin () const |
Returns an iterator to the first printable object. More... | |
Iterator | end () const |
Returns an iterator to one past the last printable object. More... | |
IlvPrintableLayout * | getDefaultLayout () const |
Returns the IlvPrintableLayout used by default for this document. More... | |
PrintingMode | getPrintingMode () const |
Returns the printing mode used to print this document. More... | |
Iterator | insert (IlvPrintable *printable, IlvPrintableLayout *layout, Iterator const &iter) |
Inserts a printable object. More... | |
Iterator | insert (IlvPrintable *printable, Iterator const &iter) |
Inserts an IlvPrintable . More... | |
IlBoolean | print (IlvPrinter &printer, int first=0, int last=-1, int copyNumber=1, IlBoolean useAbsolutePageIndex=IlTrue) const |
Prints the document. More... | |
IlBoolean | print (IlvPrinter &printer, Iterator const &first, Iterator const &last, int copyNumber=1, IlBoolean useAbsolutePageIndex=IlTrue) const |
Prints the document. More... | |
void | setPrintingMode (PrintingMode mode) |
Sets the printing mode used to print this document. More... | |
void | setThresholdHook (ThresholdHook *newThresholdHook) |
Sets the threshold hook. More... | |
Class that manages the document to print.
Library: ilvprint
This class contains a list of IlvPrintable
objects.
Each IlvPrintable
object is associated with an IlvPrintableLayout
object. These objects will be printed in the order of the list.
IlvPrintable
and IlvPrintableLayout
objects are reference counted. IlvPrintableDocument::IlvPrintableDocument | ( | IlvPrintableLayout * | layout, |
PrintingMode | mode = WholeDocument |
||
) |
Constructor.
Initializes the object with an IlvPrintableLayout
that will be the default layout. It is also possible to define the printing mode.
layout | The default layout. |
mode | The printing mode. The default value is WholeDocument . |
PrintingMode
. IlvPrintableDocument::~IlvPrintableDocument | ( | ) |
Destructor.
Frees the resources used by the object: it decrements the reference counters of the IlvPrintable
and IlvPrintableLayout
instances that this object uses.
Iterator IlvPrintableDocument::append | ( | IlvPrintable * | printable | ) |
Appends a printable object.
This function associates the default IlvPrintableLayout
instance to the IlvPrintable
object passed as as argument.
printable | The IlvPrintable to be inserted at the end of this document. |
Iterator
that points to one past the last inserted IlvPrintable
. Iterator IlvPrintableDocument::append | ( | IlvPrintable * | printable, |
IlvPrintableLayout * | layout | ||
) |
Appends a printable object.
printable | The IlvPrintable to be inserted at the end of this document. |
layout | The IlvPrintableLayout to associate with the printable. |
Iterator
that points to one past the last inserted IlvPrintable
. Iterator IlvPrintableDocument::begin | ( | ) | const |
Returns an iterator to the first printable object.
IlvPrintable
. Iterator IlvPrintableDocument::end | ( | ) | const |
Returns an iterator to one past the last printable object.
IlvPrintable
. IlvPrintableLayout* IlvPrintableDocument::getDefaultLayout | ( | ) | const |
Returns the IlvPrintableLayout
used by default for this document.
IlvPrintableLayout
of this document. PrintingMode IlvPrintableDocument::getPrintingMode | ( | ) | const |
Returns the printing mode used to print this document.
PrintingMode
. Iterator IlvPrintableDocument::insert | ( | IlvPrintable * | printable, |
IlvPrintableLayout * | layout, | ||
Iterator const & | iter | ||
) |
Inserts a printable object.
printable | The IlvPrintable object to be inserted in this document. |
layout | The IlvPrintableLayout to associate with the printable. |
iter | The location where the IlvPrintable must be inserted. |
Iterator
that points to one past the last inserted IlvPrintable
. Iterator IlvPrintableDocument::insert | ( | IlvPrintable * | printable, |
Iterator const & | iter | ||
) |
Inserts an IlvPrintable
.
This function associates the default IlvPrintableLayout
instance to the IlvPrintable
object passed as an argument.
printable | A const pointer to the IlvPrintable to be inserted in this document. |
iter | A reference to an iterator to the location where the IlvPrintable must be inserted. |
Iterator
that points to one past the last inserted IlvPrintable
. getPrintingMode()
. IlBoolean IlvPrintableDocument::print | ( | IlvPrinter & | printer, |
int | first = 0 , |
||
int | last = -1 , |
||
int | copyNumber = 1 , |
||
IlBoolean | useAbsolutePageIndex = IlTrue |
||
) | const |
Prints the document.
This function prints the part of the document specified by the indices of the pages given as parameters. The printing is done on the device associated with the IlvPrinter
object given as argument. The layout is specified by the IlvPrintableLayout
objects associated with each printable.
printer | The IlvPrinter where printing is to occur. |
first | The index (starting at 0) of the first page to print. The default value is 0 , that is, the first page of the document. |
last | The index (starting at 0) of the last page to print. The default value is -1 that indicates the last page of the document. |
copyNumber | The number of copies. The default value is 1 . |
useAbsolutePageIndex | When IlFalse , the page numbers start from 1. Otherwise, they start from the page number that would have been if the printing had started from the first page. |
IlTrue
if the printing was successful, and IlFalse
if an error occurred. IlBoolean IlvPrintableDocument::print | ( | IlvPrinter & | printer, |
Iterator const & | first, | ||
Iterator const & | last, | ||
int | copyNumber = 1 , |
||
IlBoolean | useAbsolutePageIndex = IlTrue |
||
) | const |
Prints the document.
This function prints the part of the document specified by the iterators given as parameters, that is, all the IlvPrintable
objects stored between these two iterators. The printing is done on the device associated with the IlvPrinter
object given as an argument. The layout is specified by the IlvPrintableLayout
objects associated with each printable.
printer | The IlvPrinter where printing is to occur. |
first | The Iterator that specifies where to start. |
last | The Iterator that specifies where to stop. This points to one past the last element to be printed. |
copyNumber | The number of copies. The default value is 1 . |
useAbsolutePageIndex | When IlFalse , the page numbers start from 1 . Otherwise, they start from the page number that would have been if the printing had started from the first printable. |
IlTrue
if the printing was successful, and IlFalse
if an error occurred. void IlvPrintableDocument::setPrintingMode | ( | PrintingMode | mode | ) |
Sets the printing mode used to print this document.
mode | The printing mode. |
PrintingMode
, setPrintingMode()
. void IlvPrintableDocument::setThresholdHook | ( | ThresholdHook * | newThresholdHook | ) |
Sets the threshold hook.
The pointer must be valid during the lifetime of this object or until the next call to this function. The pointed object is not deleted by this object.
newThresholdHook | The new threshold hook. |