Location:
PRNPREV.H
Link against: prev.lib
class CPrintPreviewImage : public CBase, private MPrintProcessObserver, private MPageRegionPrinter;
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.
MPageRegionPrinter
- Interface for printing in bands
MPrintProcessObserver
- Print progress and status notification interface class
CBase
- Base class for all classes to be instantiated on the heap
CPrintPreviewImage
- Print preview image
Defined in CPrintPreviewImage
:
DrawL()
, EHideMargins
, EShowMargins
, FormatL()
, NewL()
, NotifyBandPrinted()
, NotifyPrintEnded()
, NotifyPrintStarted()
, PrintBandL()
, SetMargins()
, SetNumBands()
, SetObserver()
, TMarginState
, ~CPrintPreviewImage()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
static IMPORT_C CPrintPreviewImage *NewL(CPrintSetup &aPrintSetup, MPageRegionPrinter &aBodyPrinter, RWsSession &aWsSession,
RWindow &aWindow, const TSize &aMaxWindowSize, const TPrintPreviewFormat &aStaticFormat);
Static constructor for a CPrintPreviewImage object.
|
|
virtual IMPORT_C ~CPrintPreviewImage();
Destructor.
This ends printing, and frees all resources owned by the CPrintPreviewImage object, prior to its destruction.
IMPORT_C void SetMargins(TMarginState aState);
Sets whether or not margins are displayed.
|
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.
|
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.
|
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.
|
|
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.
|
|
|
private: virtual void NotifyPrintStarted(TPrintParameters aPrintParams);
Notifies that a print or print preview operation is about to begin.
It may be used to display information about the document to be printed. It is called once, immediately before printing or print previewing begins.
When subclassing, add variables to store initialisation information as required.
|
private: virtual void NotifyBandPrinted(TInt aPercentageOfPagePrinted, TInt aCurrentPageNum, TInt aCurrentCopyNum);
Notifies that a band is about to be printed.
It may be used to display print progress information, including the current page number. It is called immediately before each band is printed.
|
private: virtual void NotifyPrintEnded(TInt anErrorCode);
Notifies that the print or print preview operation has completed.
It may be used to display information about how the operation completed, for example any errors that occurred. It is called once, immediately after the print job terminates.
|
private: virtual void PrintBandL(CGraphicsDevice *aDevice, TInt aPageNo, const TBandAttributes &aBand);
Prints a band.
Implementations should set up a graphics context to which all drawing should take place using CGraphicsDevice::CreateContext()
. All co-ordinate calculations should be done in twips, and converted into pixels before starting the print job.
|
TMarginState
Margin display state flags.
|