|
||
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(const TPoint &,const TRect &)
Draws the preview.EHideMargins
Hide margins in print preview image. EShowMargins
Show margins in print preview image. FormatL(TInt,TInt,TInt)
Sets preview formatting information.NewL(CPrintSetup &,MPageRegionPrinter &,RWsSession &,RWindow &,const TSize &,const TPrintPreviewFormat &)
Static constructor for a CPrintPreviewImage object.NotifyBandPrinted(TInt,TInt,TInt)
Notifies that a band is about to be printed.NotifyPrintEnded(TInt)
Notifies that the print or print preview operation has completed.NotifyPrintStarted(TPrintParameters)
Notifies that a print or print preview operation is about to begin.PrintBandL(CGraphicsDevice *,TInt,const TBandAttributes &)
Prints a band.SetMargins(TMarginState)
Sets whether or not margins are displayed.SetNumBands(TInt)
Sets the number of print bands to be drawn in the preview.SetObserver(MPrintProcessObserver &)
Sets the process observer.TMarginState
Margin display state flags. ~CPrintPreviewImage()
Destructor.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...NewL(CPrintSetup &,MPageRegionPrinter &,RWsSession &,RWindow &,const TSize &,const TPrintPreviewFormat &)
IMPORT_C static CPrintPreviewImage* NewL(CPrintSetup &aPrintSetup, MPageRegionPrinter &aBodyPrinter, RWsSession &aWsSession,
RWindow &aWindow, const TSize &aMaxWindowSize, const TPrintPreviewFormat &aStaticFormat);
Static constructor for a CPrintPreviewImage object.
|
|
IMPORT_C virtual ~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 CPrintPreviewImage::DrawL(const TPoint &,const TRect &)
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(CGraphicsContext *&)
. All co-ordinate calculations should be done in twips, and converted into pixels before starting the print job.
|
TMarginState
Margin display state flags.
|