|
||
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()const
Gets the current page specification in twips.DeleteControl()
Deletes the printer control owned by this object.ExternalizePropertiesL(RWriteStream &)const
Externalizes printer properties to the store.InternalizePropertiesL(RReadStream &)
Externalizes printer properties to the store.Model()const
Gets the printer model entry.PrintablePageInPixels()const
Gets 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()const
Stores the printer properties. iControl
The printer control.iCurrentPageSpecInTwips
Current 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()const
Gets the display mode of the device.FontHeightInTwips(TInt,TInt)const
Get the height of a font in twips.GetPalette(CPalette *&)const
Gets the device's current palette.NumTypefaces()const
Gets the number of typefaces supported by the graphics device.PaletteAttributes(TBool &,TInt &)const
Gets the palette attributes of the device.SetPalette(CPalette *)
Sets the device's palette.SizeInPixels()const
Gets the size of the device area in pixels.SizeInTwips()const
Gets the size of the device area in twips.TypefaceSupport(TTypefaceSupport &,TInt)const
Gets 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)const
Converts a horizontal dimension from pixels to twips.HorizontalTwipsToPixels(TInt)const
Converts a horizontal dimension from twips to pixels.PixelsToTwips(const TPoint &)const
Converts a point in pixels to a point in twips.PixelsToTwips(const TRect &)const
Converts a rectangle in pixels to a rectangle in twips.ReleaseFont(CFont *)
Releases the specified font.TwipsToPixels(const TPoint &)const
Converts a point in twips to a point in pixels.TwipsToPixels(const TRect &)const
Converts a rectangle in twips to a rectangle in pixels.VerticalPixelsToTwips(TInt)const
Converts a vertical dimension from pixels to twips.VerticalTwipsToPixels(TInt)const
Converts a vertical dimension from twips to pixels.CPrinterControl
Printer 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.