class CCenRepNotifyHandler : public CActive |
Active object wrapper for Central Repository one-shot notification handling. Central Repository Notification Handler API provides an easy-to-use implementation of a CActive-based wrapper for Central Repository single-shot notifications. In most cases Central Repository Notification Handler can automatically resubscribe to notifications and fetch the modified value from Central Repository. The API consists of the classes CCenRepNotifyHandler and MCenRepNotifyHandlerCallback. The user of this class needs to implement relevant MCenRepNotifyHandlerCallback interface methods to receive notifications. The user of Central Repository Notification Handler API needs access to Central Repository (centralrepository.h).
Usage:
iSession = CRepository::NewL(KTestUid); iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iSession, CCenRepNotifyHandler::EStringKey, KKey1); iNotifyHandler->StartListeningL();
iNotifyHandler->StopListening(); delete iNotifyHandler;
void CMyCenRepNotifyTest::HandleNotifyString(TUint32 aId, const TDesC16& aNewValue) { // Print out the notified value RDebug::Print(_L("Key %d changed, new value: %S"), aId, &aNewValue); }
Public Member Functions | |
---|---|
~CCenRepNotifyHandler() | |
IMPORT_C CCenRepNotifyHandler * | NewL(MCenRepNotifyHandlerCallback &, CRepository &, TCenRepKeyType, TUint32) |
IMPORT_C CCenRepNotifyHandler * | NewL(MCenRepNotifyHandlerCallback &, CRepository &) |
IMPORT_C CCenRepNotifyHandler * | NewLC(MCenRepNotifyHandlerCallback &, CRepository &, TCenRepKeyType, TUint32) |
IMPORT_C CCenRepNotifyHandler * | NewLC(MCenRepNotifyHandlerCallback &, CRepository &) |
IMPORT_C void | StartListeningL() |
IMPORT_C void | StopListening() |
Protected Member Functions | |
---|---|
void | DoCancel() |
TInt | RunError(TInt) |
void | RunL() |
Private Member Functions | |
---|---|
CCenRepNotifyHandler(MCenRepNotifyHandlerCallback &, CRepository &, TCenRepKeyType, TUint32) | |
CCenRepNotifyHandler(MCenRepNotifyHandlerCallback &, CRepository &) | |
TInt | OrderNotification() |
Public Member Enumerations | |
---|---|
enum | TCenRepKeyType { EIntKey, ERealKey, EStringKey, EBinaryKey } |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Private Attributes | |
---|---|
MCenRepNotifyHandlerCallback & | iCallback |
TUint32 | iId |
TCenRepKeyType | iKeyType |
CRepository & | iSession |
TBool | iWholeRepository |
Inherited Attributes | |
---|---|
CActive::iStatus |
CCenRepNotifyHandler | ( | MCenRepNotifyHandlerCallback & | aCallback, |
CRepository & | aSession, | ||
TCenRepKeyType | aKeyType, | ||
TUint32 | aId | ||
) | [private] |
MCenRepNotifyHandlerCallback & aCallback | |
CRepository & aSession | |
TCenRepKeyType aKeyType | |
TUint32 aId |
CCenRepNotifyHandler | ( | MCenRepNotifyHandlerCallback & | aCallback, |
CRepository & | aSession | ||
) | [private] |
MCenRepNotifyHandlerCallback & aCallback | |
CRepository & aSession |
void | DoCancel | ( | ) | [protected, 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 CCenRepNotifyHandler * | NewL | ( | MCenRepNotifyHandlerCallback & | aCallback, |
CRepository & | aSession, | |||
TCenRepKeyType | aKeyType, | |||
TUint32 | aId | |||
) | [static] |
MCenRepNotifyHandlerCallback & aCallback | |
CRepository & aSession | |
TCenRepKeyType aKeyType | |
TUint32 aId |
IMPORT_C CCenRepNotifyHandler * | NewL | ( | MCenRepNotifyHandlerCallback & | aCallback, |
CRepository & | aSession | |||
) | [static] |
MCenRepNotifyHandlerCallback & aCallback | |
CRepository & aSession |
IMPORT_C CCenRepNotifyHandler * | NewLC | ( | MCenRepNotifyHandlerCallback & | aCallback, |
CRepository & | aSession, | |||
TCenRepKeyType | aKeyType, | |||
TUint32 | aId | |||
) | [static] |
MCenRepNotifyHandlerCallback & aCallback | |
CRepository & aSession | |
TCenRepKeyType aKeyType | |
TUint32 aId |
IMPORT_C CCenRepNotifyHandler * | NewLC | ( | MCenRepNotifyHandlerCallback & | aCallback, |
CRepository & | aSession | |||
) | [static] |
MCenRepNotifyHandlerCallback & aCallback | |
CRepository & aSession |
void | RunL | ( | ) | [protected, 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
Defines different key types. Enumeration is used to indicate the key type that is listened to.
EIntKey | |
ERealKey | |
EStringKey | |
EBinaryKey |