rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvPrinterPreviewDisplayer Class Reference

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

#include <ilviews/printing/prevdisplayer.h>

List of all members.

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.
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.
virtual IlvRect computeSize (IlInt index, IlBoolean redraw=((IlBoolean) 1)) const =0
 This function computes the bounding box of the page referenced by an index.
IlvContainergetContainer () const
 This function returns the container where the preview is displayed.
virtual IlInt getDisplayedPageNumber () const =0
 This function returns the number of pages currently displayed.
IlInt getFirstDisplayedPage () const
 Gets the first displayed page.
virtual Mode getMode () const =0
 This function gets the current mode.
IlvPrinterPreviewgetPrinterPreview () const
 This function returns the preview printer associated with this displayer.
IlvRect const & getVisibleSize () const
 This function returns the size used to display the preview.
virtual IlBoolean isDisplayed (IlInt page) const =0
 This function returns whether a page is actually displayed.
virtual IlBoolean isSameMode (Mode mode) const =0
 This function checks whether the current mode is equal to the mode given as parameter.
virtual void refresh () const =0
 This function forces a redraw.
void setFirstDisplayedPage (IlInt page)
 Sets the first page to be displayed.
void setVisibleSize (IlvRect const &newVisibleSize)
 This function sets the size used to display the preview.
virtual void updateSizes ()=0
 This function updates the size of the page(s).

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.

Protected Member Functions

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

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.

Warning:
[note] The IlvPrinterPreview must already be initialized.
Parameters:
printerPreview The preview printer associated with this displayer.
container The 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 = ((IlBoolean) 1) 
) 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:
index The index of the page.
redraw A 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:
mode The 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:
page The 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:
newVisibleSize The new size used to display the preview.
virtual void IlvPrinterPreviewDisplayer::updatePages (  )  [protected, pure 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.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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