LafEnv Class Reference

class LafEnv

Application environment level LAF functions.

Public Member Functions
IMPORT_C voidBeep()
IMPORT_C const TDesC &ClockDllName()
IMPORT_C const TDesC &CoctlResourceFile()
IMPORT_C CColorList *CreateColorListL(CEikonEnv &)
IMPORT_C voidCreateSystemBitmapsL(CCoeEnv &, CArrayPtrFlat< CFbsBitmap > &)
IMPORT_C voidCreateSystemFontsL(CCoeEnv &, CArrayPtr< CLafSystemFont > &)
IMPORT_C MParser *CreateTextParserL(TInt)
IMPORT_C TGulAlignmentDefaultBusyMsgCorner()
IMPORT_C TIntDefaultLineSpacingInTwips()
IMPORT_C voidDisplayAlertAsNotifier(const TDesC &, const TDesC &)
IMPORT_C voidDrawLogicalBorder(const TGulBorder &, CGraphicsContext &, const TRect &, const TGulBorder::TColors &)
IMPORT_C TIntEditableControlStandardHeight(const MLafEnv &)
IMPORT_C voidGetDefaultPath(TDes &, TUid, RApaLsSession &, CCoeEnv &)
IMPORT_C voidHandleExtensionEventL(CEikonEnv &, TLafEnvExtensionEvent)
IMPORT_C voidInfoNote(TInt, ...)
IMPORT_C TBoolIsDefaultKey(TUint)
IMPORT_C TBoolIsTaskListDisabledAtInitialization()
IMPORT_C TIntLoadCoreResFileL(CCoeEnv &)
IMPORT_C TIntLoadPrivResFileL(CCoeEnv &)
IMPORT_C TMarginsLogicalBorderMargins(const TGulBorder &)
IMPORT_C CFbsBitmap *MatchBitmap(const CArrayPtrFlat< CFbsBitmap > &, TUid)
IMPORT_C const CFont *MatchFont(CArrayPtr< CLafSystemFont > &, const TLogicalFont &)
IMPORT_C MEikBusyMsgWin *NewBusyMsgWinL(CCoeEnv &)
IMPORT_C MEikInfoMsgWin *NewInfoMsgWinL(CCoeEnv &)
IMPORT_C MEikInfoMsgWin *NewInfoMsgWinL(CCoeEnv &, RWindowGroup &)
IMPORT_C TIntPolicyItem(TLafEnvPolicyItem)
IMPORT_C voidPrepareCharFormatAndMask(TCharFormat &, TCharFormatMask &)
IMPORT_C voidReleaseSystemFonts(CArrayPtr< CLafSystemFont > &)
TInt ShadowHeight()
IMPORT_C voidUpdateColorListL(CColorList *)
IMPORT_C voidUpdateSystemBitmapsL(CCoeEnv &, CArrayPtrFlat< CFbsBitmap > &, const CColorList &)
IMPORT_C voidUpdateSystemFontsL(CCoeEnv *, CArrayPtr< CLafSystemFont > &)
Private Member Functions
IMPORT_C TIntConstant(TConstantType)
Public Member Enumerations
enumTLafEnvExtensionEvent { ELafEnvPreCoeEnvConstructL, ELafEnvPostCoeEnvConstructL }
enumTLafEnvPolicyItem { ELafEnvPolicyExitIfErrorDuringStartup, ELafEnvPolicyDeleteCorruptDocumentAndContinue, ELAfEnvPolicyDeferredEnvironmentDeletion }
Private Member Enumerations
enumTConstantType { EShadowHeight }

Member Functions Documentation

Beep()

IMPORT_C voidBeep()[static]

Plays an audible alert, if supported by the system GUI.

ClockDllName()

IMPORT_C const TDesC &ClockDllName()[static]

Gets the name of the clock DLL

CoctlResourceFile()

IMPORT_C const TDesC &CoctlResourceFile()[static]

Gets the name of the resource file that contains resources for the EIKCOCTL component.

Returns the Coctl Resource File Test

Constant(TConstantType)

IMPORT_C TIntConstant(TConstantTypeaConstant)[private, static]

Gets the value for a specified constant setting.

Returns a constant value according to aConstatType.

Parameters

TConstantType aConstantType of constant setting to get

CreateColorListL(CEikonEnv &)

IMPORT_C CColorList *CreateColorListL(CEikonEnv &aEnv)[static]

Creates a default system colour list.

Parameters

CEikonEnv & aEnvThe instance of CEikonEnv from which this function has been called

CreateSystemBitmapsL(CCoeEnv &, CArrayPtrFlat< CFbsBitmap > &)

IMPORT_C voidCreateSystemBitmapsL(CCoeEnv &aEnv,
CArrayPtrFlat< CFbsBitmap > &aBitmaps
)[static]

Populates an array with a set of system bitmaps.

CEikonEnv calls this to get system bitmaps, and uses the array in subsequent calls to MatchBitmap().

Populates aBitmaps with a set of system bitmaps.

Parameters

CCoeEnv & aEnvApplication's control environment
CArrayPtrFlat< CFbsBitmap > & aBitmapsOn return, array of system bitmaps

CreateSystemFontsL(CCoeEnv &, CArrayPtr< CLafSystemFont > &)

IMPORT_C voidCreateSystemFontsL(CCoeEnv &aEnv,
CArrayPtr< CLafSystemFont > &aFonts
)[static]

Populates an array with a set of system fonts.

CEikonEnv calls this to get system fonts, and uses the array in subsequent calls to MatchFont().

A minimum of one font must be created.

Populate aFonts with a set of system fonts defined in eikpriv.rss A minimum of one font must be created.

Parameters

CCoeEnv & aEnvApplication's control environment
CArrayPtr< CLafSystemFont > & aFontsOn return, array of system fonts

CreateTextParserL(TInt)

IMPORT_C MParser *CreateTextParserL(TIntaIndex)[static]

Creates an EText parser.

Creates an EText parser

Parameters

TInt aIndexIndex of parser to retrieve. A LAF can supply multiple parsers, indexed from 0.

DefaultBusyMsgCorner()

IMPORT_C TGulAlignmentDefaultBusyMsgCorner()[static]

Gets the corner of the screen which the busy message should appear in by default on the device.

CEikonEnv::BusyMsgL()Returns the corner of the screen which the busy message should appear in by default on the device.

DefaultLineSpacingInTwips()

IMPORT_C TIntDefaultLineSpacingInTwips()[static]

Gets the default line spacing used to format text paragraphs.

Returns the default line spacing used to format text paragraphs.

DisplayAlertAsNotifier(const TDesC &, const TDesC &)

IMPORT_C voidDisplayAlertAsNotifier(const TDesC &aMsg1,
const TDesC &aMsg2
)[static]

Displays a one or two line alert as a notifier window customisable by the system GUI.

Parameters

const TDesC & aMsg1Line one of the message to be displayed.
const TDesC & aMsg2Line two of the message to be displayed

DrawLogicalBorder(const TGulBorder &, CGraphicsContext &, const TRect &, const TGulBorder::TColors &)

IMPORT_C voidDrawLogicalBorder(const TGulBorder &aBorder,
CGraphicsContext &aGc,
const TRect &aRect,
const TGulBorder::TColors &aBorderColors
)[static]

Draws a logical border.

Draw's a logical border for aBorder, onto the graphics context aGc, in the rectangle aRect and using the set of colors aBorderColors.

Parameters

const TGulBorder & aBorderBorder specification to draw
CGraphicsContext & aGcGraphics context to which to draw
const TRect & aRectDrawing rectangle
const TGulBorder::TColors & aBorderColorsColours with which to draw

EditableControlStandardHeight(const MLafEnv &)

IMPORT_C TIntEditableControlStandardHeight(const MLafEnv &aLafEnv)[static]

Gets the height of single-line edit control for the system normal font.

Parameters

const MLafEnv & aLafEnvEnvironment access

GetDefaultPath(TDes &, TUid, RApaLsSession &, CCoeEnv &)

IMPORT_C voidGetDefaultPath(TDes &aFilePath,
TUidaAppUid,
RApaLsSession &aLs,
CCoeEnv &aEnv
)[static]

Specifies (and creates if necessary) a default directory for documents.

The function is called on application startup. The parameters provided are to allow an implementation to generate a document directory based on the application being launched.

Allows individual DFRDs to specify a default directory for documents or to generate one.

The parameters provided are not necessary in the UIKLAF implementation but are there to allow a DFRD enough information to generate a document directory based on the app being launched

aFilePath receives the default / generated directory path.

Parameters

TDes & aFilePathOn return, the default / generated directory path
TUid aAppUidUID of application being launched
RApaLsSession & aLsApplication's session with the Application Architecture server
CCoeEnv & aEnvThread's control environment

HandleExtensionEventL(CEikonEnv &, TLafEnvExtensionEvent)

IMPORT_C voidHandleExtensionEventL(CEikonEnv &aEnv,
TLafEnvExtensionEventaEvent
)[static]

Handles events listed by TLafEnvExtensionEvent

Parameters

CEikonEnv & aEnvThe instance of CEikonEnv from which this function has been called
TLafEnvExtensionEvent aEventThe event

InfoNote(TInt, ...)

IMPORT_C voidInfoNote(TIntaResourceId,
...
)[static]

Allows debug keys to display output.

Parameters

TInt aResourceIdThe resource to use for the note
...

IsDefaultKey(TUint)

IMPORT_C TBoolIsDefaultKey(TUintaCharCode)[static]

Tests if the specified key corresponds to the hardware default key.

Returns the hardware key that corresponds to the default key.

Parameters

TUint aCharCodeKey to test

IsTaskListDisabledAtInitialization()

IMPORT_C TBoolIsTaskListDisabledAtInitialization()[static]

Asks if display of the task list is disabled during initialization

LoadCoreResFileL(CCoeEnv &)

IMPORT_C TIntLoadCoreResFileL(CCoeEnv &aEnv)[static]

Loads the system resource file.

The system resource file defines resources required by the system environment, and which can also be used by applications. The function is called by CCoeEnv's construction function.

Loads the system resource file Test

Parameters

CCoeEnv & aEnvThread's control environment

LoadPrivResFileL(CCoeEnv &)

IMPORT_C TIntLoadPrivResFileL(CCoeEnv &aEnv)[static]

Loads the private resource file.

The private resource file defines resources required by the system environment, but not intended for application use. The function is called by CCoeEnv's construction function.

Loads the private resource file Test

Parameters

CCoeEnv & aEnvThread's control environment

LogicalBorderMargins(const TGulBorder &)

IMPORT_C TMarginsLogicalBorderMargins(const TGulBorder &aBorder)[static]

Gets the margins of a specified logical border.

Returns the margins of a logical border for aBorder.

Parameters

const TGulBorder & aBorderBorder specification

MatchBitmap(const CArrayPtrFlat< CFbsBitmap > &, TUid)

IMPORT_C CFbsBitmap *MatchBitmap(const CArrayPtrFlat< CFbsBitmap > &aSystemBmps,
TUidaBmpUid
)[static]

Gets the nearest match in the specified bitmaps for a specified system bitmap type.

The desired bitmap is specified by the identifer aBmpUid: for possible UIDs, see KLafUidEikonTexturedVal etc.

The return value must be non-NULL.

Returns the nearest match to aBmpUid in aSystemBitmaps.

Parameters

const CArrayPtrFlat< CFbsBitmap > & aSystemBmpsBitmaps from which to select the match
TUid aBmpUidThe bitmap type to match

MatchFont(CArrayPtr< CLafSystemFont > &, const TLogicalFont &)

IMPORT_C const CFont *MatchFont(CArrayPtr< CLafSystemFont > &aFonts,
const TLogicalFont &aLogicalFont
)[static]

Gets the nearest match in the specified fonts for a specified logical system font.

The return value must be non-NULL.

Return the nearest match to aLogicalFont in aSystemFonts. If given an ordinary font Uid it returns the font. If it is given one of the LogicalFont Uid's it will effectively map this to a genuine font Uid and recursively call MatchFont but this time with a proper Uid (will not do any further nested calls) If it is given a LogicalFont with no Uid but with a category, it uses the category to figure out what Logical Font Uid to use, and then does a recursive call to MatchFont (i.e. itself) witha Logical Font Uid as parameter, returning you to the situation just discussed above. Thus at worst we get a call within a call within a call.

The return value must be non-NULL

Parameters

CArrayPtr< CLafSystemFont > & aFontsFonts from which to select the match
const TLogicalFont & aLogicalFontThe logical font to match

NewBusyMsgWinL(CCoeEnv &)

IMPORT_C MEikBusyMsgWin *NewBusyMsgWinL(CCoeEnv &aEnv)[static]

Creates busy message window.

Parameters

CCoeEnv & aEnvThread's control environment

NewInfoMsgWinL(CCoeEnv &)

IMPORT_C MEikInfoMsgWin *NewInfoMsgWinL(CCoeEnv &aEnv)[static]

Creates info message window.

Parameters

CCoeEnv & aEnvThread's control environment

NewInfoMsgWinL(CCoeEnv &, RWindowGroup &)

IMPORT_C MEikInfoMsgWin *NewInfoMsgWinL(CCoeEnv &aEnv,
RWindowGroup &aWinGroup
)[static]

Creates info message window, overridden function to allow another RWindowGroup to be used rather the the the CCoeEnv's RootWin() function.

Parameters

CCoeEnv & aEnvThread's control environment
RWindowGroup & aWinGroupwindow group for displaying the Info Msg

PolicyItem(TLafEnvPolicyItem)

IMPORT_C TIntPolicyItem(TLafEnvPolicyItemaItem)[static]

CEikonEnv will use this function to find out how it should behave. The list of things that can be customized this way are listed by TLafEnvPolicyItem.

Parameters

TLafEnvPolicyItem aItemThe policy item.

PrepareCharFormatAndMask(TCharFormat &, TCharFormatMask &)

IMPORT_C voidPrepareCharFormatAndMask(TCharFormat &aCharFormat,
TCharFormatMask &aCharFormatMask
)[static]

Sets any device-specific font attributes to be applied to the system character formatting layer.

Applications can access the format layer through CEikonEnv::SystemCharFormatLayerL(). This format layer is also used in Edwins.

Sets any device specific font attributes to be applied to CEikonEnv's iCharFormatLayer. This format layer is used in Edwins. CEikonEnv's iCharFormatLayer may be used in other apps on some devices, so should be changed with care.

Parameters

TCharFormat & aCharFormatOn return, the character formatting to apply
TCharFormatMask & aCharFormatMaskOn return, the character formatting mask to apply

ReleaseSystemFonts(CArrayPtr< CLafSystemFont > &)

IMPORT_C voidReleaseSystemFonts(CArrayPtr< CLafSystemFont > &aSystemFontArray)[static]

Performs the releasing of the fonts but doesn't delete the array itself

Parameters

CArrayPtr< CLafSystemFont > & aSystemFontArrayarray of fonts to release

ShadowHeight()

TInt ShadowHeight()[static, inline]

Gets the height of shadows to apply to windows.

UpdateColorListL(CColorList *)

IMPORT_C voidUpdateColorListL(CColorList *aColorList)[static]

Updates an existing color list

Parameters

CColorList * aColorListThe color list to be updated.

UpdateSystemBitmapsL(CCoeEnv &, CArrayPtrFlat< CFbsBitmap > &, const CColorList &)

IMPORT_C voidUpdateSystemBitmapsL(CCoeEnv &aEnv,
CArrayPtrFlat< CFbsBitmap > &aBitmaps,
const CColorList &aColorList
)[static]

Allows the LAF to update the list of system bitmaps, in response to a colour settings change.

Allows to update the list of system bitmaps, aBitmaps, by using aColorList in order to determine what bitmaps need to be un/loaded. Test

Parameters

CCoeEnv & aEnvThread's control environment
CArrayPtrFlat< CFbsBitmap > & aBitmapsOn return, updated array of system bitmaps
const CColorList & aColorListNew colour settings

UpdateSystemFontsL(CCoeEnv *, CArrayPtr< CLafSystemFont > &)

IMPORT_C voidUpdateSystemFontsL(CCoeEnv *aEnv,
CArrayPtr< CLafSystemFont > &aSystemFontArray
)[static]

Updates an existing array of system fonts.

Parameters

CCoeEnv * aEnvThread's control environment
CArrayPtr< CLafSystemFont > & aSystemFontArrayThe array of fonts to be updated

Member Enumerations Documentation

Enum TConstantType

Defines types of constant setting relevant to LAFs.

Enumerators

EShadowHeight

Window shadow height.

Enum TLafEnvExtensionEvent

A list of events that are handled by the HandleExtensionEventL() function.

Enumerators

ELafEnvPreCoeEnvConstructL

Event sent in CEikonEnv::ConstructL right before CCoeEnv::ConstructL()

ELafEnvPostCoeEnvConstructL

Event sent in CEikonEnv::ConstructL right after CCoeEnv::ConstructL()

Enum TLafEnvPolicyItem

The behaviour of CEikonEnv can be customized. This enum lists the things that can be customized.

Enumerators

ELafEnvPolicyExitIfErrorDuringStartup

The action to take when there is an error during startup.

ELafEnvPolicyDeleteCorruptDocumentAndContinue

The action to take when the document is corrupt.

ELAfEnvPolicyDeferredEnvironmentDeletion

This affects the way the environment is deleted.