class CCoeEnv : public CActive |
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.
Protected Member Functions | |
---|---|
IMPORT_C TInt | CoeEnvConstructorError() |
IMPORT_C void | DestroyEnvironmentEnd() |
IMPORT_C void | DestroyEnvironmentStatic() |
IMPORT_C void | DestroyScreen() |
TDes & | ErrorContextText() |
TDes & | ErrorText() |
IMPORT_C TTypeUid::Ptr | MopSupplyObject(TTypeUid) |
IMPORT_C void | SetAppStartupInstrumentationEventIdBaseL(TInt) |
Private Member Functions | |
---|---|
void | AddObserverL(TAny *, RGenericPointerArray &) |
void | ConnectToFileServerL() |
void | ConnectToWindowServerL() |
void | CreateActiveSchedulerL() |
void | DeleteArrayOfScreensItems() |
void | DestroyAllResourceFiles() |
RResourceFile * | DoResourceFileForIdL(TInt) |
void | InitRootWindowL(TBool, TInt) |
void | InitScreenL(TInt) |
IMPORT_C void | InitSystemFontsL() |
void | InitSystemGcL() |
TUint | InitialHandleCount() |
void | PopulateArrayOfScreenItemsL() |
void | RemoveObserver(TAny *, RGenericPointerArray &) |
void | RequestEventNotification() |
IMPORT_C void | Reserved_1() |
IMPORT_C void | Reserved_2() |
RResourceFile & | ResourceFileForId(TInt) |
IMPORT_C TInt | ResourceFileVersionNumber() |
IMPORT_C TInt | RunError(TInt) |
void | SetInitialHandleCount() |
void | UpdateStatic(CCoeAppUi *) |
Private Member Enumerations | |
---|---|
enum | TFlags { ENoShutdownChecks = 0x0001, EExtraPointerIsErrorCode = 0x0002, ESchedulerIsRunning = 0x0004 } |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Protected Attributes | |
---|---|
CCoeAppUi * | iAppUi |
RFs | iFsSession |
TWsEvent | iLastEvent |
const CFont * | iNormalFont |
CArrayFix< RResourceFile > * | iResourceFileArray |
RWindowGroup | iRootWin |
CWsScreenDevice * | iScreen |
CWindowGc * | iSystemGc |
RWsSession | iWsSession |
Private Attributes | |
---|---|
CTrapCleanup * | iCleanup |
TUint | iEnvFlags |
TDes * | iErrorContextText |
TDes * | iErrorText |
CCoeEnvExtra * | iExtra |
Inherited Attributes | |
---|---|
CActive::iStatus |
IMPORT_C void | AddFepObserverL | ( | MCoeFepObserver & | aFepObserver | ) |
MCoeFepObserver & aFepObserver |
IMPORT_C void | AddFocusObserverL | ( | MCoeFocusObserver & | aFocusObserver | ) |
MCoeFocusObserver & aFocusObserver |
IMPORT_C void | AddForegroundObserverL | ( | MCoeForegroundObserver & | aForegroundObserver | ) |
MCoeForegroundObserver & aForegroundObserver |
IMPORT_C void | AddMessageMonitorObserverL | ( | MCoeMessageMonitorObserver & | aMessageMonitorObserver | ) |
MCoeMessageMonitorObserver & aMessageMonitorObserver |
IMPORT_C void | AddMessageObserverL | ( | MCoeMessageObserver & | aMessageObserver | ) |
MCoeMessageObserver & aMessageObserver |
void | AddObserverL | ( | TAny * | aObserver, |
RGenericPointerArray & | aArray | |||
) | [private] |
TAny * aObserver | |
RGenericPointerArray & aArray |
IMPORT_C void | AddObserverOfLoadedFepL | ( | MCoeObserverOfLoadedFep & | aObserverOfLoadedFep | ) |
MCoeObserverOfLoadedFep & aObserverOfLoadedFep |
IMPORT_C void | AddResourceChangeObserverL | ( | MCoeResourceChangeObserver & | aResourceChangeObserver | ) |
MCoeResourceChangeObserver & aResourceChangeObserver |
IMPORT_C TInt | AddResourceFileL | ( | const TDesC & | aFileName | ) |
const TDesC & aFileName |
IMPORT_C HBufC16 * | AllocReadResourceAsDes16L | ( | TInt | aResourceId | ) | const |
TInt aResourceId |
IMPORT_C HBufC16 * | AllocReadResourceAsDes16LC | ( | TInt | aResourceId | ) | const |
TInt aResourceId |
IMPORT_C HBufC8 * | AllocReadResourceAsDes8L | ( | TInt | aResourceId | ) | const |
TInt aResourceId |
IMPORT_C HBufC8 * | AllocReadResourceAsDes8LC | ( | TInt | aResourceId | ) | const |
TInt aResourceId |
HBufC * | AllocReadResourceL | ( | TInt | aResourceId | ) | 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.
Pointer to a heap descriptor containing the resource data.
TInt aResourceId | The numeric ID of the resource to be read. |
HBufC * | AllocReadResourceLC | ( | TInt | aResourceId | ) | 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.
Pointer to a heap descriptor containing the resource data.
TInt aResourceId | The numeric ID of the resource to be read. |
CCoeAppUi * | AppUi | ( | ) | const [inline] |
Gets the application UI owned by this application.
Pointer to the app UI owned by the application.
IMPORT_C void | AvailableFepsL | ( | RArray< TUid > & | aUids, |
CDesCArray * | aDisplayNames | |||
) |
RArray< TUid > & aUids | |
CDesCArray * aDisplayNames |
IMPORT_C void | ConstructL | ( | TBool | aInitialFocusState | ) |
TBool aInitialFocusState |
IMPORT_C void | ConstructL | ( | TBool | aInitialFocusState, |
TInt | aDefaultScreenNumber, | |||
TInt | aWindowGroupID | |||
) |
IMPORT_C CFbsFont * | CreateDeviceFontL | ( | CGraphicsDevice * | aDevice, |
const TFontSpec & | aFontSpec | |||
) |
CGraphicsDevice * aDevice | |
const TFontSpec & aFontSpec |
IMPORT_C void | CreateResourceReaderLC | ( | TResourceReader & | aReader, |
TInt | aResourceId | |||
) | const |
TResourceReader & aReader | |
TInt aResourceId |
IMPORT_C CFbsFont * | CreateScreenFontL | ( | const TFontSpec & | aFontSpec | ) |
const TFontSpec & aFontSpec |
IMPORT_C void | DoCancel | ( | ) | [virtual] |
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().
RResourceFile * | DoResourceFileForIdL | ( | TInt | aResourceId | ) | const [private] |
TInt aResourceId |
void | EnsureSpecifiedFepIsLoadedL | ( | TUid | aFepUid | ) |
TUid aFepUid |
TDes & | ErrorContextText | ( | ) | [protected, inline] |
Gets the current error context text.
The current error context text.
TDes & | ErrorText | ( | ) | [protected, inline] |
Gets the current error message text.
The current error message text.
IMPORT_C void | ExecuteFepSettingsDialogL | ( | TUid | aFepUid | ) |
TUid aFepUid |
IMPORT_C void | Flush | ( | TTimeIntervalMicroSeconds32 | aDelay = 0 | ) |
TTimeIntervalMicroSeconds32 aDelay = 0 |
TBool | FocusObserverNotificationIsStillPending | ( | TInt | aFocusObserverNotificationIdentifier | ) | const |
TInt aFocusObserverNotificationIdentifier |
IMPORT_C void | ForEachFepObserverCall | ( | TCoeFepObserverFunction | aFepObserverFunction | ) |
TCoeFepObserverFunction aFepObserverFunction |
IMPORT_C void | GetMessageNotifyingObserversLC | ( | TUint32 | aClientHandleOfTargetWindowGroup, |
TUid & | aMessageUid, | |||
TPtr8 & | aMessageParameters, | |||
const TWsEvent & | aMessageEvent | |||
) |
void | InitRootWindowL | ( | TBool | aInitialFocusState, |
TInt | aWindowGroupID = 0 | |||
) | [private] |
void | InitScreenL | ( | TInt | aDefaultScreenNumber | ) | [private] |
TInt aDefaultScreenNumber |
CVwsSessionWrapper * | InitViewServerSessionL | ( | MVwsSessionWrapperObserver & | aObserver | ) |
MVwsSessionWrapperObserver & aObserver |
IMPORT_C TBool | IsResourceAvailableL | ( | TInt | aResourceId | ) | const |
TInt aResourceId |
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.
The last event.
IMPORT_C void | LeaveWithErrorText | ( | const TDesC & | aMsg, |
const TDesC * | aContextText = NULL | |||
) |
IMPORT_C TTypeUid::Ptr | MopSupplyObject | ( | TTypeUid | aId | ) | [protected] |
TTypeUid aId |
const CFont * | NormalFont | ( | ) | const [inline] |
Gets the normal environment font.
This is the font created during construction of the control environment.
Pointer to the normal environment font.
void | NotifyFocusObserversOfDestructionOfFocusedItem | ( | ) |
void | NotifyMessageMonitorObserversOfEvent | ( | const TWsEvent & | aEvent | ) |
const TWsEvent & aEvent |
void | QueueNotificationToFocusObserversOfChangeInFocus | ( | ) |
IMPORT_C CDesC16ArrayFlat * | ReadDesC16ArrayResourceL | ( | TInt | aResourceId | ) |
TInt aResourceId |
IMPORT_C CDesC8ArrayFlat * | ReadDesC8ArrayResourceL | ( | TInt | aResourceId | ) |
TInt aResourceId |
CDesCArrayFlat * | ReadDesCArrayResourceL | ( | TInt | aResourceId | ) | [inline] |
Reads a resource into a Unicode descriptor array.
A pointer to the descriptor array containing the resource data.
TResourceReader::ReadDesCArrayL()
TInt aResourceId | The numeric ID of the resource to be read. |
void | ReadResource | ( | TDes & | aDes, |
TInt | aResourceId | |||
) | 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.
Deprecated - Use CCoeEnv::ReadResourceL() instead.
KErrCoeFailedToReadFromProgDisk
IMPORT_C void | ReadResourceAsDes16 | ( | TDes16 & | aDes, |
TInt | aResourceId | |||
) | const |
IMPORT_C void | ReadResourceAsDes16L | ( | TDes16 & | aDes, |
TInt | aResourceId | |||
) | const |
7.0
IMPORT_C void | ReadResourceAsDes8 | ( | TDes8 & | aDes, |
TInt | aResourceId | |||
) | const |
IMPORT_C void | ReadResourceAsDes8L | ( | TDes8 & | aDes, |
TInt | aResourceId | |||
) | const |
7.0
void | ReadResourceL | ( | TDes & | aDes, |
TInt | aResourceId | |||
) | 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.
Pointer to a heap descriptor containing the resource.
IMPORT_C void | ReleaseScreenFont | ( | CFont * | aFont | ) | const |
CFont * aFont |
IMPORT_C void | RemoveFepObserver | ( | MCoeFepObserver & | aFepObserver | ) |
MCoeFepObserver & aFepObserver |
IMPORT_C void | RemoveFocusObserver | ( | MCoeFocusObserver & | aFocusObserver | ) |
MCoeFocusObserver & aFocusObserver |
IMPORT_C void | RemoveForegroundObserver | ( | MCoeForegroundObserver & | aForegroundObserver | ) |
MCoeForegroundObserver & aForegroundObserver |
IMPORT_C void | RemoveMessageMonitorObserver | ( | MCoeMessageMonitorObserver & | aMessageMonitorObserver | ) |
MCoeMessageMonitorObserver & aMessageMonitorObserver |
IMPORT_C void | RemoveMessageObserver | ( | MCoeMessageObserver & | aMessageObserver | ) |
MCoeMessageObserver & aMessageObserver |
void | RemoveObserver | ( | TAny * | aObserver, |
RGenericPointerArray & | aArray | |||
) | [private] |
TAny * aObserver | |
RGenericPointerArray & aArray |
IMPORT_C void | RemoveObserverOfLoadedFep | ( | MCoeObserverOfLoadedFep & | aObserverOfLoadedFep | ) |
MCoeObserverOfLoadedFep & aObserverOfLoadedFep |
IMPORT_C void | RemoveResourceChangeObserver | ( | MCoeResourceChangeObserver & | aResourceChangeObserver | ) |
MCoeResourceChangeObserver & aResourceChangeObserver |
RResourceFile & | ResourceFileForId | ( | TInt | aResourceId | ) | const [private] |
TInt aResourceId |
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.
The application's window group.
IMPORT_C void | RunL | ( | ) | [virtual] |
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.
CActiveScheduler::WaitForAnyRequest
TRAPD
IMPORT_C CWsScreenDevice * | ScreenDevice | ( | TInt | aScreenNumber | ) | const |
TInt aScreenNumber |
IMPORT_C void | SetAppStartupInstrumentationEventIdBaseL | ( | TInt | aAppStartupInstrumentationEventIdBase | ) | [protected] |
TInt aAppStartupInstrumentationEventIdBase |
IMPORT_C void | SetZoomFactor | ( | const TZoomFactor & | aZoomFactor | ) |
const TZoomFactor & aZoomFactor |
IMPORT_C void | SimulateKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) |
const TKeyEvent & aKeyEvent | |
TEventCode aType |
IMPORT_C CWindowGc * | SwapSystemGc | ( | CWindowGc * | aGc | ) |
CWindowGc * aGc |
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().
The system graphics context.
void | UpdateStatic | ( | CCoeAppUi * | aNewAppUi | ) | [private] |
CCoeAppUi * aNewAppUi |
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.
The window server session opened by the application.
ENoShutdownChecks = 0x0001 | |
EExtraPointerIsErrorCode = 0x0002 | |
ESchedulerIsRunning = 0x0004 |
CArrayFix< RResourceFile > * | iResourceFileArray | [protected] |