Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <COEMAIN.H>
Link against: cone.lib

Class CCoeEnv

class CCoeEnv : public CActive, public MObjectProvider;

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.

Derivation

Members

Defined in CCoeEnv:

Inherited from CActive:

Inherited from CBase:

Inherited from MObjectProvider:


Construction and destruction


CCoeEnv()

IMPORT_C CCoeEnv();

Description

Default constructor.

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

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


~CCoeEnv()

IMPORT_C ~CCoeEnv();

Description

Destructor.

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


ConstructL()

IMPORT_C void ConstructL();

Description

Completes construction of the CCoeEnv object.

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


ConstructL(TBool)

IMPORT_C void ConstructL(TBool aInitialFocusState);

Description

Completes construction of the CCoeEnv.

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

Parameters

TBool aInitialFocusState

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


ConstructL(TBool,TInt)

IMPORT_C void ConstructL(TBool aInitialFocusState, TInt aDefaultScreenNumber);

Description

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

TBool aInitialFocusState

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

TInt aDefaultScreenNumber

The default screen number should be zero.


ConstructL(TBool,TInt,TInt)

IMPORT_C void ConstructL(TBool aInitialFocusState, TInt aDefaultScreenNumber, TInt aWindowGroupID);

Description

Completes construction of the CCoeEnv.

All of the previous CCoeEnv::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 CCoeEnv::ExecuteD() is called. It also does the following:

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

Parameters

TBool aInitialFocusState

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

TInt aDefaultScreenNumber

The default screen number

TInt aWindowGroupID

The window group ID which will be set as the parent

[Top]


Member functions


Version()

Interface status: deprecated

IMPORT_C static TVersion Version();

Description

Gets the version number of the UI Control Framework API.

Return value

TVersion

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


Static()

IMPORT_C static CCoeEnv* Static();

Description

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

CCoeEnv *

The pointer for accessing CCoeEnv's functions.


SetAppUi(CCoeAppUi *)

IMPORT_C CCoeAppUi* SetAppUi(CCoeAppUi *aAppUi);

Description

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

CCoeAppUi *aAppUi

The app UI for this application.

Return value

CCoeAppUi *

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


ExecuteD()

IMPORT_C void ExecuteD();

Description

Launches the application and destroys the control environment.


Execute()

IMPORT_C void Execute();

Description

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.


RunL()

IMPORT_C virtual void RunL();

Description

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 CCoeEnv::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)

CCoeEnv::RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls CCoeEnv::RunError(TInt) 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 CCoeEnv::RunL() or CCoeEnv::RunError(TInt) functions.

See also:


DoCancel()

IMPORT_C virtual void DoCancel();

Description

Implements cancellation of an outstanding request.

This function is called as part of the active object's CActive::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.

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

See also:


PrepareToExit()

IMPORT_C void PrepareToExit();

Description

Prepares for exiting the application.

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


DestroyEnvironment()

IMPORT_C virtual void DestroyEnvironment();

Description

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 CCoeEnv::ExecuteD() when the active scheduler's wait loop terminates.


DisableExitChecks(TBool)

IMPORT_C void DisableExitChecks(TBool aDisable);

Description

Disables exit checks on kernel resources.

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

TBool aDisable

True to disable resource checking, false to enable it.


HandleError(TInt)

IMPORT_C virtual void HandleError(TInt aError);

Description

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 CCoeEnv::ReadResource(TDes &,TInt)const fails.

Parameters

TInt aError


AppUi()const

inline CCoeAppUi* AppUi() const;

Description

Gets the application UI owned by this application.

Return value

CCoeAppUi *

Pointer to the app UI owned by the application.


FsSession()const

inline RFs& FsSession() const;

Description

Gets the file server session owned by this CCoeEnv.

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

Return value

RFs &

The file server session owned by this CCoeEnv.


WsSession()const

inline RWsSession& WsSession() const;

Description

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

RWsSession &

The window server session opened by the application.


RootWin()const

inline RWindowGroup& RootWin() const;

Description

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

RWindowGroup &

The application's window group.


ScreenDevice()const

inline CWsScreenDevice* ScreenDevice() const;

Description

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

CWsScreenDevice *

The default screen device owned by this CCoeEnv.


SystemGc()const

inline CWindowGc& SystemGc() const;

Description

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 CCoeEnv::CreateGcL().

Return value

CWindowGc &

The system graphics context.


NormalFont()const

inline const CFont* NormalFont() const;

Description

Gets the normal environment font.

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

Return value

const CFont *

Pointer to the normal environment font.

See also:


LastEvent()const

inline const TWsEvent& LastEvent() const;

Description

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

const TWsEvent &

The last event.


IsSchedulerRunning()const

inline TBool IsSchedulerRunning() const;

Description

Return value

TBool


CreateGcL()

IMPORT_C CWindowGc* CreateGcL();

Description

Fully constructs a new graphics context.

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

Return value

CWindowGc *

A new graphics context.

See also:


SwapSystemGc(CWindowGc *)

IMPORT_C CWindowGc* SwapSystemGc(CWindowGc *aGc);

Description

Sets the new system graphics context.

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

Parameters

CWindowGc *aGc

The new graphics context.

Return value

CWindowGc *

A pointer to the old graphics context.

Panic codes

CONE

27 aGc is NULL.


Flush(TTimeIntervalMicroSeconds32)

IMPORT_C void Flush(TTimeIntervalMicroSeconds32 aDelay=0);

Description

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

TTimeIntervalMicroSeconds32 aDelay

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


SuppressNextFlush()

IMPORT_C void SuppressNextFlush();

Description

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 CCoeEnv::RunL().


IsWservEventPending()const

IMPORT_C TBool IsWservEventPending() const;

Description

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

TBool

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


IsRedrawEventPending()const

IMPORT_C TBool IsRedrawEventPending() const;

Description

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

Return value

TBool

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


CreateDeviceFontL(CGraphicsDevice *,const TFontSpec &)

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

Description

Creates a font for the specified graphics device.

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

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

All fonts should be released, using MGraphicsDeviceMap::ReleaseFont(CFont *), when they are no longer required.

Parameters

CGraphicsDevice *aDevice

The graphics device for which to create the font.

const TFontSpec &aFontSpec

The font specification.

Return value

CFbsFont *

The new font.


CreateScreenFontL(const TFontSpec &)

IMPORT_C CFbsFont* CreateScreenFontL(const TFontSpec &aFontSpec);

Description

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

This function calls CCoeEnv::CreateDeviceFontL(CGraphicsDevice *,const TFontSpec &) passing the default screen device, owned by this CCoeEnv, as the value for the graphics device for which to create the font. All fonts created using this function should be released using CCoeEnv::ReleaseScreenFont(CFont *)const when they are no longer required.

Parameters

const TFontSpec &aFontSpec

The font specification.

Return value

CFbsFont *

The font.


ReleaseScreenFont(CFont *)const

IMPORT_C void ReleaseScreenFont(CFont *aFont) const;

Description

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 CCoeEnv::CreateScreenFontL(const TFontSpec &).

Parameters

CFont *aFont

The font to be released.


DefaultFontProvider()const

IMPORT_C const CCoeFontProvider& DefaultFontProvider() const;

Description

This function returns the default font provider.

Return value

const CCoeFontProvider &

The default font provider.


DefaultTextDrawer()const

IMPORT_C CCoeTextDrawerBase& DefaultTextDrawer() const;

Description

This function returns the default text drawer.

Return value

CCoeTextDrawerBase &

The default text drawer.


AddResourceFileL(const TDesC &)

IMPORT_C TInt AddResourceFileL(const TDesC &aFileName);

Description

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

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

Parameters

const TDesC16 &aFileName

The resource file name.

Return value

TInt

The offset value defined for this resource file.

Panic codes

CONE

15 The resource file has no NAME statement (i.e. has no offset).

See also:


DeleteResourceFile(TInt)

IMPORT_C void DeleteResourceFile(TInt aOffset);

Description

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

Parameters

TInt aOffset

The offset value defined for the resource file to delete.

Panic codes

CONE

13 The specified resource file does not exist in the list.


IsResourceAvailableL(TInt)const

IMPORT_C TBool IsResourceAvailableL(TInt aResourceId) const;

Description

Checks if the given resource is owned by one of the resource files in the list maintained by CCoeEnv.

Parameters

TInt aResourceId

The ID of the resource.

Return value

TBool

ETrue if resource is available, EFalse otherwise.


CreateResourceReaderLC(TResourceReader &,TInt)const

IMPORT_C void CreateResourceReaderLC(TResourceReader &aReader, TInt aResourceId) const;

Description

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(TResourceReader &), with the resource reader's buffer already set to contain the relevant resource for that control.

Parameters

TResourceReader &aReader

The resource reader.

TInt aResourceId

The numeric ID of the resource to be read.


ReadResource(TDes &,TInt)const

Interface status: deprecated

inline void ReadResource(TDes &aDes, TInt aResourceId) const;

Description

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.

Deprecated - Use CCoeEnv::ReadResourceL(TDes &,TInt)const instead.

Parameters

TDes16 &aDes

On return, contains the resource data.

TInt aResourceId

The numeric ID of the resource to be read.

See also:


ReadResourceL(TDes &,TInt)const

inline void ReadResourceL(TDes &aDes, TInt aResourceId) const;

Description

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

TDes16 &aDes

On return, contains the resource data.

TInt aResourceId

The numeric ID of the resource to be read.


AllocReadResourceL(TInt)const

inline HBufC* AllocReadResourceL(TInt aResourceId) const;

Description

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.

Parameters

TInt aResourceId

The numeric ID of the resource to be read.

Return value

HBufC16 *

Pointer to a heap descriptor containing the resource data.

See also:


AllocReadResourceLC(TInt)const

inline HBufC* AllocReadResourceLC(TInt aResourceId) const;

Description

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.

Parameters

TInt aResourceId

The numeric ID of the resource to be read.

Return value

HBufC16 *

Pointer to a heap descriptor containing the resource data.

See also:


ReadDesCArrayResourceL(TInt)

inline CDesCArrayFlat* ReadDesCArrayResourceL(TInt aResourceId);

Description

Reads a resource into a Unicode descriptor array.

Parameters

TInt aResourceId

The numeric ID of the resource to be read.

Return value

CDesC16ArrayFlat *

A pointer to the descriptor array containing the resource data.

See also:


ReadResourceAsDes8(TDes8 &,TInt)const

Interface status: deprecated

IMPORT_C void ReadResourceAsDes8(TDes8 &aDes, TInt aResourceId) const;

Description

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(TDes8 &,TInt)const instead.

Parameters

TDes8 &aDes

On return, contains the read resource.

TInt aResourceId

The numeric ID of the resource to be read.

See also:


ReadResourceAsDes8L(TDes8 &,TInt)const

Interface status: deprecated 7.0

IMPORT_C void ReadResourceAsDes8L(TDes8 &aDes, TInt aResourceId) const;

Description

Parameters

TDes8 &aDes

TInt aResourceId


AllocReadResourceAsDes8L(TInt)const

IMPORT_C HBufC8* AllocReadResourceAsDes8L(TInt aResourceId) const;

Description

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.

Parameters

TInt aResourceId

The numeric ID of the resource to be read.

Return value

HBufC8 *

Pointer to a heap descriptor containing the resource data.

See also:


AllocReadResourceAsDes8LC(TInt)const

IMPORT_C HBufC8* AllocReadResourceAsDes8LC(TInt aResourceId) const;

Description

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.

Parameters

TInt aResourceId

The numeric ID of the resource to be read.

Return value

HBufC8 *

Pointer to a heap descriptor containing the resource data.

See also:


ReadDesC8ArrayResourceL(TInt)

IMPORT_C CDesC8ArrayFlat* ReadDesC8ArrayResourceL(TInt aResourceId);

Description

Reads a resource into an 8 bit descriptor array.

Parameters

TInt aResourceId

The numeric ID of the resource to be read.

Return value

CDesC8ArrayFlat *

A pointer to the descriptor array containing the resource data.

See also:


ReadResourceAsDes16(TDes16 &,TInt)const

Interface status: deprecated

IMPORT_C void ReadResourceAsDes16(TDes16 &aDes, TInt aResourceId) const;

Description

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(TDes16 &,TInt)const instead.

Parameters

TDes16 &aDes

On return, contains the read resource.

TInt aResourceId

The numeric ID of the resource to be read.

See also:


ReadResourceAsDes16L(TDes16 &,TInt)const

Interface status: deprecated 7.0

IMPORT_C void ReadResourceAsDes16L(TDes16 &aDes, TInt aResourceId) const;

Description

Parameters

TDes16 &aDes

TInt aResourceId


AllocReadResourceAsDes16L(TInt)const

IMPORT_C HBufC16* AllocReadResourceAsDes16L(TInt aResourceId) const;

Description

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

TInt aResourceId

The numeric ID of the resource to be read.

Return value

HBufC16 *

Pointer to a heap descriptor containing the resource data.


AllocReadResourceAsDes16LC(TInt)const

IMPORT_C HBufC16* AllocReadResourceAsDes16LC(TInt aResourceId) const;

Description

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.

Parameters

TInt aResourceId

The numeric ID of the resource to be read.

Return value

HBufC16 *

Pointer to a heap descriptor containing the resource data.

See also:


ReadDesC16ArrayResourceL(TInt)

IMPORT_C CDesC16ArrayFlat* ReadDesC16ArrayResourceL(TInt aResourceId);

Description

Reads a resource into a 16 bit descriptor array.

Ownership of the array is transferred to the caller.

Parameters

TInt aResourceId

The numeric ID of the resource to be read.

Return value

CDesC16ArrayFlat *

A pointer to the descriptor array containing the resource data.

See also:


Format128(TDes &,TInt,...)

IMPORT_C void Format128(TDes &aDes, TInt aResourceId,...);

Description

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 CCoeEnv::Format256(TDes &,TInt,...) instead.

Parameters

TDes16 &aDes

On return, contains the formatted resource data.

TInt aResourceId

The numeric ID of the resource to be read.

...


Format256(TDes &,TInt,...)

IMPORT_C void Format256(TDes &aDes, TInt aResourceId,...);

Description

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

TDes16 &aDes

On return, contains the formatted resource data.

TInt aResourceId

The numeric ID of the resource to be read.

...


LeaveWithErrorText(const TDesC &,const TDesC *)

IMPORT_C void LeaveWithErrorText(const TDesC &aMsg, const TDesC *aContextText=0);

Description

Triggers a dialog which will display the error message

Parameters

const TDesC16 &aMsg

The error message.

const TDesC16 *aContextText

The error context text.


SimulateKeyEventL(const TKeyEvent &,TEventCode)

IMPORT_C void SimulateKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);

Description

Simulates a key event.

This function calls CCoeAppUi::HandleWsEventL(const TWsEvent &,CCoeControl *) to process the event as if it had arrived from the window server.

Parameters

const TKeyEvent &aKeyEvent

The key event.

TEventCode aType

The event type.


AddObserverOfLoadedFepL(MCoeObserverOfLoadedFep &)

IMPORT_C void AddObserverOfLoadedFepL(MCoeObserverOfLoadedFep &aObserverOfLoadedFep);

Description

Adds the specified MCoeObserverOfLoadedFep to the loaded FEP list.

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

Parameters

MCoeObserverOfLoadedFep &aObserverOfLoadedFep

The loaded FEP observer to be added to the list.


RemoveObserverOfLoadedFep(MCoeObserverOfLoadedFep &)

IMPORT_C void RemoveObserverOfLoadedFep(MCoeObserverOfLoadedFep &aObserverOfLoadedFep);

Description

Removes the specified loaded FEP observer.

Parameters

MCoeObserverOfLoadedFep &aObserverOfLoadedFep

The FEP observer to be removed.


AddFepObserverL(MCoeFepObserver &)

IMPORT_C void AddFepObserverL(MCoeFepObserver &aFepObserver);

Description

Adds the specified MCoeFepObserver to the FEP observer list.

Parameters

MCoeFepObserver &aFepObserver

The FEP observer to be added to the list.

Panic codes

CONE

18 aFepObserver is NULL.

CONE

21 aFepObserver has already been added to the list.


RemoveFepObserver(MCoeFepObserver &)

IMPORT_C void RemoveFepObserver(MCoeFepObserver &aFepObserver);

Description

Removes the specified FEP observer.

Parameters

MCoeFepObserver &aFepObserver

The FEP observer to be removed.

See also:


ForEachFepObserverCall(TCoeFepObserverFunction)

IMPORT_C void ForEachFepObserverCall(TCoeFepObserverFunction aFepObserverFunction);

Description

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(MCoeFepObserver &).

Parameters

TCoeFepObserverFunction aFepObserverFunction

The function to be called.


InstallFepL(TUid)

Capability: WriteDeviceData To protect against installation of insecure FEP.

IMPORT_C void InstallFepL(TUid aFepUid);

Description

Loads the specified secure FEP into all running applications.

The currently loaded FEP, if any, is unloaded.

Parameters

TUid aFepUid

The UID of the secure FEP to be loaded.


InstallFepL(TUid,const TBool)

Capability: WriteDeviceData To protect against installation of insecure FEP.

IMPORT_C void InstallFepL(TUid aFepUid, const TBool aLeave);

Description

Loads the specified secure FEP into all running applications.

The currently loaded FEP, if any, is unloaded.

Parameters

TUid aFepUid

The UID of the secure FEP to be loaded.

const TBool aLeave

No longer used.


AvailableFepsL(RArray< TUid > &,CDesCArray *)

IMPORT_C void AvailableFepsL(RArray< TUid > &aUids, CDesCArray *aDisplayNames);

Description

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

Parameters

RArray< TUid > &aUids

The array of FEP UIDs to be filled.

CDesC16Array *aDisplayNames

The array of FEP display names to be filled. May be passed as NULL if display names are not required.


ExecuteFepSettingsDialogL(TUid)

IMPORT_C void ExecuteFepSettingsDialogL(TUid aFepUid);

Description

Executes the settings dialog for the specified secure FEP.

The specified FEP does not need to be loaded.

Parameters

TUid aFepUid

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


Fep()const

IMPORT_C CCoeFep* Fep() const;

Description

Gets a pointer to the currently loaded FEP.

Return value

CCoeFep *

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


FepUid()const

IMPORT_C TUid FepUid() const;

Description

Gets the UID of the currently loaded FEP.

Return value

TUid

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


InputCapabilitiesChanged()

IMPORT_C void InputCapabilitiesChanged();

Description

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


AddFocusObserverL(MCoeFocusObserver &)

IMPORT_C void AddFocusObserverL(MCoeFocusObserver &aFocusObserver);

Description

Adds the specified MCoeFocusObserver to the focus observer list.

Parameters

MCoeFocusObserver &aFocusObserver

The focus observer to be added to the list.

Panic codes

CONE

18 aFocusObserver is NULL.

CONE

21 aFocusObserver has already been added to the list.


RemoveFocusObserver(MCoeFocusObserver &)

IMPORT_C void RemoveFocusObserver(MCoeFocusObserver &aFocusObserver);

Description

Removes the specified focus observer.

Parameters

MCoeFocusObserver &aFocusObserver

The focus observer to be removed.

See also:


SyncNotifyFocusObserversOfChangeInFocus()

IMPORT_C void SyncNotifyFocusObserversOfChangeInFocus();

Description


BringOwnerToFront()

IMPORT_C void BringOwnerToFront();

Description

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.


AddForegroundObserverL(MCoeForegroundObserver &)

IMPORT_C void AddForegroundObserverL(MCoeForegroundObserver &aForegroundObserver);

Description

Adds the specified MCoeForegroundObserver to the foreground observer list.

Parameters

MCoeForegroundObserver &aForegroundObserver

The foreground observer to be added to the list.

Panic codes

CONE

18 aForegroundObserver is NULL.

CONE

21 aForegroundObserver has already been added to the list.


RemoveForegroundObserver(MCoeForegroundObserver &)

IMPORT_C void RemoveForegroundObserver(MCoeForegroundObserver &aForegroundObserver);

Description

Removes the specified foreground observer.

Parameters

MCoeForegroundObserver &aForegroundObserver

The foreground observer to be removed.

See also:


AddResourceChangeObserverL(MCoeResourceChangeObserver &)

IMPORT_C void AddResourceChangeObserverL(MCoeResourceChangeObserver &aResourceChangeObserver);

Description

Adds the specified MCoeResourceChangeObserver to the resource change observer list.

Parameters

MCoeResourceChangeObserver &aResourceChangeObserver

The resource change observer to be added to the list.


RemoveResourceChangeObserver(MCoeResourceChangeObserver &)

IMPORT_C void RemoveResourceChangeObserver(MCoeResourceChangeObserver &aResourceChangeObserver);

Description

Removes the specified resource change observer.

Parameters

MCoeResourceChangeObserver &aResourceChangeObserver

The resource change observer to be removed.


AddMessageObserverL(MCoeMessageObserver &)

IMPORT_C void AddMessageObserverL(MCoeMessageObserver &aMessageObserver);

Description

Adds the specified MCoeMessageObserver to the message observer list.

Parameters

MCoeMessageObserver &aMessageObserver

The message observer to be added to the list.

See also:


RemoveMessageObserver(MCoeMessageObserver &)

IMPORT_C void RemoveMessageObserver(MCoeMessageObserver &aMessageObserver);

Description

Removes the specified MCoeMessageObserver from the message observer list.

Parameters

MCoeMessageObserver &aMessageObserver

The message observer to be removed from the list.

See also:


AddMessageMonitorObserverL(MCoeMessageMonitorObserver &)

IMPORT_C void AddMessageMonitorObserverL(MCoeMessageMonitorObserver &aMessageMonitorObserver);

Description

Adds the specified MCoeMessageMonitorObserver to the message observer list

Parameters

MCoeMessageMonitorObserver &aMessageMonitorObserver

The visibility change observer to be added to the list.


RemoveMessageMonitorObserver(MCoeMessageMonitorObserver &)

IMPORT_C void RemoveMessageMonitorObserver(MCoeMessageMonitorObserver &aMessageMonitorObserver);

Description

Removes the specified MCoeMessageMonitorObserver.

Parameters

MCoeMessageMonitorObserver &aMessageMonitorObserver

The visibility change observer to be removed.


Static(TUid)

IMPORT_C static CCoeStatic* Static(TUid aUid);

Description

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

TUid aUid

The UID of the CCoeStatic derived class.

Return value

CCoeStatic *

A pointer to the CCoeStatic derived object. NULL if no match is found.


FindStatic(TUid)

IMPORT_C CCoeStatic* FindStatic(TUid aUid);

Description

Parameters

TUid aUid

Return value

CCoeStatic *


DisableShutdownChecks()const

IMPORT_C TBool DisableShutdownChecks() const;

Description

Return value

TBool


Reserved_1()

private: IMPORT_C virtual void Reserved_1();

Description


Reserved_2()

private: IMPORT_C virtual void Reserved_2();

Description


RunError(TInt)

private: IMPORT_C virtual TInt RunError(TInt aError);

Description

Parameters

TInt aError

Return value

TInt


MopSupplyObject(TTypeUid)

protected: IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);

Description

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

TTypeUid aId

An encapsulated object type ID.

Return value

TTypeUid::Ptr

Encapsulates the pointer to the object provided. Note that the encapsulated pointer may be NULL.


DestroyScreen()

protected: IMPORT_C virtual void DestroyScreen();

Description

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 CCoeEnv::DestroyEnvironment().


ErrorText()

protected: inline TDes& ErrorText();

Description

Gets the current error message text.

Return value

TDes16 &

The current error message text.


ErrorContextText()

protected: inline TDes& ErrorContextText();

Description

Gets the current error context text.

Return value

TDes16 &

The current error context text.


InitSystemFontsL()

private: IMPORT_C virtual void InitSystemFontsL();

Description

Initialises the system fonts.

This function is called by CCoeEnv::ConstructL() during the construction of a CCoeEnv. The default implementation creates only the normal control environment font, but this function may be overridden to create other fonts.


ResourceFileVersionNumber()const

private: IMPORT_C virtual TInt ResourceFileVersionNumber() const;

Description

Gets the resource file version number.

The function is intended to be replaced in a derived class. It should return a defined constant which should correspond to the version number of resource files used by the application. It is implemented by the standard GUI framework.

CCoeEnv::AddResourceFileL(const TDesC &) uses this function to verify that the application is not using an out of date resource file. An out of date resource file causes CCoeEnv::AddResourceFileL(const TDesC &) to leave with error code KErrBaflWrongResourceFileSignature.

Return value

TInt

The resource file version number.

[Top]


Member data


iAppUi

protected: CCoeAppUi * iAppUi;

Description


iFsSession

protected: RFs iFsSession;

Description


iWsSession

protected: RWsSession iWsSession;

Description


iRootWin

protected: RWindowGroup iRootWin;

Description


iSystemGc

protected: CWindowGc * iSystemGc;

Description


iNormalFont

protected: const CFont * iNormalFont;

Description


iScreen

protected: CWsScreenDevice * iScreen;

Description


iLastEvent

protected: TWsEvent iLastEvent;

Description


iResourceFileArray

protected: CArrayFix< RResourceFile > * iResourceFileArray;

Description