CCoeEnv Class Reference

#include <mw/coemain.h>

Link against: cone.lib

class CCoeEnv : public CActive, public MObjectProvider

Inherits from

Protected Attributes
CCoeAppUi *iAppUi
RFs iFsSession
TWsEvent iLastEvent
const CFont *iNormalFont
CArrayFix< RResourceFile > *iResourceFileArray
RWindowGroup iRootWin
CWsScreenDevice *iScreen
CWindowGc *iSystemGc
RWsSession iWsSession
Public Member Functions
CCoeEnv()
~CCoeEnv()
IMPORT_C voidAddFepObserverL(MCoeFepObserver &)
IMPORT_C voidAddFocusObserverL(MCoeFocusObserver &)
IMPORT_C voidAddForegroundObserverL(MCoeForegroundObserver &)
IMPORT_C voidAddMessageMonitorObserverL(MCoeMessageMonitorObserver &)
IMPORT_C voidAddMessageObserverL(MCoeMessageObserver &)
IMPORT_C voidAddObserverOfLoadedFepL(MCoeObserverOfLoadedFep &)
IMPORT_C voidAddResourceChangeObserverL(MCoeResourceChangeObserver &)
IMPORT_C TIntAddResourceFileL(const TDesC &)
voidAddStatic(CCoeStatic *)
IMPORT_C HBufC16 *AllocReadResourceAsDes16L(TInt)
IMPORT_C HBufC16 *AllocReadResourceAsDes16LC(TInt)
IMPORT_C HBufC8 *AllocReadResourceAsDes8L(TInt)
IMPORT_C HBufC8 *AllocReadResourceAsDes8LC(TInt)
HBufC *AllocReadResourceL(TInt)
HBufC *AllocReadResourceLC(TInt)
TInt AppStartupInstrumentationEventIdBase()
CCoeAppUi *AppUi()
IMPORT_C voidAvailableFepsL(RArray< TUid > &, CDesCArray *)
IMPORT_C voidBringOwnerToFront()
IMPORT_C voidConstructL()
IMPORT_C voidConstructL(TBool)
IMPORT_C voidConstructL(TBool, TInt)
IMPORT_C voidConstructL(TBool, TInt, TInt)
TBool ControlStateChange()
IMPORT_C CFbsFont *CreateDeviceFontL(CGraphicsDevice *, const TFontSpec &)
IMPORT_C CWindowGc *CreateGcL()
IMPORT_C voidCreateResourceReaderLC(TResourceReader &, TInt)
IMPORT_C CFbsFont *CreateScreenFontL(const TFontSpec &)
IMPORT_C const CCoeFontProvider &DefaultFontProvider()
IMPORT_C CCoeTextDrawerBase &DefaultTextDrawer()
IMPORT_C voidDeleteResourceFile(TInt)
virtual IMPORT_C voidDestroyEnvironment()
IMPORT_C voidDisableExitChecks(TBool)
IMPORT_C TBoolDisableShutdownChecks()
virtual IMPORT_C voidDoCancel()
voidDoFlush()
voidEnableEventData()
voidEnsureCorrectFepIsLoadedL()
voidEnsureSpecifiedFepIsLoadedL(TUid)
TBool EventDataEnabled()
CCoeEventManager &EventManager()
IMPORT_C voidExecute()
IMPORT_C voidExecuteD()
IMPORT_C voidExecuteFepSettingsDialogL(TUid)
IMPORT_C CCoeFep *Fep()
IMPORT_C TUidFepUid()
IMPORT_C CCoeStatic *FindStatic(TUid)
IMPORT_C voidFlush(TTimeIntervalMicroSeconds32)
TInt FocusObserverNotificationIdentifier()
TBool FocusObserverNotificationIsStillPending(TInt)
IMPORT_C voidForEachFepObserverCall(TCoeFepObserverFunction)
IMPORT_C voidFormat128(TDes &, TInt, ...)
IMPORT_C voidFormat256(TDes &, TInt, ...)
RFs &FsSession()
IMPORT_C voidGetMessageNotifyingObserversLC(TUint32, TUid &, TPtr8 &, const TWsEvent &)
virtual IMPORT_C voidHandleError(TInt)
CVwsSessionWrapper *InitViewServerSessionL(MVwsSessionWrapperObserver &)
IMPORT_C voidInputCapabilitiesChanged()
IMPORT_C voidInstallFepL(TUid)
IMPORT_C voidInstallFepL(TUid, const TBool)
IMPORT_C TBoolIsRedrawEventPending()
IMPORT_C TBoolIsResourceAvailableL(TInt)
TBool IsSchedulerRunning()
IMPORT_C TBoolIsWservEventPending()
const TWsEvent &LastEvent()
IMPORT_C voidLeaveWithErrorText(const TDesC &, const TDesC *)
const CFont *NormalFont()
voidNotifyFocusObserversOfDestructionOfFocusedItem()
voidNotifyForegroundObserversOfGainingForeground()
voidNotifyForegroundObserversOfLosingForeground()
voidNotifyMessageMonitorObserversOfEvent(const TWsEvent &)
voidNotifyResourceObserversOfChangeInResource()
IMPORT_C voidPrepareToExit()
voidQueueNotificationToFocusObserversOfChangeInFocus()
IMPORT_C CDesC16ArrayFlat *ReadDesC16ArrayResourceL(TInt)
IMPORT_C CDesC8ArrayFlat *ReadDesC8ArrayResourceL(TInt)
CDesCArrayFlat *ReadDesCArrayResourceL(TInt)
voidReadResource(TDes &, TInt)
IMPORT_C voidReadResourceAsDes16(TDes16 &, TInt)
IMPORT_C voidReadResourceAsDes16L(TDes16 &, TInt)
IMPORT_C voidReadResourceAsDes8(TDes8 &, TInt)
IMPORT_C voidReadResourceAsDes8L(TDes8 &, TInt)
voidReadResourceL(TDes &, TInt)
voidRefetchPixelMappingL()
IMPORT_C voidReleaseScreenFont(CFont *)
IMPORT_C voidRemoveFepObserver(MCoeFepObserver &)
IMPORT_C voidRemoveFocusObserver(MCoeFocusObserver &)
IMPORT_C voidRemoveForegroundObserver(MCoeForegroundObserver &)
IMPORT_C voidRemoveMessageMonitorObserver(MCoeMessageMonitorObserver &)
IMPORT_C voidRemoveMessageObserver(MCoeMessageObserver &)
IMPORT_C voidRemoveObserverOfLoadedFep(MCoeObserverOfLoadedFep &)
IMPORT_C voidRemoveResourceChangeObserver(MCoeResourceChangeObserver &)
RWindowGroup &RootWin()
IMPORT_C RWindowGroup *RootWin(TInt)
virtual IMPORT_C voidRunL()
CWsScreenDevice *ScreenDevice()
IMPORT_C CWsScreenDevice *ScreenDevice(TInt)
IMPORT_C CCoeAppUi *SetAppUi(CCoeAppUi *)
IMPORT_C voidSetZoomFactor(const TZoomFactor &)
IMPORT_C voidSimulateKeyEventL(const TKeyEvent &, TEventCode)
IMPORT_C CCoeEnv *Static()
IMPORT_C CCoeStatic *Static(TUid)
TInt SupportedPointers()
IMPORT_C voidSuppressNextFlush()
IMPORT_C CWindowGc *SwapSystemGc(CWindowGc *)
IMPORT_C voidSyncNotifyFocusObserversOfChangeInFocus()
CWindowGc &SystemGc()
IMPORT_C TVersionVersion()
RWsSession &WsSession()
IMPORT_C TZoomFactorZoomFactor()
Protected Member Functions
IMPORT_C TIntCoeEnvConstructorError()
IMPORT_C voidDestroyEnvironmentEnd()
IMPORT_C voidDestroyEnvironmentStatic()
virtual IMPORT_C voidDestroyScreen()
TDes &ErrorContextText()
TDes &ErrorText()
virtual IMPORT_C TTypeUid::PtrMopSupplyObject(TTypeUid)
IMPORT_C voidSetAppStartupInstrumentationEventIdBaseL(TInt)
Inherited Attributes
CActive::iStatus
Inherited Enumerations
CActive:TPriority
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
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()
MObjectProvider::FindParent(MObjectProvider *)
MObjectProvider::MObjectProvider()
MObjectProvider::MopGetObject(T *&)
MObjectProvider::MopGetObjectNoChaining(T *&)

Detailed Description

Control environment.

CCoeEnv provides an active environment for creating controls. It implements active objects and an active scheduler, which provide access to the window server, simplifying the API for application programs. It also provides utility functions that are useful to many applications.

When a standard event occurs, the active scheduler calls CCoeEnv::RunL(). When a redraw event occurs, it calls CCoeRedrawer::RunL(). Priority key events must be accessed using the Window Server API directly.

Note: standard events are all events except redraw events and priority key events.

Member Attribute Documentation

iAppUi

CCoeAppUi *iAppUi[protected]

iFsSession

RFs iFsSession[protected]

iLastEvent

TWsEvent iLastEvent[protected]

iNormalFont

const CFont *iNormalFont[protected]

iResourceFileArray

CArrayFix< RResourceFile > *iResourceFileArray[protected]

iRootWin

RWindowGroup iRootWin[protected]

iScreen

CWsScreenDevice *iScreen[protected]

iSystemGc

CWindowGc *iSystemGc[protected]

iWsSession

RWsSession iWsSession[protected]

Constructor & Destructor Documentation

CCoeEnv ( )

IMPORT_CCCoeEnv()

Default constructor.

Note - Construction of the CCoeEnv is not complete until ConstructL() has been called.

This function raises a CONE 2 panic if the application already owns a CCoeEnv.

~CCoeEnv ( )

IMPORT_C~CCoeEnv()

Destructor.

This function deletes any resources owned by the CCoeEnv that were not deleted by DestroyEnvironment().

Member Function Documentation

AddFepObserverL ( MCoeFepObserver & )

IMPORT_C voidAddFepObserverL(MCoeFepObserver &aFepObserver)

Adds the specified MCoeFepObserver to the FEP observer list.

Parameters
aFepObserverThe FEP observer to be added to the list.
Panic Codes
CONE18 aFepObserver is NULL.
CONE21 aFepObserver has already been added to the list.

AddFocusObserverL ( MCoeFocusObserver & )

IMPORT_C voidAddFocusObserverL(MCoeFocusObserver &aFocusObserver)

Adds the specified MCoeFocusObserver to the focus observer list.

Parameters
aFocusObserverThe focus observer to be added to the list.
Panic Codes
CONE18 aFocusObserver is NULL.
CONE21 aFocusObserver has already been added to the list.

AddForegroundObserverL ( MCoeForegroundObserver & )

IMPORT_C voidAddForegroundObserverL(MCoeForegroundObserver &aForegroundObserver)

Adds the specified MCoeForegroundObserver to the foreground observer list.

Parameters
aForegroundObserverThe foreground observer to be added to the list.
Panic Codes
CONE18 aForegroundObserver is NULL.
CONE21 aForegroundObserver has already been added to the list.

AddMessageMonitorObserverL ( MCoeMessageMonitorObserver & )

IMPORT_C voidAddMessageMonitorObserverL(MCoeMessageMonitorObserver &aMessageMonitorObserver)

Adds the specified MCoeMessageMonitorObserver to the message observer list

Parameters
aMessageMonitorObserverThe visibility change observer to be added to the list.

AddMessageObserverL ( MCoeMessageObserver & )

IMPORT_C voidAddMessageObserverL(MCoeMessageObserver &aMessageObserver)

Adds the specified MCoeMessageObserver to the message observer list.

See also: RemoveMessageObserver()

Parameters
aMessageObserverThe message observer to be added to the list.

AddObserverOfLoadedFepL ( MCoeObserverOfLoadedFep & )

IMPORT_C voidAddObserverOfLoadedFepL(MCoeObserverOfLoadedFep &aObserverOfLoadedFep)

Adds the specified MCoeObserverOfLoadedFep to the loaded FEP list.

This enables objects to be notified when a front-end processor is loaded.

Parameters
aObserverOfLoadedFepThe loaded FEP observer to be added to the list.

AddResourceChangeObserverL ( MCoeResourceChangeObserver & )

IMPORT_C voidAddResourceChangeObserverL(MCoeResourceChangeObserver &aResourceChangeObserver)

Adds the specified MCoeResourceChangeObserver to the resource change observer list.

Parameters
aResourceChangeObserverThe resource change observer to be added to the list.

AddResourceFileL ( const TDesC & )

IMPORT_C TIntAddResourceFileL(const TDesC &aFileName)

Adds the specified resource file to the list maintained by CCoeEnv.

Resource files are access counted so AddResourceFileL() can be called several times for the same resource file. However, care should be taken to call DeleteResourceFile() for each resource file added to the list.

See also: RResourceFile::Offset() ResourceFileVersionNumber()

Parameters
aFileNameThe resource file name.
Return Value
The offset value defined for this resource file.
Panic Codes
CONE15 The resource file has no NAME statement (i.e. has no offset).

AddStatic ( CCoeStatic * )

voidAddStatic(CCoeStatic *aStatic)

AllocReadResourceAsDes16L ( TInt )

IMPORT_C HBufC16 *AllocReadResourceAsDes16L(TIntaResourceId)const

Reads a resource into a 16 bit heap buffer, allocating the buffer.

The calling program must destroy the heap descriptor when it is no longer needed.

Parameters
aResourceIdThe numeric ID of the resource to be read.
Return Value
Pointer to a heap descriptor containing the resource data.

AllocReadResourceAsDes16LC ( TInt )

IMPORT_C HBufC16 *AllocReadResourceAsDes16LC(TIntaResourceId)const

Reads a resource into a 16 bit heap buffer, allocating the buffer and pushing it onto the cleanup stack.

The calling program must destroy the heap descriptor when it is no longer needed.

See also: RResourceFile::AllocReadL()

Parameters
aResourceIdThe numeric ID of the resource to be read.
Return Value
Pointer to a heap descriptor containing the resource data.

AllocReadResourceAsDes8L ( TInt )

IMPORT_C HBufC8 *AllocReadResourceAsDes8L(TIntaResourceId)const

Reads a resource into an 8 bit heap buffer, allocating the buffer.

The calling program must destroy the heap descriptor when it is no longer needed.

See also: RResourceFile::AllocReadL()

Parameters
aResourceIdThe numeric ID of the resource to be read.
Return Value
Pointer to a heap descriptor containing the resource data.

AllocReadResourceAsDes8LC ( TInt )

IMPORT_C HBufC8 *AllocReadResourceAsDes8LC(TIntaResourceId)const

Reads a resource into an 8 bit heap buffer, allocating the buffer and pushing it onto the cleanup stack.

The calling program must destroy the heap descriptor when it is no longer needed.

See also: RResourceFile::AllocReadL()

Parameters
aResourceIdThe numeric ID of the resource to be read.
Return Value
Pointer to a heap descriptor containing the resource data.

AllocReadResourceL ( TInt )

HBufC *AllocReadResourceL(TIntaResourceId)const [inline]

Reads a resource into a heap descriptor, allocating memory for it.

Note: the calling program must destroy the heap descriptor when it is no longer needed.

See also: RResourceFile::AllocReadL()

Parameters
aResourceIdThe numeric ID of the resource to be read.
Return Value
Pointer to a heap descriptor containing the resource data.

AllocReadResourceLC ( TInt )

HBufC *AllocReadResourceLC(TIntaResourceId)const [inline]

Reads a specified resource into a heap descriptor, allocating memory for it, and pushing the descriptor onto the cleanup stack.

The calling program should pop and destroy the heap descriptor when it is no longer needed.

See also: RResourceFile::AllocReadLC()

Parameters
aResourceIdThe numeric ID of the resource to be read.
Return Value
Pointer to a heap descriptor containing the resource data.

AppStartupInstrumentationEventIdBase ( )

TInt AppStartupInstrumentationEventIdBase()

AppUi ( )

CCoeAppUi *AppUi()const [inline]

Gets the application UI owned by this application.

Return Value
Pointer to the app UI owned by the application.

AvailableFepsL ( RArray< TUid > &, CDesCArray * )

IMPORT_C voidAvailableFepsL(RArray< TUid > &aUids,
CDesCArray *aDisplayNames
)

Gets the UIDs, and optionally display names, of all the secure FEPs that are available.

Parameters
aUidsThe array of FEP UIDs to be filled.
aDisplayNamesThe array of FEP display names to be filled. May be passed as NULL if display names are not required.

BringOwnerToFront ( )

IMPORT_C voidBringOwnerToFront()

Brings the application's owning window group to the front of the screen and gives it keyboard focus.

This is done by giving the owning window group an ordinal position of zero.

CoeEnvConstructorError ( )

IMPORT_C TIntCoeEnvConstructorError()const [protected]

Return an error code if something failed during early c'tor construction.

ConstructL ( )

IMPORT_C voidConstructL()

Completes construction of the CCoeEnv object.

It calls the other ConstructL() overload specifying ETrue as the initial focus state.

ConstructL ( TBool )

IMPORT_C voidConstructL(TBoolaInitialFocusState)

Completes construction of the CCoeEnv.

It is called by the other overload, with aInitialFocusState set to ETrue.

Parameters
aInitialFocusStateWindow group initial focus state. If ETrue, keyboard focus is enabled, otherwise keyboard focus is disabled.

ConstructL ( TBool, TInt )

IMPORT_C voidConstructL(TBoolaInitialFocusState,
TIntaDefaultScreenNumber
)

Completes construction of the CCoeEnv. It can be called by the previous overload. It calls the next overload, setting the default window group ID to 0 which is not a valid ID

Parameters
aInitialFocusStateWindow group initial focus state. If ETrue, keyboard focus is enabled, otherwise keyboard focus is disabled.
aDefaultScreenNumberThe default screen number should be zero.

ConstructL ( TBool, TInt, TInt )

IMPORT_C voidConstructL(TBoolaInitialFocusState,
TIntaDefaultScreenNumber,
TIntaWindowGroupID
)

Completes construction of the CCoeEnv.

All of the previous ConstructL() overloads end up at this method.

This function creates an active scheduler, and adds active objects to it for standard and redraw events. The active scheduler is not started, however, and no events are received, until ExecuteD() is called. It also does the following:

  • creates a connection to the window server.

  • creates a connection to the file server so that the control environment can access resource files

  • creates a screen device, the application's window group, a standard font, and a graphics context (the system GC).

The window group is constructed with the initial focus state aInitialFocusState, which automatically takes keyboard focus when it is created.

Parameters
aInitialFocusStateWindow group initial focus state. If ETrue, keyboard focus is enabled, otherwise keyboard focus is disabled.
aDefaultScreenNumberThe default screen number
aWindowGroupIDThe window group ID which will be set as the parent

ControlStateChange ( )

TBool ControlStateChange()

Return the status of the report control state change.

CreateDeviceFontL ( CGraphicsDevice *, const TFontSpec & )

IMPORT_C CFbsFont *CreateDeviceFontL(CGraphicsDevice *aDevice,
const TFontSpec &aFontSpec
)

Creates a font for the specified graphics device.

If you wish to use the default screen device as the graphics device, use CreateScreenFontL() instead of this function.

This function calls GetNearestFontToMaxHeightInTwips() on the graphics device given by aDevice, passing it the font defined by aFontSpec.

All fonts created by this function should be released using MGraphicsDeviceMap::ReleaseFont(), when they are no longer required.

Note that the font will not be scaled automatically when the control's zoom factor is changed using CCoeControl::SetZoomFactor(). This is also the case for NormalFont(), CEikonEnv::LegendFont(), CEikonEnv::TitleFont(), CEikonEnv::AnnotationFont(), CEikonEnv::DenseFont().

To avoid this problem, and also make resource management much easier, it is highly recommended to use CCoeControl::ScreenFont() instead.

See also: CCoeEnv::CreateScreenFontL() CCoeControl::ScreenFont() CCoeFontProvider

Parameters
aDeviceThe graphics device for which to create the font.
aFontSpecThe font specification.
Return Value
The new font.

CreateGcL ( )

IMPORT_C CWindowGc *CreateGcL()

Fully constructs a new graphics context.

CCoeEnv calls this function during construction to create the system graphics context, which can be accessed using SystemGc(). Hence the system graphics context is always available.

See also: SystemGc()

Return Value
A new graphics context.

CreateResourceReaderLC ( TResourceReader &, TInt )

IMPORT_C voidCreateResourceReaderLC(TResourceReader &aReader,
TIntaResourceId
)const

Reads a resource from a resource file and sets its resource reader.

The resource reader can subsequently be used to read resource data from the resource. The resource reader is also placed on the cleanup stack.

Note: the GUI framework passes a resource reader as an argument to CCoeControl::ConstructFromResourceL(), with the resource reader's buffer already set to contain the relevant resource for that control.

Parameters
aReaderThe resource reader.
aResourceIdThe numeric ID of the resource to be read.

CreateScreenFontL ( const TFontSpec & )

IMPORT_C CFbsFont *CreateScreenFontL(const TFontSpec &aFontSpec)

Creates a font for the default graphics device, based on the specified TFontSpec.

All fonts created using this function should be released using ReleaseScreenFont() when they are no longer required.

Note that the font will not be scaled automatically when the zoom factor is changed using CCoeControl::SetZoomFactor(). This is also the case for NormalFont(), CEikonEnv::LegendFont(), CEikonEnv::TitleFont(), CEikonEnv::AnnotationFont(), CEikonEnv::DenseFont().

To avoid this problem, and also make resource management much easier, it is highly recommended to use CCoeControl::ScreenFont() instead.

See also: CCoeControl::ScreenFont() CCoeFontProvider

Parameters
aFontSpecThe font specification.
Return Value
The new font.

DefaultFontProvider ( )

IMPORT_C const CCoeFontProvider &DefaultFontProvider()const

This function returns the default font provider.

Return Value
The default font provider.

DefaultTextDrawer ( )

IMPORT_C CCoeTextDrawerBase &DefaultTextDrawer()const

This function returns the default text drawer.

Return Value
The default text drawer.

DeleteResourceFile ( TInt )

IMPORT_C voidDeleteResourceFile(TIntaOffset)

Deletes the specified resource file from the list maintained by CCoeEnv.

Parameters
aOffsetThe offset value defined for the resource file to delete.
Panic Codes
CONE13 The specified resource file does not exist in the list.

DestroyEnvironment ( )

IMPORT_C voidDestroyEnvironment()[virtual]

Deletes several resources owned by the CCoeEnv object.

This includes; the app UI, the system graphics context, and the active object which receives redraw events. It also closes the window group, the connection to the window server, and the connection to the file server.

The function is called from ExecuteD() when the active scheduler's wait loop terminates.

DestroyEnvironmentEnd ( )

IMPORT_C voidDestroyEnvironmentEnd()[protected]

DestroyEnvironmentStatic ( )

IMPORT_C voidDestroyEnvironmentStatic()[protected]

DestroyScreen ( )

IMPORT_C voidDestroyScreen()[protected, virtual]

Destroys the screen device.

By default this function simply deletes the screen device owned by this CCoeEnv. However, this function may be overridden by subclasses.

This function is called by DestroyEnvironment().

DisableExitChecks ( TBool )

IMPORT_C voidDisableExitChecks(TBoolaDisable)

Disables exit checks on kernel resources. Affects debug builds only.

CCoeEnv checks for kernel resources on exit (e.g. open file handles). These checks may be too strict for some applications, such as a web browser, so this function is provided to disable them.

CCoeEnv also checks on heap allocation and window server resources on exit.

Parameters
aDisableTrue to disable resource checking, false to enable it.

DisableShutdownChecks ( )

IMPORT_C TBoolDisableShutdownChecks()const

DoCancel ( )

IMPORT_C voidDoCancel()[virtual]

Reimplemented from CActive::DoCancel()

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel().

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel().

See also: CActive::Cancel

DoFlush ( )

voidDoFlush()

Flush WSERV's command buffer

EnableEventData ( )

voidEnableEventData()[inline]

Enables the event data.

EnsureCorrectFepIsLoadedL ( )

voidEnsureCorrectFepIsLoadedL()

EnsureSpecifiedFepIsLoadedL ( TUid )

voidEnsureSpecifiedFepIsLoadedL(TUidaFepUid)

ErrorContextText ( )

TDes &ErrorContextText()[protected, inline]

Gets the current error context text.

Return Value
The current error context text.

ErrorText ( )

TDes &ErrorText()[protected, inline]

Gets the current error message text.

Return Value
The current error message text.

EventDataEnabled ( )

TBool EventDataEnabled()const [inline]

Checks if the event data is enabled.

Return Value
ETrue if the event data is enabled, EFalse otherwise.

EventManager ( )

CCoeEventManager &EventManager()

Returns the event manager.

Return Value
The event manager.

Execute ( )

IMPORT_C voidExecute()

Launches the application without destroying the control environment.

This function starts the active scheduler owned by the CCoeEnv, enabling the application to start receiving events from the window server. It forms the outer loop of all Control Environment applications.

ExecuteD ( )

IMPORT_C voidExecuteD()

Launches the application and destroys the control environment.

ExecuteFepSettingsDialogL ( TUid )

IMPORT_C voidExecuteFepSettingsDialogL(TUidaFepUid)

Executes the settings dialog for the specified secure FEP.

The specified FEP does not need to be loaded.

Parameters
aFepUidThe UID of the secure FEP for which the settings dialog is to be executed.

Fep ( )

IMPORT_C CCoeFep *Fep()const

Gets a pointer to the currently loaded FEP.

Return Value
The currently loaded FEP, or NULL if none is currently loaded.

FepUid ( )

IMPORT_C TUidFepUid()const

Gets the UID of the currently loaded FEP.

Return Value
The UID of the currently loaded FEP. Zero if none is currently loaded.

FindStatic ( TUid )

IMPORT_C CCoeStatic *FindStatic(TUidaUid)

Flush ( TTimeIntervalMicroSeconds32 )

IMPORT_C voidFlush(TTimeIntervalMicroSeconds32aDelay = 0)

Flushes the client-side window server buffer.

The function does this by first calling RWsSession::Flush(), and then User::After(aDelay), which puts the current process in a sleep state for the time interval given by aDelay.

Parameters
aDelayDelay for which to sleep the current process after flushing the window server buffer. By default the delay is zero.

FocusObserverNotificationIdentifier ( )

TInt FocusObserverNotificationIdentifier()const

FocusObserverNotificationIsStillPending ( TInt )

TBool FocusObserverNotificationIsStillPending(TIntaFocusObserverNotificationIdentifier)const

ForEachFepObserverCall ( TCoeFepObserverFunction )

IMPORT_C voidForEachFepObserverCall(TCoeFepObserverFunctionaFepObserverFunction)

Calls the specified function for each FEP observer.

This function is called for each MCoeFepObserver object that has been registered. FEP observers are registered by calling CCoeEnv::AddFepObserverL().

Parameters
aFepObserverFunctionThe function to be called.

Format128 ( TDes &, TInt, ... )

IMPORT_C voidFormat128(TDes &aDes,
TIntaResourceId,
...
)

Reads a 128 byte resource into a formatted string.

The format of the string is given by the variable argument list. The unformatted resource data must not be longer than 128 bytes. If it is, you should use Format256() instead.

Parameters
aDesOn return, contains the formatted resource data.
aResourceIdThe numeric ID of the resource to be read.

Format256 ( TDes &, TInt, ... )

IMPORT_C voidFormat256(TDes &aDes,
TIntaResourceId,
...
)

Reads a 256 byte resource into a formatted string.

The format of the string is given by the variable argument list. The unformatted resource data must not be longer than 256 bytes.

Parameters
aDesOn return, contains the formatted resource data.
aResourceIdThe numeric ID of the resource to be read.

FsSession ( )

RFs &FsSession()const [inline]

Gets the file server session owned by this CCoeEnv.

This session is normally only used for accessing the application's resource file.

Return Value
The file server session owned by this CCoeEnv.

GetMessageNotifyingObserversLC ( TUint32, TUid &, TPtr8 &, const TWsEvent & )

IMPORT_C voidGetMessageNotifyingObserversLC(TUint32aClientHandleOfTargetWindowGroup,
TUid &aMessageUid,
TPtr8 &aMessageParameters,
const TWsEvent &aMessageEvent
)

HandleError ( TInt )

IMPORT_C voidHandleError(TIntaError)[virtual]

Handles an application-defined error message.

This function allows application-defined error messages to be called from functions within the control framework's active scheduler. It has an empty default implementation.

It is called when a leave occurs in CCoeEnv::RunL(), and also when ReadResource() fails.

InitViewServerSessionL ( MVwsSessionWrapperObserver & )

CVwsSessionWrapper *InitViewServerSessionL(MVwsSessionWrapperObserver &aObserver)

InputCapabilitiesChanged ( )

IMPORT_C voidInputCapabilitiesChanged()

Notifies all focus observers (FEPs) that a change has been made to the input capabilities of the focused control.

InstallFepL ( TUid )

IMPORT_C voidInstallFepL(TUidaFepUid)

Loads the specified secure FEP into all running applications.

The currently loaded FEP, if any, is unloaded.

Parameters
aFepUidThe UID of the secure FEP to be loaded.
Capability
WriteDeviceDataTo protect against installation of insecure FEP.

InstallFepL ( TUid, const TBool )

IMPORT_C voidInstallFepL(TUidaFepUid,
const TBoolaLeave
)

Loads the specified secure FEP into all running applications.

The currently loaded FEP, if any, is unloaded.

Parameters
aFepUidThe UID of the secure FEP to be loaded.
aLeaveNo longer used.
Capability
WriteDeviceDataTo protect against installation of insecure FEP.

IsRedrawEventPending ( )

IMPORT_C TBoolIsRedrawEventPending()const

Tests if there is a redraw event waiting to be processed.

Return Value
ETrue if a redraw event is pending. EFalse if no redraw event is pending.

IsResourceAvailableL ( TInt )

IMPORT_C TBoolIsResourceAvailableL(TIntaResourceId)const
Checks if the given resource is owned by one of the resource files in the list maintained by CCoeEnv.
Since
9.0
Parameters
aResourceIdThe ID of the resource.
Return Value
ETrue if resource is available, EFalse otherwise.

IsSchedulerRunning ( )

TBool IsSchedulerRunning()const [inline]

Tests if the Active Scheduler has been started in the CCoeEnv::ExecuteD.

Return Value
ETrue if Active Scheduler was started in CCoeEnv::ExecuteD(), EFalse if Active Scheduler was not started in CCoeEnv::ExecuteD().

IsWservEventPending ( )

IMPORT_C TBoolIsWservEventPending()const

Tests if there is a standard event waiting to be processed.

Note: standard events are all window server events except redraw and priority key events.

Return Value
ETrue if a standard event is pending. EFalse if no standard event is pending.

LastEvent ( )

const TWsEvent &LastEvent()const [inline]

Gets the most recent standard event that was received by the application.

Note: standard events are all events except redraw events and priority key events.

Return Value
The last event.

LeaveWithErrorText ( const TDesC &, const TDesC * )

IMPORT_C voidLeaveWithErrorText(const TDesC &aMsg,
const TDesC *aContextText = NULL
)

Triggers a dialog which will display the error message

Parameters
aMsgThe error message.
aContextTextThe error context text.

MopSupplyObject ( TTypeUid )

IMPORT_C TTypeUid::PtrMopSupplyObject(TTypeUidaId)[protected, virtual]

Retrieves an object of the same type as that encapsulated in aId.

This function is used to allow to ask owners for access to other objects that they own.

Other than in the case where NULL is returned, the object returned must be of the same object type - that is, the ETypeId member of the object pointed to by the pointer returned by this function must be equal to the iUid member of aId.

Parameters
aIdAn encapsulated object type ID.
Return Value
Encapsulates the pointer to the object provided. Note that the encapsulated pointer may be NULL.

NormalFont ( )

const CFont *NormalFont()const [inline]

Gets the normal environment font.

This is the font created during construction of the control environment.

See also: InitSystemFontsL()

Return Value
Pointer to the normal environment font.

NotifyFocusObserversOfDestructionOfFocusedItem ( )

voidNotifyFocusObserversOfDestructionOfFocusedItem()

NotifyForegroundObserversOfGainingForeground ( )

voidNotifyForegroundObserversOfGainingForeground()

NotifyForegroundObserversOfLosingForeground ( )

voidNotifyForegroundObserversOfLosingForeground()

NotifyMessageMonitorObserversOfEvent ( const TWsEvent & )

voidNotifyMessageMonitorObserversOfEvent(const TWsEvent &aEvent)

NotifyResourceObserversOfChangeInResource ( )

voidNotifyResourceObserversOfChangeInResource()

PrepareToExit ( )

IMPORT_C voidPrepareToExit()

Prepares for exiting the application.

The function is called from ExecuteD() after the active scheduler's wait loop terminates, but before the environment is destroyed.

QueueNotificationToFocusObserversOfChangeInFocus ( )

voidQueueNotificationToFocusObserversOfChangeInFocus()

ReadDesC16ArrayResourceL ( TInt )

IMPORT_C CDesC16ArrayFlat *ReadDesC16ArrayResourceL(TIntaResourceId)

Reads a resource into a 16 bit descriptor array.

Ownership of the array is transferred to the caller.

See also: TResourceReader::ReadDesC16ArrayL()

Parameters
aResourceIdThe numeric ID of the resource to be read.
Return Value
A pointer to the descriptor array containing the resource data.

ReadDesC8ArrayResourceL ( TInt )

IMPORT_C CDesC8ArrayFlat *ReadDesC8ArrayResourceL(TIntaResourceId)

Reads a resource into an 8 bit descriptor array.

See also: TResourceReader::ReadDesC8ArrayL()

Parameters
aResourceIdThe numeric ID of the resource to be read.
Return Value
A pointer to the descriptor array containing the resource data.

ReadDesCArrayResourceL ( TInt )

CDesCArrayFlat *ReadDesCArrayResourceL(TIntaResourceId)[inline]

Reads a resource into a Unicode descriptor array.

See also: TResourceReader::ReadDesCArrayL()

Parameters
aResourceIdThe numeric ID of the resource to be read.
Return Value
A pointer to the descriptor array containing the resource data.

ReadResource ( TDes &, TInt )

voidReadResource(TDes &aDes,
TIntaResourceId
)const [inline]

Reads a resource into a descriptor.

The descriptor must be long enough to contain the entire resource. No memory is allocated by this function. If the read fails, the function sets an error condition and performs any cleanup required. The error condition causes the GUI to launch an alert window.

DeprecatedUse CCoeEnv::ReadResourceL() instead.

See also: RResourceFile::ReadL() KErrCoeFailedToReadFromProgDisk

Parameters
aDesOn return, contains the resource data.
aResourceIdThe numeric ID of the resource to be read.

ReadResourceAsDes16 ( TDes16 &, TInt )

IMPORT_C voidReadResourceAsDes16(TDes16 &aDes,
TIntaResourceId
)const

Reads a resource into a 16 bit descriptor.

The descriptor must be long enough to contain the entire resource. No memory is allocated by this function.

If the read fails the function sets an error condition and performs any cleanup required. The error condition causes the GUI to launch an alert window. Deprecated: use CCoeEnv::ReadResourceAsDes16L() instead.

Deprecated

See also: RResourceFile::ReadL() KErrCoeFailedToReadFromProgDisk

Parameters
aDesOn return, contains the read resource.
aResourceIdThe numeric ID of the resource to be read.

ReadResourceAsDes16L ( TDes16 &, TInt )

IMPORT_C voidReadResourceAsDes16L(TDes16 &aDes,
TIntaResourceId
)const

Deprecated7.0

Reads a resource into a 16 bit descriptor.

The descriptor must be long enough to contain the entire resource. The method leaves if an error occurs when reading from the resource file.

Parameters
aDesOn return, contains the read resource.
aResourceIdThe numeric ID of the resource to be read.

ReadResourceAsDes8 ( TDes8 &, TInt )

IMPORT_C voidReadResourceAsDes8(TDes8 &aDes,
TIntaResourceId
)const

Reads a resource into an 8 bit descriptor.

The descriptor must be long enough to contain the entire resource. No memory is allocated by this function.

If the read fails the function sets an error condition and performs any cleanup required. The error condition causes the GUI to launch an alert window. Deprecated: use CCoeEnv::ReadResourceAsDes8L() instead.

Deprecated

See also: RResourceFile::ReadL() KErrCoeFailedToReadFromProgDisk

Parameters
aDesOn return, contains the read resource.
aResourceIdThe numeric ID of the resource to be read.

ReadResourceAsDes8L ( TDes8 &, TInt )

IMPORT_C voidReadResourceAsDes8L(TDes8 &aDes,
TIntaResourceId
)const

Deprecated7.0

Reads a resource into an 8 bit descriptor.

The descriptor must be long enough to contain the entire resource. The method leaves if an error occurs when reading from the resource file.

Parameters
aDesOn return, contains the read resource.
aResourceIdThe numeric ID of the resource to be read.

ReadResourceL ( TDes &, TInt )

voidReadResourceL(TDes &aDes,
TIntaResourceId
)const [inline]

Reads a resource into a descriptor.

The descriptor must be long enough to contain the entire resource. No memory is allocated by this function.

Parameters
aDesOn return, contains the resource data.
aResourceIdThe numeric ID of the resource to be read.
Return Value
Pointer to a heap descriptor containing the resource.

RefetchPixelMappingL ( )

voidRefetchPixelMappingL()

ReleaseScreenFont ( CFont * )

IMPORT_C voidReleaseScreenFont(CFont *aFont)const

Frees all resources used by the font.

This function should be used to release a font when the font is no longer required. Fonts are created using CreateScreenFontL().

Parameters
aFontThe font to be released.

RemoveFepObserver ( MCoeFepObserver & )

IMPORT_C voidRemoveFepObserver(MCoeFepObserver &aFepObserver)

Removes the specified FEP observer.

See also: AddFepObserverL()

Parameters
aFepObserverThe FEP observer to be removed.

RemoveFocusObserver ( MCoeFocusObserver & )

IMPORT_C voidRemoveFocusObserver(MCoeFocusObserver &aFocusObserver)

Removes the specified focus observer.

See also: AddFocusObserverL()

Parameters
aFocusObserverThe focus observer to be removed.

RemoveForegroundObserver ( MCoeForegroundObserver & )

IMPORT_C voidRemoveForegroundObserver(MCoeForegroundObserver &aForegroundObserver)

Removes the specified foreground observer.

See also: AddForegroundObserverL()

Parameters
aForegroundObserverThe foreground observer to be removed.

RemoveMessageMonitorObserver ( MCoeMessageMonitorObserver & )

IMPORT_C voidRemoveMessageMonitorObserver(MCoeMessageMonitorObserver &aMessageMonitorObserver)

Removes the specified MCoeMessageMonitorObserver.

Parameters
aMessageMonitorObserverThe visibility change observer to be removed.

RemoveMessageObserver ( MCoeMessageObserver & )

IMPORT_C voidRemoveMessageObserver(MCoeMessageObserver &aMessageObserver)

Removes the specified MCoeMessageObserver from the message observer list.

See also: AddMessageObserverL()

Parameters
aMessageObserverThe message observer to be removed from the list.

RemoveObserverOfLoadedFep ( MCoeObserverOfLoadedFep & )

IMPORT_C voidRemoveObserverOfLoadedFep(MCoeObserverOfLoadedFep &aObserverOfLoadedFep)

Removes the specified loaded FEP observer.

Parameters
aObserverOfLoadedFepThe FEP observer to be removed.

RemoveResourceChangeObserver ( MCoeResourceChangeObserver & )

IMPORT_C voidRemoveResourceChangeObserver(MCoeResourceChangeObserver &aResourceChangeObserver)

Removes the specified resource change observer.

Parameters
aResourceChangeObserverThe resource change observer to be removed.

RootWin ( )

RWindowGroup &RootWin()const [inline]

Gets the application's window group.

Note: a window group is an invisible window which acts as the parent window for all other windows in an application. Typically, each application has one window group. In the window server, window groups are also the unit of keyboard focus.

Return Value
The application's window group.

RootWin ( TInt )

IMPORT_C RWindowGroup *RootWin(TIntaScreenNumber)const

This function returns the window group associated with the screen device that bears this particular screen number.

Return Value
the window group associated with the screen device that bears this particular screen number.

RunL ( )

IMPORT_C voidRunL()[virtual]

Reimplemented from CActive::RunL()

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

See also: CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD

ScreenDevice ( )

CWsScreenDevice *ScreenDevice()const [inline]

Gets the default screen device owned by this CCoeEnv.

This is typically used as the standard screen device for the CCoeEnv's application.

Return Value
The default screen device owned by this CCoeEnv.

ScreenDevice ( TInt )

IMPORT_C CWsScreenDevice *ScreenDevice(TIntaScreenNumber)const

This function returns the screen device with this particular screen number.

Return Value
the screen device with this particular screen number.

SetAppStartupInstrumentationEventIdBaseL ( TInt )

IMPORT_C voidSetAppStartupInstrumentationEventIdBaseL(TIntaAppStartupInstrumentationEventIdBase)[protected]

SetAppUi ( CCoeAppUi * )

IMPORT_C CCoeAppUi *SetAppUi(CCoeAppUi *aAppUi)

Sets the application's user interface object.

Standard GUI applications do not need to call this function, as the framework sets the app UI, during start up, to be the CEikAppUi-derived object created by the application.

Parameters
aAppUiThe app UI for this application.
Return Value
The app UI previously owned by this application, or NULL if this is the first time its app UI has been set.

SetZoomFactor ( const TZoomFactor & )

IMPORT_C voidSetZoomFactor(const TZoomFactor &aZoomFactor)

Sets the zoom factor of all controls currently on the control stack.

See also: CCoeControl::SetZoomFactor()

SimulateKeyEventL ( const TKeyEvent &, TEventCode )

IMPORT_C voidSimulateKeyEventL(const TKeyEvent &aKeyEvent,
TEventCodeaType
)

Simulates a key event.

This function calls CCoeAppUi::HandleWsEventL() to process the event as if it had arrived from the window server.

Parameters
aKeyEventThe key event.
aTypeThe event type.

Static ( )

IMPORT_C CCoeEnv *Static()[static]

Gets a pointer to a CCoeEnv which can be used to access CCoeEnv's functions.

It allows application code to access CCoeEnv's functions even where there is no direct access to a CCoeEnv object.

For example:

CCoeEnv::Static()->CreateResourceReaderLC(aReader, aResourceId);
Return Value
The pointer for accessing CCoeEnv's functions.

Static ( TUid )

IMPORT_C CCoeStatic *Static(TUidaUid)[static]

Gets a pointer to the specified CCoeStatic derived class.

If no match is found it will return NULL.

This function might be used to allow a CCoeStatic derived class to get a handle on itself.

Note: ownership of the object remains with CCoeEnv in all cases.

Parameters
aUidThe UID of the CCoeStatic derived class.
Return Value
A pointer to the CCoeStatic derived object. NULL if no match is found.

SupportedPointers ( )

TInt SupportedPointers()const

SuppressNextFlush ( )

IMPORT_C voidSuppressNextFlush()

Suppresses the next flush of the active scheduler queue.

It prevents the active scheduler automatically flushing its window server session the next time that a non-CCoeEnv object runs. After the active object has run, the active scheduler reverts back to its normal behaviour, flushing after each non-CCoeEnv RunL().

SwapSystemGc ( CWindowGc * )

IMPORT_C CWindowGc *SwapSystemGc(CWindowGc *aGc)

Sets the new system graphics context.

The function returns a pointer to the old system graphics context.

Parameters
aGcThe new graphics context.
Return Value
A pointer to the old graphics context.
Panic Codes
CONE27 aGc is NULL.

SyncNotifyFocusObserversOfChangeInFocus ( )

IMPORT_C voidSyncNotifyFocusObserversOfChangeInFocus()

SystemGc ( )

CWindowGc &SystemGc()const [inline]

Gets the system graphics context.

This is the graphics context typically used for drawing controls, but an alternative graphics context can be created if required using CreateGcL().

Return Value
The system graphics context.

Version ( )

IMPORT_C TVersionVersion()[static]

Gets the version number of the UI Control Framework API.

Deprecated

Return Value
The version number, comprising major, minor and build numbers.

WsSession ( )

RWsSession &WsSession()const [inline]

Gets the window server session owned by the application.

This provides access to window server functions not directly accessible via the UI control framework.

Return Value
The window server session opened by the application.

ZoomFactor ( )

IMPORT_C TZoomFactorZoomFactor()const

Returns the zoom factor last set by calling CCoeEnv::SetZoomFactor().