CPrintPreviewImage Class Reference
class CPrintPreviewImage : public CBase |
Print preview image.
This class provides a standard print preview image. An object of this type should be owned by a control, which is in turn owned by the print preview dialog. The control's window provides the region into which this object draws the preview image.
The class provides a callback to the application code that draws the preview pages.
Nested Classes and Structures
Private Member Functions |
---|
| CPrintPreviewImage(CPrintSetup &, MPageRegionPrinter &, RWsSession &, RWindow &, const TSize &, const TPrintPreviewFormat &) |
void | CalculateHeaderFooterRects(TRect &, TRect &) |
void | ConstructL() |
void | DrawBorder(CGraphicsContext *) |
void | DrawExtremities(CGraphicsContext *) |
void | DrawLabel(CGraphicsContext *, TInt) |
void | DrawMargins(CGraphicsContext *) |
void | DrawToGutter(CGraphicsContext *, TInt) |
TBool
| IsFirstPanel(TInt) |
TBool
| IsLastPanel(TInt) |
void | NotifyBandPrinted(TInt, TInt, TInt) |
void | NotifyPrintEnded(TInt) |
void | NotifyPrintStarted(TPrintParameters) |
void | PrintBandL(CGraphicsDevice *, TInt, const TBandAttributes &) |
void | ScrollPanels() |
void | SetLabelWidth() |
TInt
| SetPanelArrayL(const TInt, const TInt) |
Constructor & Destructor Documentation
CPrintPreviewImage(CPrintSetup &, MPageRegionPrinter &, RWsSession &, RWindow &, const TSize &, const TPrintPreviewFormat &)
~CPrintPreviewImage()
IMPORT_C | ~CPrintPreviewImage | ( | ) | [virtual] |
Destructor.
This ends printing, and frees all resources owned by the CPrintPreviewImage object, prior to its destruction.
Member Functions Documentation
CalculateHeaderFooterRects(TRect &, TRect &)
void | CalculateHeaderFooterRects | ( | TRect & | aHeaderRectInPixels, |
| TRect & | aFooterRectInPixels |
| ) | [private] |
Parameters
TRect & aHeaderRectInPixels | |
TRect & aFooterRectInPixels | |
ConstructL()
void | ConstructL | ( | ) | [private] |
DrawBorder(CGraphicsContext *)
DrawExtremities(CGraphicsContext *)
DrawL(const TPoint &, const TRect &)
IMPORT_C void | DrawL | ( | const TPoint & | aOrigin, |
| const TRect & | aInvalidRegion |
| ) | |
Draws the preview.
This function should be called every time the window needs to be refreshed.
Note that typically this function is called in the owning control's Draw() function. Since DrawL() can leave it must be called within a trap harness. The normal behaviour is to clear the image rectangle if a leave occurs.
-
leave
- KErrNoMemory If there is an out of memory error.
-
panic
- 4 If the panel array has not been initialised. Call FormatL() to avoid this.
Parameters
const TPoint & aOrigin | The drawing origin. |
const TRect & aInvalidRegion | The invalid region. This is assumed to be relative to aOrigin. |
DrawLabel(CGraphicsContext *, TInt)
DrawMargins(CGraphicsContext *)
DrawToGutter(CGraphicsContext *, TInt)
FormatL(TInt, TInt, TInt)
IMPORT_C void | FormatL | ( | TInt | aNumPagesInDoc, |
| TInt | aFirstPageToDisplay, |
| TInt | aNumPagesToView |
| ) | |
Sets preview formatting information.
This function can be called prior to previewing, or dynamically during previewing. It is used to alter the display parameters, e.g. turn margin indicator lines on or off, show/hide labels, change the number of panels viewed, or scroll the preview to show different pages.
Note:
The panels are fitted to the maximum window area available. This means that the print preview dialog will always be the same size irrespective of the number of panels displayed.
-
panic
- 6 If the number of pages in the document or the number of pages to be previewed is not greater than zero.
-
panic
- 7 If aFirstPageToDisplay is not less than aNumPagesInDoc or if the first page to display is less than zero.
Parameters
TInt aNumPagesInDoc | The number of pages in the document. |
TInt aFirstPageToDisplay | The first page to display. |
TInt aNumPagesToView | The number of pages to preview. |
IsFirstPanel(TInt)
TBool
| IsFirstPanel | ( | TInt | aPageNum | ) | [private, inline] |
IsLastPanel(TInt)
TBool
| IsLastPanel | ( | TInt | aPageNum | ) | [private, inline] |
NewL(CPrintSetup &, MPageRegionPrinter &, RWsSession &, RWindow &, const TSize &, const TPrintPreviewFormat &)
Parameters
CPrintSetup & aPrintSetup | The printer setup. |
MPageRegionPrinter & aBodyPrinter | A page region printer. Defines a function to print the body of each page band by band. |
RWsSession & aWsSession | A window server session. This may be the GUI framework session accessed through iEikonEnv->WsSession(). |
RWindow & aWindow | The window in which the image is to be drawn. Typically this is the window of the owning control. |
const TSize & aMaxWindowSize | The maximum size of the window aWindow. |
const TPrintPreviewFormat & aStaticFormat | The print preview format. |
NotifyBandPrinted(TInt, TInt, TInt)
void | NotifyBandPrinted | ( | TInt | aPercentageOfPagePrinted, |
| TInt | aCurrentPageNum, |
| TInt | aCurrentCopyNum |
| ) | [private, virtual] |
Parameters
TInt aPercentageOfPagePrinted | |
TInt aCurrentPageNum | |
TInt aCurrentCopyNum | |
NotifyPrintEnded(TInt)
void | NotifyPrintEnded | ( | TInt | anErrorCode | ) | [private, virtual] |
NotifyPrintStarted(TPrintParameters)
PrintBandL(CGraphicsDevice *, TInt, const TBandAttributes &)
ScrollPanels()
void | ScrollPanels | ( | ) | [private] |
SetLabelWidth()
void | SetLabelWidth | ( | ) | [private] |
SetMargins(TMarginState)
Sets whether or not margins are displayed.
SetNumBands(TInt)
IMPORT_C void | SetNumBands | ( | TInt | aNum | ) | |
Sets the number of print bands to be drawn in the preview.
On construction, the number of bands is initialised to to 1.
Parameters
TInt aNum | The number of print bands. |
SetObserver(MPrintProcessObserver &)
Sets the process observer.
The observer is informed of events occurring during print previewing. It allows error dialogs to be displayed by the GUI print preview dialogs if there are problems during previewing.
SetPanelArrayL(const TInt, const TInt)
TInt
| SetPanelArrayL | ( | const TInt | aFirstPage, |
| const TInt | aNumPagesToView |
| ) | [private] |
Parameters
const TInt aFirstPage | |
const TInt aNumPagesToView | |
Member Enumerations Documentation
Enum TMarginState
Margin display state flags.
Enumerators
EShowMargins |
Show margins in print preview image.
|
EHideMargins |
Hide margins in print preview image.
|
Member Data Documentation
TSize
iActualGutter
TSize
| iActualGutter | [private] |
MPageRegionPrinter * iAppBodyPrinter
CPrintPreviewDevice * iDevice
TPrintPreviewFormat
iFormat
CFont * iLabelFont
CFont * | iLabelFont | [private] |
TSize
iLabelSize
TSize
| iLabelSize | [private] |
TMarginState
iMarginState
TInt
iNumPagesInDoc
TInt
| iNumPagesInDoc | [private] |
MPrintProcessObserver * iObserver
CArrayFix< TPreviewPanel > * iPanelArray
TSize
iPanelSizeInPixels
TSize
| iPanelSizeInPixels | [private] |
TPrintParameters
iPrintParams
CPrintSetup * iPrintSetup
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.