Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: pdrstore.h
Link against: pdrstr.lib

Class CPdrDevice

class CPdrDevice : public CPrinterDevice;

Description

Derivation

Members

Defined in CPdrDevice:
CPdrDevice(), DisplayMode(), Flags(), FontHeightInTwips(), GetNearestFontInTwips(), GetNearestFontToDesignHeightInTwips(), GetNearestFontToMaxHeightInTwips(), GetPalette(), HorizontalPixelsToTwips(), HorizontalTwipsToPixels(), KPixelSizeInTwips(), Model(), NumTypefaces(), OffsetInPixels(), PaletteAttributes(), PrintablePageInPixels(), ReleaseFont(), SelectPageSpecInTwips(), SetModel(), SetPalette(), SizeInPixels(), SizeInTwips(), TypefaceSupport(), VerticalPixelsToTwips(), VerticalTwipsToPixels(), iModel, iModelInfo, iStore, iTypefaceStore, ~CPdrDevice()

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from CGraphicsDevice:
CreateContext()

Inherited from CPrinterDevice:
CreateControlL(), CurrentPageSpecInTwips(), DeleteControl(), ExternalizePropertiesL(), InternalizePropertiesL(), RestorePropertiesL(), StorePropertiesL(), iControl, iCurrentPageSpecInTwips

Inherited from MGraphicsDeviceMap:
PixelsToTwips(), TwipsToPixels()

See also:


Construction and destruction


CPdrDevice()

protected: IMPORT_C CPdrDevice();

Description


~CPdrDevice()

virtual IMPORT_C ~CPdrDevice();

Description

[Top]


Member functions


SelectPageSpecInTwips()

virtual IMPORT_C void SelectPageSpecInTwips(const TPageSpec &aPageSpec);

Description

Sets the page specification in twips.

Parameters

const TPageSpec &aPageSpec

The page specification in twips.


DisplayMode()

virtual IMPORT_C TDisplayMode DisplayMode() const;

Description

Gets the display mode of the device.

Return value

TDisplayMode

The display mode of the device.


SizeInPixels()

virtual IMPORT_C TSize SizeInPixels() const;

Description

Gets the size of the device area in pixels.

Return value

TSize

The width and height of the device area, in pixels


SizeInTwips()

virtual IMPORT_C TSize SizeInTwips() const;

Description

Gets the size of the device area in twips.

Return value

TSize

The width and height of the device area, in twips


PrintablePageInPixels()

virtual IMPORT_C TRect PrintablePageInPixels() const;

Description

Return value

TRect


HorizontalTwipsToPixels()

virtual IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;

Description

Converts a horizontal dimension from twips to pixels.

An implementation is supplied by a derived class.

Parameters

TInt aTwips

A horizontal dimension of a device in twips.

Return value

TInt

A horizontal dimension of a device in pixels.


VerticalTwipsToPixels()

virtual IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;

Description

Converts a vertical dimension from twips to pixels.

An implementation is supplied by a derived class.

Parameters

TInt aTwips

A vertical dimension of a device in twips.

Return value

TInt

A vertical dimension of a device in pixels.


HorizontalPixelsToTwips()

virtual IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;

Description

Converts a horizontal dimension from pixels to twips.

An implementation is supplied by a derived class.

Parameters

TInt aPixels

A horizontal dimension of a device in pixels.

Return value

TInt

A horizontal dimension of a device in twips.


VerticalPixelsToTwips()

virtual IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;

Description

Converts a vertical dimension from pixels to twips.

An implementation is supplied by a derived class.

Parameters

TInt aPixels

A vertical dimension of a device in pixels.

Return value

TInt

A vertical dimension of a device in twips.


GetNearestFontInTwips()

virtual IMPORT_C TInt GetNearestFontInTwips(CFont *&aFont, const TFontSpec &aFontSpec);

Description

Creates a font from those available in the printer device's typeface store that most closely matches a font specification.

When the font is no longer needed, call ReleaseFont().

This function is replaced by GetNearestFontToDesignHeightInTwips()

Parameters

CFont *&aFont

On return, points to the font which most closely matches the specified font.

const TFontSpec &aFontSpec

An absolute font specification. Its iHeight member is interpreted as being in twips.

Return value

TInt

KErrNone if successful; otherwise, another one of the system-wide error codes.


GetNearestFontToDesignHeightInTwips()

virtual IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec);

Description

Creates a font from those available in the printer device's typeface store that most closely matches a font specification.

When the font is no longer needed, call ReleaseFont().

This function replaces GetNearestFontInTwips()

Parameters

CFont *&aFont

On return, points to the font which most closely matches the specified font.

const TFontSpec &aFontSpec

An absolute font specification. Its iHeight member is interpreted as being in twips.

Return value

TInt

KErrNone if successful; otherwise, another one of the system-wide error codes.


GetNearestFontToMaxHeightInTwips()

virtual IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight);

Description

This call is defined because it had to be - it appeared as an abstract virtual in the base class. But it should never actually get called for this class.

Parameters

CFont *&aFont

const TFontSpec &aFontSpec

TInt aMaxHeight

Return value

TInt


NumTypefaces()

virtual IMPORT_C TInt NumTypefaces() const;

Description

Gets the number of typefaces supported by the graphics device.

Return value

TInt

The number of typefaces supported.


TypefaceSupport()

virtual IMPORT_C void TypefaceSupport(TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const;

Description

Gets typeface information for a specified typeface.

This information is returned in aTypefaceSupport, and includes:

the typeface name and typeface attributes

the number of font heights

the maximum and minimum font heights

whether it is a scalable typeface

Parameters

TTypefaceSupport &aTypefaceSupport

On return, contains the typeface information.

TInt aTypefaceIndex

A typeface index number, in the range: zero to (NumTypefaces() - 1).

See also:


FontHeightInTwips()

virtual IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const;

Description

Get the height of a font in twips.

The font is identified by typeface and height.

The value returned is rounded up or down to the nearest font height in twips.

Parameters

TInt aTypefaceIndex

An index identifying the typeface, in the range: 0 to (NumTypefaces() - 1).

TInt aHeightIndex

An index identifying the font height, in the range: 0 to (iNumHeights - 1). Note that iNumHeights is in the TTypefaceSupport object returned by TypefaceSupport().

Return value

TInt

The height of the font, in twips.


PaletteAttributes()

virtual IMPORT_C void PaletteAttributes(TBool &aModifiable, TInt &aNumEntries) const;

Description

Gets the palette attributes of the device.

Parameters

TBool &aModifiable

On return, holds information on whether or not the device's palette is modifiable (ETrue) or fixed (EFalse).

TInt &aNumEntries

On return, holds the number of entries in the device's palette.


SetPalette()

virtual IMPORT_C void SetPalette(CPalette *aPalette);

Description

Sets the device's palette.

Parameters

CPalette *aPalette

The new palette for the device.


GetPalette()

virtual IMPORT_C TInt GetPalette(CPalette *&aPalette) const;

Description

Gets the device's current palette.

Parameters

CPalette *&aPalette

On return, holds the device's current palette.

Return value

TInt

KErrNone, if successful; otherwise, another of the system-wide error codes.


Model()

virtual IMPORT_C TPrinterModelEntry Model() const;

Description

Gets the printer model entry.

Return value

TPrinterModelEntry

The printer model entry.


Flags()

IMPORT_C TInt Flags() const;

Description

Return value

TInt


SetModel()

virtual IMPORT_C TInt SetModel(const TPrinterModelHeader &aModel, CStreamStore &aStore);

Description

Sets the printer model header and the store.

Parameters

const TPrinterModelHeader &aModel

The printer model header.

CStreamStore &aStore

The store.

Return value

TInt

KErrNone if successful; otherwise, another of the system-wide error codes.


ReleaseFont()

virtual IMPORT_C void ReleaseFont(CFont *aFont);

Description

Releases the specified font.

It is used to indicate that the specified font is no longer needed for use by the device map. As fonts can be shared between applications, this function does not delete the copy of the font from RAM unless the font was only being used by this particular device map.

An implementation is supplied by a derived class.

Parameters

CFont *aFont

A pointer to the font to be released.


OffsetInPixels()

IMPORT_C TPoint OffsetInPixels();

Description

Return value

TPoint


KPixelSizeInTwips()

protected: virtual IMPORT_C TSize KPixelSizeInTwips() const;

Description

Return value

TSize

[Top]


Member data


iStore

protected: CStreamStore * iStore;

Description


iModel

protected: TPrinterModelHeader iModel;

Description


iModelInfo

protected: CPdrModelInfo * iModelInfo;

Description


iTypefaceStore

protected: CPdrTypefaceStore * iTypefaceStore;

Description