|
|
|
class CPrinterDevice : public CGraphicsDevice;
Printer graphics device interface.
This abstract class represents a physical graphics device that is used for printing.
This class is used to:
set and get the page specification
map between the co-ordinates of the printed page (in twips) and the co-ordinates of the image device (in pixels)
get and set the printer model entry
create and delete a printer control.
A printer driver is defined in terms of a printer device and a printer control. A printer device can own either a single or no printer control. The control determines the progress and termination of the print job and is responsible for producing output.
MGraphicsDeviceMap - Interface class for mapping between twips and device-specific units (pixels).
CBase -
Base class for all classes to be instantiated on the heap.
CGraphicsDevice - Specifies the interface for concrete device classes.
CPrinterDevice - Printer graphics device interface.
Defined in CPrinterDevice:
CPrinterDevice()Standard constructor. CreateControlL(CPrinterPort *)Creates a printer control.CurrentPageSpecInTwips()constGets the current page specification in twips.DeleteControl()Deletes the printer control owned by this object.ExternalizePropertiesL(RWriteStream &)constExternalizes printer properties to the store.InternalizePropertiesL(RReadStream &)Externalizes printer properties to the store.Model()constGets the printer model entry.PrintablePageInPixels()constGets the dimensions of the area to which the printer device can print.RestorePropertiesL()Restores printer properties. SelectPageSpecInTwips(const TPageSpec &)Sets the page specification in twips.SetModel(const TPrinterModelHeader &,CStreamStore &)Sets the printer model header and the store.StorePropertiesL()constStores the printer properties. iControlThe printer control.iCurrentPageSpecInTwipsCurrent page specification in twips. ~CPrinterDevice()Destructor. It frees all resources owned by the object, prior to its destruction...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...Inherited from CGraphicsDevice:
CreateContext(CGraphicsContext *&)Creates a graphics context for the device.DisplayMode()constGets the display mode of the device.FontHeightInTwips(TInt,TInt)constGet the height of a font in twips.GetPalette(CPalette *&)constGets the device's current palette.NumTypefaces()constGets the number of typefaces supported by the graphics device.PaletteAttributes(TBool &,TInt &)constGets the palette attributes of the device.SetPalette(CPalette *)Sets the device's palette.SizeInPixels()constGets the size of the device area in pixels.SizeInTwips()constGets the size of the device area in twips.TypefaceSupport(TTypefaceSupport &,TInt)constGets typeface information for a specified typeface.Inherited from MGraphicsDeviceMap:
GetNearestFontInTwips(CFont *&,const TFontSpec &)Gets the font which is the nearest to the given font specification.GetNearestFontToDesignHeightInTwips(CFont *&,const TFontSpec &)Gets the font which is the nearest to the given font specification.GetNearestFontToMaxHeightInTwips(CFont *&,const TFontSpec &,TInt)Gets the font which is the nearest to the given font specification.HorizontalPixelsToTwips(TInt)constConverts a horizontal dimension from pixels to twips.HorizontalTwipsToPixels(TInt)constConverts a horizontal dimension from twips to pixels.PixelsToTwips(const TPoint &)constConverts a point in pixels to a point in twips.PixelsToTwips(const TRect &)constConverts a rectangle in pixels to a rectangle in twips.ReleaseFont(CFont *)Releases the specified font.TwipsToPixels(const TPoint &)constConverts a point in twips to a point in pixels.TwipsToPixels(const TRect &)constConverts a rectangle in twips to a rectangle in pixels.VerticalPixelsToTwips(TInt)constConverts a vertical dimension from pixels to twips.VerticalTwipsToPixels(TInt)constConverts a vertical dimension from twips to pixels.CPrinterControlPrinter control interface.IMPORT_C ~CPrinterDevice();
Destructor. It frees all resources owned by the object, prior to its destruction.
inline TPageSpec CurrentPageSpecInTwips() const;
Gets the current page specification in twips.
|
IMPORT_C virtual void SelectPageSpecInTwips(const TPageSpec &aPageSpec);
Sets the page specification in twips.
|
IMPORT_C virtual TRect PrintablePageInPixels() const;
Gets the dimensions of the area to which the printer device can print.
These dimensions are normally less than those returned by TPageSpec::OrientedPageSize()const because a margin exists between the boundary of the printable page and the absolute extent of the page.
|
virtual TPrinterModelEntry Model() const=0;
Gets the printer model entry.
|
virtual TInt SetModel(const TPrinterModelHeader &aModel, CStreamStore &aStore)=0;
Sets the printer model header and the store.
|
|
virtual void CreateControlL(CPrinterPort *aPrinterPort)=0;
Creates a printer control.
The printer control is an instance of a CPrinterControl derived class; it is assigned to this printer device's iControl member.
Note that this function is called by CPrintSetup::StartPrintL().
|
IMPORT_C virtual void DeleteControl();
Deletes the printer control owned by this object.
The function sets the iControl member to NULL.
inline virtual void InternalizePropertiesL(RReadStream &);
Externalizes printer properties to the store.
The default implementation is empty.
|
inline virtual void ExternalizePropertiesL(RWriteStream &) const;
Externalizes printer properties to the store.
The default implementation is empty.
|
CPrinterControl * iControl;
The printer control.
This may be NULL. If implemented, it provides control over the print operation.
protected: TPageSpec iCurrentPageSpecInTwips;
Current page specification in twips.