CAknEnv Class Reference

class CAknEnv : public CBase

This class is a Series 60 extension to CEikonEnv . Every Avkon application is provided with an instance of CAvkEnv by the framework, which can be accessed through the iAvkonEnv macro.

Since
Series 60 0.9

Inherits from

Nested Classes and Structures

Public Member Functions
~CAknEnv ()
IMPORT_C const AknLayout::CInstance & AknLayout ()
IMPORT_C CAknAppUi * AppWithShutterRunning ()
IMPORT_C TRgb AvkonColor ( TInt )
IMPORT_C void CancelWsBufferRequest ( TInt )
IMPORT_C void CloseAllIntermediateStates ()
IMPORT_C void CreateCbaObserverL (CEikButtonGroupContainer *, CEikListBox *)
IMPORT_C MAknEditingStateIndicator * EditingStateIndicator ()
IMPORT_C void EndCommandMediation ( MEikCommandObserver &)
IMPORT_C void ExecuteEmptyPopupListL (const TDesC *)
IMPORT_C void ExecuteEmptyPopupListL (const TDesC *, const TDesC *, TInt )
IMPORT_C void ExitForegroundAppL ()
IMPORT_C MEikMenuObserver * FepMenuObserver ()
CAknFontRegistry & FontRegistry ()
IMPORT_C void GetCurrentGlobalUiZoom ( TAknUiZoom &)
IMPORT_C void GetCurrentLayoutId ( TAknLayoutId &)
TBool HasBlank ()
IMPORT_C void InformCbaDeletion (CEikButtonGroupContainer *)
TBool IsFeatureLanguage ( TInt )
IMPORT_C TBool LoadAknLayoutL ()
IMPORT_C TBool LoadAknLayoutL (const TAknLayoutConfigScreenMode &)
IMPORT_C void RegisterIntermediateStateL ( MAknIntermediateState *)
void ReloadAknLayoutL ()
IMPORT_C void RemoveCbaObserver ()
IMPORT_C void RequestCommandMediationL (CEikButtonGroupContainer &, MEikCommandObserver &)
IMPORT_C TInt RequestWsBuffer ( TInt )
IMPORT_C void RunAppShutter ()
IMPORT_C void SetFepMenuObserver ( MEikMenuObserver *)
IMPORT_C CAknSettingCache & SettingCache ()
void ShutOrHideAppL ()
IMPORT_C TBool SplitViewActive ()
void SplitViewActive (const TBool )
IMPORT_C CAknEnv * Static ()
IMPORT_C TInt StatusPaneResIdForCurrentLayout ( TInt )
IMPORT_C void StopSchedulerWaitWithBusyMessage ( CActiveSchedulerWait &)
IMPORT_C MAknEditingStateIndicator * SwapEditingStateIndicator ( MAknEditingStateIndicator *)
CArrayPtr < CAknSystemFont > * SystemFontArray ()
void TransitionEvent ( TInt , const TUid &)
void TransitionEvent ( TInt )
IMPORT_C TBool TransparencyEnabled ()
IMPORT_C void UnRegisterIntermediateState ( MAknIntermediateState *)
void UpdateSystemFontsL ()
Private Member Functions
CAknEnv ()
void AssertLayoutLoaded ()
IMPORT_C void ConstructL ()
void DoSchedulerStoppedCallBack ()
IMPORT_C void InstallAknEnvAsExtensionL ( CEikonEnv *)
TBool LoadAknLayoutL ( TAknLayoutId , const TAknLayoutConfigScreenMode &, TAknUiZoom )
TInt PrepareRunInfoArray (const TDesC &)
TInt RealCloseIntermediateStates ( TAny *)
TAknUiZoom ResolveCurrentUiZoom ()
TBidirectionalState::TRunInfo * RunInfoArray ( TInt &)
TInt SchedulerStoppedCallBack ( TAny *)
void SetConeFontSizeArrayL ()
void SetLayoutRequirementsL ()
TInt SetRequiredRunInfoArraySize ( TInt )
void SetWsBufferSize ()
void SetWsBufferSize ( TInt )
TBool TryLoadAknLayoutL ( TAknLayoutId , const TAknLayoutConfigScreenMode &, TAknUiZoom )
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
TInt iBusyMsgCount
CAknWaitDialog * iBusyMsgDialog
MEikCommandObserver * iCbaCommandObserver
CCdlEngineRef * iCdlEngRef
CEikonEnv * iCoeEnv
CAknCommandMediator * iCommandMediator
TInt iCurrentWsBufferRequest
CArrayPtr < CBase > * iDeleteArray
MAknEditingStateIndicator * iEditStateIndicator
TInt iFeatureLanguage
MEikMenuObserver * iFepMenuObserver
CAknFontRegistry * iFontRegistry
CIdle * iIdle
TAknLayoutId iLastLayoutId
TInt iLastScreenMode
TAknUiZoom iLastZoom
const AknLayout::CInstance * iLayout
TInt iRequestIdCounter
TBidirectionalState::TRunInfo * iRunInfoArray
TInt iRunInfoArrayLength
CAknSettingCache * iSettingCache
TBool iSplitViewActive
CArrayPtr < MAknIntermediateState > * iStateArray
CArrayPtr < CAknSystemFont > * iSystemFontArray
CTransitionManager * iTransitionManager
RArray < TWsBufferRequest > iWsBufferRequestArray

Constructor & Destructor Documentation

CAknEnv()

IMPORT_C CAknEnv ( ) [private]

~CAknEnv()

IMPORT_C ~CAknEnv ( )

Destructor.

Member Functions Documentation

AknLayout()

IMPORT_C const AknLayout::CInstance & AknLayout ( ) const

Accessor method to layout.

Since
Series 60 2.6

AppWithShutterRunning()

IMPORT_C CAknAppUi * AppWithShutterRunning ( ) [static]

Get pointer to the most embedded application UI with Dialog Shutter running.

AssertLayoutLoaded()

void AssertLayoutLoaded ( ) [private]

AvkonColor(TInt)

IMPORT_C TRgb AvkonColor ( TInt ) [static]

Gets the TRgb value of the entry at the specified index in the colour lookup table.

Since
Series 60 0.9

Parameters

TInt

CancelWsBufferRequest(TInt)

IMPORT_C void CancelWsBufferRequest ( TInt aRequestID )

Cancels a request made by call RequestWsBuffer . This should be called in order to save RAM when higher than normal buffer size is no longer required.

Since
Series 60 2.0

Parameters

TInt aRequestID The request ID returned by the RequestWsBuffer call which is to be canceled. Negative values are treated as error codes and ignored.

CloseAllIntermediateStates()

IMPORT_C void CloseAllIntermediateStates ( )

Closes all intermediate states as a low-priority process.

ConstructL()

IMPORT_C void ConstructL ( ) [private]

CreateCbaObserverL(CEikButtonGroupContainer *, CEikListBox *)

IMPORT_C void CreateCbaObserverL ( CEikButtonGroupContainer * aCba,
CEikListBox * aListBox
)

Create CBA observer. The possible existing one is removed first.

Parameters

CEikButtonGroupContainer * aCba A control which ProcessCommandL handles the command.
CEikListBox * aListBox Stored to data member iListBox.

DoSchedulerStoppedCallBack()

void DoSchedulerStoppedCallBack ( ) [private]

EditingStateIndicator()

IMPORT_C MAknEditingStateIndicator * EditingStateIndicator ( )

Get the editing state indicator.

EndCommandMediation(MEikCommandObserver &)

IMPORT_C void EndCommandMediation ( MEikCommandObserver & aCommandObserver )

Ends mediating MSK commands to specified command observer. If commands are being mediated to the specifed observer, the command mediator is removed from the CBA to end mediation.

Parameters

MEikCommandObserver & aCommandObserver An observer.

ExecuteEmptyPopupListL(const TDesC *)

IMPORT_C void ExecuteEmptyPopupListL ( const TDesC * aEmptyText = 0 )

Executes empty popup list.

Parameters

const TDesC * aEmptyText = 0 Text indicating empty popup list. NULL if R_AVKON_EMPTY_POPUP_LIST_TEXT used.

ExecuteEmptyPopupListL(const TDesC *, const TDesC *, TInt)

IMPORT_C void ExecuteEmptyPopupListL ( const TDesC * aEmptyText,
const TDesC * aTitle,
TInt aSoftkeyId = 0
)

Executes empty popup list. aSoftkeyId is soft key rescource used, but shown without left soft key (except R_AVKON_SOFTKEYS_OK_EMPTY ).

Parameters

const TDesC * aEmptyText Text indicating empty popup list. NULL if R_AVKON_EMPTY_POPUP_LIST_TEXT used.
const TDesC * aTitle A title of the popup list.
TInt aSoftkeyId = 0

ExitForegroundAppL()

IMPORT_C void ExitForegroundAppL ( ) [static]

Exit foreground application.

FepMenuObserver()

IMPORT_C MEikMenuObserver * FepMenuObserver ( )

Get the FEP menu observer.

FontRegistry()

CAknFontRegistry & FontRegistry ( ) const

Access to the registry of CAknLayoutFont pointers. Used for runtime checking of CFont pointers.

GetCurrentGlobalUiZoom(TAknUiZoom &)

IMPORT_C void GetCurrentGlobalUiZoom ( TAknUiZoom & aCurrentGlobalUiZoom ) const
Get current global zoom
Since
3.1

Parameters

TAknUiZoom & aCurrentGlobalUiZoom On return, contains current global zoom.

GetCurrentLayoutId(TAknLayoutId &)

IMPORT_C void GetCurrentLayoutId ( TAknLayoutId & aCurrentLayoutId ) const
Get current layout ID.
Since
Series 60 2.0

Parameters

TAknLayoutId & aCurrentLayoutId On return, contains current layout ID.

HasBlank()

TBool HasBlank ( ) const

InformCbaDeletion(CEikButtonGroupContainer *)

IMPORT_C void InformCbaDeletion ( CEikButtonGroupContainer * aCba )

Remove CBA observer if the right one.

Parameters

CEikButtonGroupContainer * aCba CBA to be checked.

InstallAknEnvAsExtensionL(CEikonEnv *)

IMPORT_C void InstallAknEnvAsExtensionL ( CEikonEnv * aEnv ) [private, static]

Parameters

CEikonEnv * aEnv

IsFeatureLanguage(TInt)

TBool IsFeatureLanguage ( TInt aFeatureLanguage )

Parameters

TInt aFeatureLanguage

LoadAknLayoutL()

IMPORT_C TBool LoadAknLayoutL ( )

Load an appropriate Avkon layout.

Since
Series 60 2.6

LoadAknLayoutL(const TAknLayoutConfigScreenMode &)

IMPORT_C TBool LoadAknLayoutL ( const TAknLayoutConfigScreenMode & aScreenMode )

Load an appropriate Avkon layout for a particular screen mode.

Since
Series 60 3.1

Parameters

const TAknLayoutConfigScreenMode & aScreenMode The screen mode which the layout is required for

LoadAknLayoutL(TAknLayoutId, const TAknLayoutConfigScreenMode &, TAknUiZoom)

TBool LoadAknLayoutL ( TAknLayoutId aId,
const TAknLayoutConfigScreenMode & aScreenMode,
TAknUiZoom aUiZoom
) [private]

Parameters

TAknLayoutId aId
const TAknLayoutConfigScreenMode & aScreenMode
TAknUiZoom aUiZoom

PrepareRunInfoArray(const TDesC &)

TInt PrepareRunInfoArray ( const TDesC & aLogicalText ) [private]

Tests how big run info array the given text requires and tries to increase the size of the array if required.

Parameters

const TDesC & aLogicalText Text in logical order.

RealCloseIntermediateStates(TAny *)

TInt RealCloseIntermediateStates ( TAny * aEnv ) [private, static]

Parameters

TAny * aEnv

RegisterIntermediateStateL(MAknIntermediateState *)

IMPORT_C void RegisterIntermediateStateL ( MAknIntermediateState * aState )

Register the control implementing intermediate states. Call iAvkonEnv->RegisterIntermediateState(this) in control's ActivateL() .

Parameters

MAknIntermediateState * aState The control implementing intermediate states.

ReloadAknLayoutL()

void ReloadAknLayoutL ( )

Re-load the current Avkon layout, in case there are new layout instances present.

Since
Series 60 5.1

RemoveCbaObserver()

IMPORT_C void RemoveCbaObserver ( )

Remove CBA observer.

RequestCommandMediationL(CEikButtonGroupContainer &, MEikCommandObserver &)

IMPORT_C void RequestCommandMediationL ( CEikButtonGroupContainer & aCba,
MEikCommandObserver & aCommandObserver
)

Requests mediation of MSK commmands from specified CBA to the given observer. When called for the first time, this method creates an observer that is added to specified CBA to observe MSK commands and to mediate all received events to the given observer. The created observer exists until the CAknEnv instance is destroyed. All subsequent calls to this method replace the previously requested mediation.

Parameters

CEikButtonGroupContainer & aCba CBA whose MSK is to be observed.
MEikCommandObserver & aCommandObserver An observer for which the commands are sent.

RequestWsBuffer(TInt)

IMPORT_C TInt RequestWsBuffer ( TInt aRequestedBufferSize )

Requests Window Server client buffer used by the application to be of at least the given size. All code that wants to increase (to avoid flicker) or decrease (to save RAM) the buffer compared to the default size should call this method instead of using WS interface directly. A list of all requests is maintained and the highest request is always effective. Only if there are no requests done, the default buffer size is used.

Since
Series 60 2.0

Parameters

TInt aRequestedBufferSize requested Window Server client buffer size.

ResolveCurrentUiZoom()

TAknUiZoom ResolveCurrentUiZoom ( ) [private]

RunAppShutter()

IMPORT_C void RunAppShutter ( ) [static]

Run application shutter.

RunInfoArray(TInt &)

TBidirectionalState::TRunInfo * RunInfoArray ( TInt & aLength ) const [private]

Returns run info array owned by AknEnv.

Parameters

TInt & aLength Length of the array is returned here.

SchedulerStoppedCallBack(TAny *)

TInt SchedulerStoppedCallBack ( TAny * aWaitNote ) [private, static]

Parameters

TAny * aWaitNote

SetConeFontSizeArrayL()

void SetConeFontSizeArrayL ( ) const [private]

Use the currently loaded layout to set the values of the font size array used by CCoeFontProvider.

SetFepMenuObserver(MEikMenuObserver *)

IMPORT_C void SetFepMenuObserver ( MEikMenuObserver * aObserver )

Set the FEP menu observer.

Parameters

MEikMenuObserver * aObserver the FEP menu observer.

SetLayoutRequirementsL()

void SetLayoutRequirementsL ( ) [private]

SetRequiredRunInfoArraySize(TInt)

TInt SetRequiredRunInfoArraySize ( TInt aLength ) [private]

Tries to increase the size of the run info array if it is currently smaller than given length.

Parameters

TInt aLength Length of the new run info array to be allocated.

SetWsBufferSize()

void SetWsBufferSize ( ) [private]

SetWsBufferSize(TInt)

void SetWsBufferSize ( TInt aRequestedBufferSize ) [private]

Parameters

TInt aRequestedBufferSize

SettingCache()

IMPORT_C CAknSettingCache & SettingCache ( ) const

ShutOrHideAppL()

void ShutOrHideAppL ( ) [static]

SplitViewActive()

IMPORT_C TBool SplitViewActive ( ) const
Checks if split view is active.
Since
Series 60 5.0

SplitViewActive(const TBool)

void SplitViewActive ( const TBool aSplitViewActive )
Sets split view flag.
Since
Series 60 5.0

Parameters

const TBool aSplitViewActive Etrue if split view is active.

Static()

IMPORT_C CAknEnv * Static ( ) [static]

Gets the CAknEnv maintained by the framework for the application. Compare CCoeEnv::Static() .

This function should never be run in a thread where such a static Avkon environment does not exist. Code that may run on the server side of an application server is one such case.

StatusPaneResIdForCurrentLayout(TInt)

IMPORT_C TInt StatusPaneResIdForCurrentLayout ( TInt aResId ) const
Tells the type of status pane layout for UI.
Since
Series 60 2.0

Parameters

TInt aResId resource id for current layout.

StopSchedulerWaitWithBusyMessage(CActiveSchedulerWait &)

IMPORT_C void StopSchedulerWaitWithBusyMessage ( CActiveSchedulerWait & aWait ) [static]

Stop the scheduler. If the waiting control can't stop the scheduler immediately, then trying to show a busy note.

Parameters

CActiveSchedulerWait & aWait Scheduler object to be stopped.

SwapEditingStateIndicator(MAknEditingStateIndicator *)

IMPORT_C MAknEditingStateIndicator * SwapEditingStateIndicator ( MAknEditingStateIndicator * aIndicator )

Swap the editing state indicator.

Parameters

MAknEditingStateIndicator * aIndicator The new editing state indicator.

SystemFontArray()

CArrayPtr < CAknSystemFont > * SystemFontArray ( ) const

Access to the system font array that is owned by CEikonEnv . The member accessed by this is set during CEikonEnv construction and may be null during application startup.

TransitionEvent(TInt, const TUid &)

void TransitionEvent ( TInt aEvent,
const TUid & aAppUid
)

Parameters

TInt aEvent
const TUid & aAppUid

TransitionEvent(TInt)

void TransitionEvent ( TInt aEvent )

Parameters

TInt aEvent

TransparencyEnabled()

IMPORT_C TBool TransparencyEnabled ( ) const

Return if Transparency is Enabled .

Since
5.0

TryLoadAknLayoutL(TAknLayoutId, const TAknLayoutConfigScreenMode &, TAknUiZoom)

TBool TryLoadAknLayoutL ( TAknLayoutId aId,
const TAknLayoutConfigScreenMode & aScreenMode,
TAknUiZoom aUiZoom
) [private]

Parameters

TAknLayoutId aId
const TAknLayoutConfigScreenMode & aScreenMode
TAknUiZoom aUiZoom

UnRegisterIntermediateState(MAknIntermediateState *)

IMPORT_C void UnRegisterIntermediateState ( MAknIntermediateState * aState )

Unregister the control implementing intermediate states. Call iAvkonEnv->UnRegisterIntermediateState(this) in control's destructor.

Parameters

MAknIntermediateState * aState The control implementing intermediate states.

UpdateSystemFontsL()

void UpdateSystemFontsL ( )

Member Data Documentation

TInt iBusyMsgCount

TInt iBusyMsgCount [private]

CAknWaitDialog * iBusyMsgDialog

CAknWaitDialog * iBusyMsgDialog [private]

MEikCommandObserver * iCbaCommandObserver

MEikCommandObserver * iCbaCommandObserver [private]

CCdlEngineRef * iCdlEngRef

CCdlEngineRef * iCdlEngRef [private]

CEikonEnv * iCoeEnv

CEikonEnv * iCoeEnv [private]

CAknCommandMediator * iCommandMediator

CAknCommandMediator * iCommandMediator [private]

TInt iCurrentWsBufferRequest

TInt iCurrentWsBufferRequest [private]

CArrayPtr< CBase > * iDeleteArray

CArrayPtr < CBase > * iDeleteArray [private]

MAknEditingStateIndicator * iEditStateIndicator

MAknEditingStateIndicator * iEditStateIndicator [private]

TInt iFeatureLanguage

TInt iFeatureLanguage [private]

MEikMenuObserver * iFepMenuObserver

MEikMenuObserver * iFepMenuObserver [private]

CAknFontRegistry * iFontRegistry

CAknFontRegistry * iFontRegistry [private]

CIdle * iIdle

CIdle * iIdle [private]

TAknLayoutId iLastLayoutId

TAknLayoutId iLastLayoutId [private]

TInt iLastScreenMode

TInt iLastScreenMode [private]

TAknUiZoom iLastZoom

TAknUiZoom iLastZoom [private]

const AknLayout::CInstance * iLayout

const AknLayout::CInstance * iLayout [private]

TInt iRequestIdCounter

TInt iRequestIdCounter [private]

TBidirectionalState::TRunInfo * iRunInfoArray

TBidirectionalState::TRunInfo * iRunInfoArray [private]

TInt iRunInfoArrayLength

TInt iRunInfoArrayLength [private]

CAknSettingCache * iSettingCache

CAknSettingCache * iSettingCache [private]

TBool iSplitViewActive

TBool iSplitViewActive [private]

CArrayPtr< MAknIntermediateState > * iStateArray

CArrayPtr < MAknIntermediateState > * iStateArray [private]

CArrayPtr< CAknSystemFont > * iSystemFontArray

CArrayPtr < CAknSystemFont > * iSystemFontArray [private]

CTransitionManager * iTransitionManager

CTransitionManager * iTransitionManager [private]

RArray< TWsBufferRequest > iWsBufferRequestArray

RArray < TWsBufferRequest > iWsBufferRequestArray [private]