rwlogo

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Classes | Public Types | Public Member Functions
IlvPrintableDocument Class Reference

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 an IlvPrintable. More...
 
Iterator append (IlvPrintable *printable, IlvPrintableLayout *layout)
 Appends an IlvPrintable. More...
 
Iterator begin () const
 Returns an iterator to the first IlvPrintable. More...
 
Iterator end () const
 Returns an iterator to one past the last IlvPrintable. More...
 
IlvPrintableLayoutgetDefaultLayout () 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, Iterator const &iter)
 Inserts an IlvPrintable. More...
 
Iterator insert (IlvPrintable *printable, IlvPrintableLayout *layout, Iterator const &iter)
 Inserts an IlvPrintable. More...
 
IlBoolean print (IlvPrinter &printer, Iterator const &first, Iterator const &last, int copyNumber=1, IlBoolean useAbsolutePageIndex=IlTrue) const
 Prints the document. More...
 
IlBoolean print (IlvPrinter &printer, int first=0, int last=-1, 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...
 

Detailed Description

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.

Warning
[note] The IlvPrintable and IlvPrintableLayout objects are reference counted.

Member Enumeration Documentation

The possible values for the printing mode.

This mode defines how several copies of the document will be printed.

Enumerator
WholeDocument 

The whole document is printed for each copy.

Page 

Each page is printed according to the number of copies requested before other pages are printed.

Constructor & Destructor Documentation

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.

Parameters
layoutThe default layout.
modeThe printing mode. The default value is WholeDocument.
See Also
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.

Member Function Documentation

IlvPrintableDocument::Iterator IlvPrintableDocument::append ( IlvPrintable printable)

Appends an IlvPrintable.

This function associates the default IlvPrintableLayout instance to the IlvPrintable object passed as as argument.

Parameters
printableA const pointer to the IlvPrintable to be inserted at the end of this document.
Returns
An Iterator that points to one past the last inserted IlvPrintable.
IlvPrintableDocument::Iterator IlvPrintableDocument::append ( IlvPrintable printable,
IlvPrintableLayout layout 
)

Appends an IlvPrintable.

Parameters
printableA const pointer to the IlvPrintable to be inserted at the end of this document.
layoutA const pointer to an IlvPrintableLayout to associate with the printable.
Returns
An Iterator that points to one past the last inserted IlvPrintable.
Iterator IlvPrintableDocument::begin ( ) const

Returns an iterator to the first IlvPrintable.

Returns
An iterator to the first IlvPrintable.
Iterator IlvPrintableDocument::end ( ) const

Returns an iterator to one past the last IlvPrintable.

Returns
An iterator to one past the last IlvPrintable.
IlvPrintableLayout * IlvPrintableDocument::getDefaultLayout ( ) const

Returns the IlvPrintableLayout used by default for this document.

Returns
A pointer to the default IlvPrintableLayout of this document.
IlvPrintableDocument::PrintingMode IlvPrintableDocument::getPrintingMode ( ) const

Returns the printing mode used to print this document.

Returns
The printing mode of this document.
See Also
PrintingMode.
IlvPrintableDocument::Iterator IlvPrintableDocument::insert ( IlvPrintable printable,
IlvPrintableDocument::Iterator const &  iter 
)

Inserts an IlvPrintable.

This function associates the default IlvPrintableLayout instance to the IlvPrintable object passed as an argument.

Parameters
printableA const pointer to the IlvPrintable to be inserted in this document.
iterA reference to an iterator to the location where the IlvPrintable must be inserted.
Returns
An Iterator that points to one past the last inserted IlvPrintable.
See Also
getPrintingMode
IlvPrintableDocument::Iterator IlvPrintableDocument::insert ( IlvPrintable printable,
IlvPrintableLayout layout,
IlvPrintableDocument::Iterator const &  iter 
)

Inserts an IlvPrintable.

Parameters
printableA const pointer to the IlvPrintable to be inserted in this document.
layoutA const pointer to an IlvPrintableLayout to associate with the printable.
iterA reference to an iterator to the location where the IlvPrintable must be inserted.
Returns
An Iterator that points to one past the last inserted IlvPrintable.
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.

Parameters
printerThe IlvPrinter where printing is to occur.
firstA const reference to an Iterator that specifies where to start.
lastA const reference to an Iterator that specifies where to stop. This points to one past the last element to be printed.
copyNumberThe number of copies. The default value is 1.
useAbsolutePageIndexWhen it is 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.
Returns
An IlBoolean. The value IlTrue means that the printing was successful, IlFalse that an error occurred.
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.

Parameters
printerThe IlvPrinter where printing is to occur.
firstThe index (counted from 0) of the first page to print. The default value is 0, that is, the first page of the document.
lastThe index (counted from 0) of the last page to print. The default value is -1, that is, the last page of the document.
copyNumberThe number of copies. The default value is 1.
useAbsolutePageIndexWhen it is 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.
Returns
An IlBoolean. The value IlTrue means that the printing was successful, IlFalse that an error occurred.
void IlvPrintableDocument::setPrintingMode ( IlvPrintableDocument::PrintingMode  mode)

Sets the printing mode used to print this document.

Parameters
modeThe printing mode.
See Also
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.

Parameters
newThresholdHookThe new threshold hook.

© Copyright 2014, 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.