LafEnv Class Reference

class LafEnv

Application environment level LAF functions.

Public Member Functions
IMPORT_C void Beep ()
IMPORT_C const TDesC & ClockDllName ()
IMPORT_C const TDesC & CoctlResourceFile ()
IMPORT_C CColorList * CreateColorListL ( CEikonEnv &)
IMPORT_C void CreateSystemBitmapsL ( CCoeEnv &, CArrayPtrFlat < CFbsBitmap > &)
IMPORT_C void CreateSystemFontsL ( CCoeEnv &, CArrayPtr < CLafSystemFont > &)
IMPORT_C MParser * CreateTextParserL ( TInt )
IMPORT_C TGulAlignment DefaultBusyMsgCorner ()
IMPORT_C TInt DefaultLineSpacingInTwips ()
IMPORT_C void DisplayAlertAsNotifier (const TDesC &, const TDesC &)
IMPORT_C void DrawLogicalBorder (const TGulBorder &, CGraphicsContext &, const TRect &, const TGulBorder::TColors &)
IMPORT_C TInt EditableControlStandardHeight (const MLafEnv &)
IMPORT_C void GetDefaultPath ( TDes &, TUid , RApaLsSession &, CCoeEnv &)
IMPORT_C void HandleExtensionEventL ( CEikonEnv &, TLafEnvExtensionEvent )
IMPORT_C void InfoNote ( TInt , ...)
IMPORT_C TBool IsDefaultKey ( TUint )
IMPORT_C TBool IsTaskListDisabledAtInitialization ()
IMPORT_C TInt LoadCoreResFileL ( CCoeEnv &)
IMPORT_C TInt LoadPrivResFileL ( CCoeEnv &)
IMPORT_C TMargins LogicalBorderMargins (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 TInt PolicyItem ( TLafEnvPolicyItem )
IMPORT_C void PrepareCharFormatAndMask ( TCharFormat &, TCharFormatMask &)
IMPORT_C void ReleaseSystemFonts ( CArrayPtr < CLafSystemFont > &)
TInt ShadowHeight ()
IMPORT_C void UpdateColorListL ( CColorList *)
IMPORT_C void UpdateSystemBitmapsL ( CCoeEnv &, CArrayPtrFlat < CFbsBitmap > &, const CColorList &)
IMPORT_C void UpdateSystemFontsL ( CCoeEnv *, CArrayPtr < CLafSystemFont > &)
Private Member Functions
IMPORT_C TInt Constant ( TConstantType )
Public Member Enumerations
enum TLafEnvExtensionEvent { ELafEnvPreCoeEnvConstructL , ELafEnvPostCoeEnvConstructL }
enum TLafEnvPolicyItem { ELafEnvPolicyExitIfErrorDuringStartup , ELafEnvPolicyDeleteCorruptDocumentAndContinue , ELAfEnvPolicyDeferredEnvironmentDeletion }
Private Member Enumerations
enum TConstantType { EShadowHeight }

Member Functions Documentation

Beep()

IMPORT_C void Beep ( ) [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 TInt Constant ( TConstantType aConstant ) [private, static]

Gets the value for a specified constant setting.

Returns a constant value according to aConstatType.

Parameters

TConstantType aConstant Type of constant setting to get

CreateColorListL(CEikonEnv &)

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

Creates a default system colour list.

Parameters

CEikonEnv & aEnv The instance of CEikonEnv from which this function has been called

CreateSystemBitmapsL(CCoeEnv &, CArrayPtrFlat< CFbsBitmap > &)

IMPORT_C void CreateSystemBitmapsL ( 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 & aEnv Application's control environment
CArrayPtrFlat < CFbsBitmap > & aBitmaps On return, array of system bitmaps

CreateSystemFontsL(CCoeEnv &, CArrayPtr< CLafSystemFont > &)

IMPORT_C void CreateSystemFontsL ( 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 & aEnv Application's control environment
CArrayPtr < CLafSystemFont > & aFonts On return, array of system fonts

CreateTextParserL(TInt)

IMPORT_C MParser * CreateTextParserL ( TInt aIndex ) [static]

Creates an EText parser.

Creates an EText parser

Parameters

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

DefaultBusyMsgCorner()

IMPORT_C TGulAlignment DefaultBusyMsgCorner ( ) [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 TInt DefaultLineSpacingInTwips ( ) [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 void DisplayAlertAsNotifier ( 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 & aMsg1 Line one of the message to be displayed.
const TDesC & aMsg2 Line two of the message to be displayed

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

IMPORT_C void DrawLogicalBorder ( 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 & aBorder Border specification to draw
CGraphicsContext & aGc Graphics context to which to draw
const TRect & aRect Drawing rectangle
const TGulBorder::TColors & aBorderColors Colours with which to draw

EditableControlStandardHeight(const MLafEnv &)

IMPORT_C TInt EditableControlStandardHeight ( const MLafEnv & aLafEnv ) [static]

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

Parameters

const MLafEnv & aLafEnv Environment access

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

IMPORT_C void GetDefaultPath ( TDes & aFilePath,
TUid aAppUid,
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 & aFilePath On return, the default / generated directory path
TUid aAppUid UID of application being launched
RApaLsSession & aLs Application's session with the Application Architecture server
CCoeEnv & aEnv Thread's control environment

HandleExtensionEventL(CEikonEnv &, TLafEnvExtensionEvent)

IMPORT_C void HandleExtensionEventL ( CEikonEnv & aEnv,
TLafEnvExtensionEvent aEvent
) [static]

Handles events listed by TLafEnvExtensionEvent

Parameters

CEikonEnv & aEnv The instance of CEikonEnv from which this function has been called
TLafEnvExtensionEvent aEvent The event

InfoNote(TInt, ...)

IMPORT_C void InfoNote ( TInt aResourceId,
...
) [static]

Allows debug keys to display output.

Parameters

TInt aResourceId The resource to use for the note
...

IsDefaultKey(TUint)

IMPORT_C TBool IsDefaultKey ( TUint aCharCode ) [static]

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

Returns the hardware key that corresponds to the default key.

Parameters

TUint aCharCode Key to test

IsTaskListDisabledAtInitialization()

IMPORT_C TBool IsTaskListDisabledAtInitialization ( ) [static]

Asks if display of the task list is disabled during initialization

LoadCoreResFileL(CCoeEnv &)

IMPORT_C TInt LoadCoreResFileL ( 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 & aEnv Thread's control environment

LoadPrivResFileL(CCoeEnv &)

IMPORT_C TInt LoadPrivResFileL ( 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 & aEnv Thread's control environment

LogicalBorderMargins(const TGulBorder &)

IMPORT_C TMargins LogicalBorderMargins ( const TGulBorder & aBorder ) [static]

Gets the margins of a specified logical border.

Returns the margins of a logical border for aBorder.

Parameters

const TGulBorder & aBorder Border specification

MatchBitmap(const CArrayPtrFlat< CFbsBitmap > &, TUid)

IMPORT_C CFbsBitmap * MatchBitmap ( const CArrayPtrFlat < CFbsBitmap > & aSystemBmps,
TUid aBmpUid
) [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 > & aSystemBmps Bitmaps from which to select the match
TUid aBmpUid The 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 > & aFonts Fonts from which to select the match
const TLogicalFont & aLogicalFont The logical font to match

NewBusyMsgWinL(CCoeEnv &)

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

Creates busy message window.

Parameters

CCoeEnv & aEnv Thread's control environment

NewInfoMsgWinL(CCoeEnv &)

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

Creates info message window.

Parameters

CCoeEnv & aEnv Thread'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 & aEnv Thread's control environment
RWindowGroup & aWinGroup window group for displaying the Info Msg

PolicyItem(TLafEnvPolicyItem)

IMPORT_C TInt PolicyItem ( TLafEnvPolicyItem aItem ) [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 aItem The policy item.

PrepareCharFormatAndMask(TCharFormat &, TCharFormatMask &)

IMPORT_C void PrepareCharFormatAndMask ( 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 & aCharFormat On return, the character formatting to apply
TCharFormatMask & aCharFormatMask On return, the character formatting mask to apply

ReleaseSystemFonts(CArrayPtr< CLafSystemFont > &)

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

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

Parameters

CArrayPtr < CLafSystemFont > & aSystemFontArray array of fonts to release

ShadowHeight()

TInt ShadowHeight ( ) [static, inline]

Gets the height of shadows to apply to windows.

UpdateColorListL(CColorList *)

IMPORT_C void UpdateColorListL ( CColorList * aColorList ) [static]

Updates an existing color list

Parameters

CColorList * aColorList The color list to be updated.

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

IMPORT_C void UpdateSystemBitmapsL ( 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 & aEnv Thread's control environment
CArrayPtrFlat < CFbsBitmap > & aBitmaps On return, updated array of system bitmaps
const CColorList & aColorList New colour settings

UpdateSystemFontsL(CCoeEnv *, CArrayPtr< CLafSystemFont > &)

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

Updates an existing array of system fonts.

Parameters

CCoeEnv * aEnv Thread's control environment
CArrayPtr < CLafSystemFont > & aSystemFontArray The 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.