rwlogo

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
IlvPrinterPreviewDisplayer Class Referenceabstract

Class to actually display the printing preview. More...

#include <ilviews/printing/prevdisplayer.h>

Public Types

enum  Mode { OnePage, TwoPages, TiledPages }
 This enumeration defines the mode used to preview the document. More...
 

Public Member Functions

 IlvPrinterPreviewDisplayer (IlvPrinterPreview &printerPreview, IlvContainer *container)
 Constructor. More...
 
virtual ~IlvPrinterPreviewDisplayer ()
 The destructor.
 
void center ()
 This function centers the preview in the page.
 
virtual void clean ()=0
 This function removes all the objects to be printed from the container. More...
 
virtual IlvRect computeSize (IlInt index, IlBoolean redraw=IlTrue) const =0
 This function computes the bounding box of the page referenced by an index. More...
 
IlvContainergetContainer () const
 This function returns the container where the preview is displayed. More...
 
virtual IlInt getDisplayedPageNumber () const =0
 This function returns the number of pages currently displayed. More...
 
IlInt getFirstDisplayedPage () const
 Gets the first displayed page. More...
 
virtual Mode getMode () const =0
 This function gets the current mode. More...
 
IlvPrinterPreviewgetPrinterPreview () const
 This function returns the preview printer associated with this displayer. More...
 
IlvRect const & getVisibleSize () const
 This function returns the size used to display the preview. More...
 
virtual IlBoolean isDisplayed (IlInt page) const =0
 This function returns whether a page is actually displayed. More...
 
virtual IlBoolean isSameMode (Mode mode) const =0
 This function checks whether the current mode is equal to the mode given as parameter. More...
 
virtual void refresh () const =0
 This function forces a redraw. More...
 
void setFirstDisplayedPage (IlInt page)
 Sets the first page to be displayed. More...
 
void setVisibleSize (IlvRect const &newVisibleSize)
 This function sets the size used to display the preview. More...
 
virtual void updateSizes ()=0
 This function updates the size of the page(s). More...
 

Static Public Member Functions

static IlvPrinterPreviewDisplayerFactory (Mode mode, IlvPrinterPreview &preview, IlvContainer *container)
 This static function builds an actual instance according to the mode given as parameter. More...
 

Protected Member Functions

IlInt getPageNumber () const
 This function returns the number of pages to be displayed. More...
 
virtual void updatePages ()=0
 This function updates the pages to be displayed. More...
 

Detailed Description

Class to actually display the printing preview.

Library: ilvprint

This is an abstract class.

Three inherited classes exist internally to manage one-page, two-page, or tiled displays respectively. These three classes are used by the built-in printing preview dialog defined by the the IlvPrinterPreviewDialog.

Member Enumeration Documentation

This enumeration defines the mode used to preview the document.

See Also
IlvPrinterPreviewDialog::setMode.
Enumerator
OnePage 

One page only is displayed.

TwoPages 

Two pages are displayed at once.

TiledPages 

Twenty pages are displayed at once.

Constructor & Destructor Documentation

IlvPrinterPreviewDisplayer::IlvPrinterPreviewDisplayer ( IlvPrinterPreview printerPreview,
IlvContainer container 
)

Constructor.

Note
The IlvPrinterPreview must already be initialized.
Parameters
printerPreviewThe preview printer associated with this displayer.
containerThe container where to draw.

Member Function Documentation

virtual void IlvPrinterPreviewDisplayer::clean ( )
pure virtual

This function removes all the objects to be printed from the container.

It is a pure virtual function and must be overloaded in inherited classes.

virtual IlvRect IlvPrinterPreviewDisplayer::computeSize ( IlInt  index,
IlBoolean  redraw = IlTrue 
) const
pure virtual

This function computes the bounding box of the page referenced by an index.

It is a pure virtual function and must be overloaded in inherited classes.

Parameters
indexThe index of the page.
redrawA flag to force the redraw.
Returns
The bounding box of the page.
static IlvPrinterPreviewDisplayer* IlvPrinterPreviewDisplayer::Factory ( Mode  mode,
IlvPrinterPreview preview,
IlvContainer container 
)
static

This static function builds an actual instance according to the mode given as parameter.

mode The mode of the building displayer. preview The preview printer associated with this displayer. container The container where to draw.

IlvContainer * IlvPrinterPreviewDisplayer::getContainer ( ) const

This function returns the container where the preview is displayed.

Returns
The container where the preview is displayed.
virtual IlInt IlvPrinterPreviewDisplayer::getDisplayedPageNumber ( ) const
pure virtual

This function returns the number of pages currently displayed.

It is a pure virtual function and must be overloaded in inherited classes.

Returns
The number of pages currently displayed.
IlInt IlvPrinterPreviewDisplayer::getFirstDisplayedPage ( ) const

Gets the first displayed page.

The pages are indexed from 0.

Returns
The first displayed page.
virtual Mode IlvPrinterPreviewDisplayer::getMode ( ) const
pure virtual

This function gets the current mode.

It is a pure virtual function and must be overloaded in inherited classes.

Returns
The current mode.
IlInt IlvPrinterPreviewDisplayer::getPageNumber ( ) const
protected

This function returns the number of pages to be displayed.

Returns
The number of pages to be displayed.
IlvPrinterPreview & IlvPrinterPreviewDisplayer::getPrinterPreview ( ) const

This function returns the preview printer associated with this displayer.

Returns
The preview printer associated with this displayer.
IlvRect const & IlvPrinterPreviewDisplayer::getVisibleSize ( ) const

This function returns the size used to display the preview.

Returns
The size used to display the preview.
virtual IlBoolean IlvPrinterPreviewDisplayer::isDisplayed ( IlInt  page) const
pure virtual

This function returns whether a page is actually displayed.

It is a pure virtual function and must be overloaded in inherited classes. page The index of the page.

Returns
IlTrue when the page is actually displayed, IlFalse otherwise.
virtual IlBoolean IlvPrinterPreviewDisplayer::isSameMode ( Mode  mode) const
pure virtual

This function checks whether the current mode is equal to the mode given as parameter.

It is a pure virtual function and must be overloaded in inherited classes.

Parameters
modeThe mode to check with.
Returns
IlTrue when modes are equal, IlFalse otherwise.
virtual void IlvPrinterPreviewDisplayer::refresh ( ) const
pure virtual

This function forces a redraw.

It is a pure virtual function and must be overloaded in inherited classes.

void IlvPrinterPreviewDisplayer::setFirstDisplayedPage ( IlInt  page)

Sets the first page to be displayed.

The pages are indexed from 0. This function calls updatePages.

Parameters
pageThe first page to be displayed.
See Also
updatePages.
void IlvPrinterPreviewDisplayer::setVisibleSize ( IlvRect const &  newVisibleSize)

This function sets the size used to display the preview.

Parameters
newVisibleSizeThe new size used to display the preview.
virtual void IlvPrinterPreviewDisplayer::updatePages ( )
protectedpure virtual

This function updates the pages to be displayed.

This function is internally called by setFirstDisplayedPage.

See Also
setFirstDisplayedPage.
virtual void IlvPrinterPreviewDisplayer::updateSizes ( )
pure virtual

This function updates the size of the page(s).

It is a pure virtual function and must be overloaded in inherited classes.

It currently calls computeSize.


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