CApaAppListNotifier Class Reference

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);

.... }

Inherits from

Constructor & Destructor Documentation

CApaAppListNotifier(MApaAppListServObserver &, TPriority)

CApaAppListNotifier ( MApaAppListServObserver & aObserver,
TPriority aPriority
) [private]

Parameters

MApaAppListServObserver & aObserver
TPriority aPriority

~CApaAppListNotifier()

IMPORT_C ~CApaAppListNotifier ( )

The destructor calls Cancel() and closes the session with the server.

CActive::Cancel()

Member Functions Documentation

ConstructL()

void ConstructL ( ) [private]

DoCancel()

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

CActive::Cancel

NewL(MApaAppListServObserver *, TPriority)

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.

Parameters

MApaAppListServObserver * aObserver Observer whose HandleAppListEvent() function is called when application list is changed.
TPriority aPriority The active object priority.

RunError(TInt)

TInt RunError ( TInt aError ) [private, virtual]

Parameters

TInt aError

RunL()

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

Member Data Documentation

RApaLsSession iLsSession

RApaLsSession iLsSession [private]

MApaAppListServObserver & iObserver

MApaAppListServObserver & iObserver [private]