class CApaAppListNotifier : public CActive |
CApaAppListNotifier is an active object which notifies the client when an application list is changed. Provides notification when applications are added, deleted or if the localisable data of an application is modified.
Clients can create instance of this class using NewL function which takes MApaAppListServObserver observer as one of the parameters. When application list is changed, CApaAppListNotifier will call HandleAppListEvent function of the provided observer.
Example:
//Implementation of observer interface class CAppListChangeObserver:public CBase, public MApaAppListServObserver { public: void HandleAppListEvent(TInt aEvent); CApaAppListNotifier* iNotifier; };
//This function is called by CApaAppListNotifier when an application list is changed void CAppListChangeObserver::HandleAppListEvent(TInt aEvent) { //Handle application list change event ... }
TInt E32Main() { ....
CAppListChangeObserver* obs=new(ELeave) CAppListChangeObserver(); CApaAppListNotifier *notif=CApaAppListNotifierNewL(obs, CActive::EPriorityStandard);
.... }
Public Member Functions | |
---|---|
~CApaAppListNotifier() | |
IMPORT_C CApaAppListNotifier * | NewL(MApaAppListServObserver *, TPriority) |
Private Member Functions | |
---|---|
CApaAppListNotifier(MApaAppListServObserver &, TPriority) | |
void | ConstructL() |
void | DoCancel() |
TInt | RunError(TInt) |
void | RunL() |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Private Attributes | |
---|---|
RApaLsSession | iLsSession |
MApaAppListServObserver & | iObserver |
Inherited Attributes | |
---|---|
CActive::iStatus |
CApaAppListNotifier | ( | MApaAppListServObserver & | aObserver, |
TPriority | aPriority | ||
) | [private] |
MApaAppListServObserver & aObserver | |
TPriority aPriority |
IMPORT_C | ~CApaAppListNotifier | ( | ) |
The destructor calls Cancel() and closes the session with the server.
void | DoCancel | ( | ) | [private, 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().
IMPORT_C CApaAppListNotifier * | NewL | ( | MApaAppListServObserver * | aObserver, |
TPriority | aPriority | |||
) | [static] |
Allocates and constructs an application list change notifier.
It creates a session with the application architecture server (RApaLsSession), issues the notification request to the server and adds itself to the active scheduler.
MApaAppListServObserver * aObserver | Observer whose HandleAppListEvent() function is called when application list is changed. |
TPriority aPriority | The active object priority. |
void | RunL | ( | ) | [private, 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::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.