#include <mw/prnprev.h>
class CPrintPreviewImage : public CBase |
Public Member Enumerations | |
---|---|
enum | TMarginState { EShowMargins, EHideMargins } |
Public Member Functions | |
---|---|
virtual | ~CPrintPreviewImage() |
IMPORT_C void | DrawL(const TPoint &, const TRect &) |
IMPORT_C void | FormatL(TInt, TInt, TInt) |
IMPORT_C CPrintPreviewImage * | NewL(CPrintSetup &, MPageRegionPrinter &, RWsSession &, RWindow &, const TSize &, const TPrintPreviewFormat &) |
IMPORT_C void | SetMargins(TMarginState) |
IMPORT_C void | SetNumBands(TInt) |
IMPORT_C void | SetObserver(MPrintProcessObserver &) |
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.
IMPORT_C | ~CPrintPreviewImage | ( | ) | [virtual] |
Destructor.
This ends printing, and frees all resources owned by the CPrintPreviewImage object, prior to its destruction.
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.
Parameter | Description |
---|---|
aOrigin | The drawing origin. |
aInvalidRegion | The invalid region. This is assumed to be relative to aOrigin. |
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.
Parameter | Description |
---|---|
aNumPagesInDoc | The number of pages in the document. |
aFirstPageToDisplay | The first page to display. |
aNumPagesToView | The number of pages to preview. |
IMPORT_C CPrintPreviewImage * | NewL | ( | CPrintSetup & | aPrintSetup, |
MPageRegionPrinter & | aBodyPrinter, | |||
RWsSession & | aWsSession, | |||
RWindow & | aWindow, | |||
const TSize & | aMaxWindowSize, | |||
const TPrintPreviewFormat & | aStaticFormat | |||
) | [static] |
Static constructor for a CPrintPreviewImage object.
Parameter | Description |
---|---|
aPrintSetup | The printer setup. |
aBodyPrinter | A page region printer. Defines a function to print the body of each page band by band. |
aWsSession | A window server session. This may be the GUI framework session accessed through iEikonEnv->WsSession(). |
aWindow | The window in which the image is to be drawn. Typically this is the window of the owning control. |
aMaxWindowSize | The maximum size of the window aWindow. |
aStaticFormat | The print preview format. |
Returns: The newly created print preview image.
IMPORT_C void | SetMargins | ( | TMarginState | aState | ) |
Sets whether or not margins are displayed.
Parameter | Description |
---|---|
aState | The margin state - on or off. |
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.
Parameter | Description |
---|---|
aNum | The number of print bands. |
IMPORT_C void | SetObserver | ( | MPrintProcessObserver & | aObserver | ) |
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.
Parameter | Description |
---|---|
aObserver | The preview process observer. |