CContextEngineAO Class Reference

class CContextEngineAO : public CActive

This class implements an active object for collecting context metadata asyncronously from the context plugins.

Inherits from

Public Member Functions
~CContextEngineAO()
voidDoCancel()
CContextEngineAO *NewL(MContextInitializationObserver *, MContextSnapshotObserver *)
voidNotifyKeyL(const TInt, const TUid, const TUint)
TInt PluginCount()
voidPluginInitializationStatus(TInt)
voidPluginSnapshotStatus(CHarvesterData *)
TInt RunError(TInt)
voidRunL()
voidSetMdeSession(CMdESession *)
voidStartSnapshot(CContextSnapshotItem *)
Private Member Functions
CContextEngineAO(MContextInitializationObserver *, MContextSnapshotObserver *)
voidBackupRestoreReady()
voidBackupRestoreStart()
voidConstructL()
voidHandleBackupRestoreKeyAction(const TUint)
voidInitializeL()
voidLoadPluginsL()
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTContextEngineState { EReady = 0, EInitialization, ESnapshot }
Inherited Enumerations
CActive:TPriority
Private Attributes
MContextSnapshotObserver *iContextSnapshotObserver
TInt iInitializationError
MContextInitializationObserver *iInitializationObserver
CContextSnapshotItem *iItem
TBool iLastPlugin
CMdESession *iMdESession
TInt iPluginSnapshotsLacking
RPointerArray< CContextPlugin >iPlugins
CPropertyWatcher *iPropertyWatcher
TInt iSnapshotError
TContextEngineState iState
TInt iUninitializedPluginsCount
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CContextEngineAO(MContextInitializationObserver *, MContextSnapshotObserver *)

CContextEngineAO(MContextInitializationObserver *aInitObserver,
MContextSnapshotObserver *aSnapshotObserver
)[private]

Default constructor, implicitly called by NewL().

Parameters

MContextInitializationObserver * aInitObserver
MContextSnapshotObserver * aSnapshotObserver

~CContextEngineAO()

~CContextEngineAO()[virtual]

Destructor.

Member Functions Documentation

BackupRestoreReady()

voidBackupRestoreReady()[private]

Called when Backup&Restore has finished backup or restore.

BackupRestoreStart()

voidBackupRestoreStart()[private]

Called when Backup&Restore is backing up or restoring.

ConstructL()

voidConstructL()[private]

2nd phase construction, called by NewL().

DoCancel()

voidDoCancel()[virtual]

From CActive. Cancels ????.

HandleBackupRestoreKeyAction(const TUint)

voidHandleBackupRestoreKeyAction(const TUintaKeyValue)[private]

Method HandleBackupRestoreKeyActionL. If user make full restore sets restore flag on.

Parameters

const TUint aKeyValue

InitializeL()

voidInitializeL()[private]

Initialize this object. Thus load and initialize context plugins.

LoadPluginsL()

voidLoadPluginsL()[private]

Load context plugins.

NewL(MContextInitializationObserver *, MContextSnapshotObserver *)

CContextEngineAO *NewL(MContextInitializationObserver *aInitObserver,
MContextSnapshotObserver *aSnapshotObserver
)[static]

Creates and constructs a new instance of CContextEngineAO.

Parameters

MContextInitializationObserver * aInitObserver
MContextSnapshotObserver * aSnapshotObserver

NotifyKeyL(const TInt, const TUid, const TUint)

voidNotifyKeyL(const TIntaKeyValue,
const TUidaPropertyCategory,
const TUintaKey
)

Method NotifyKeyL from MKeyObserver get notifications when property key has changed.

Parameters

const TInt aKeyValue
const TUid aPropertyCategory
const TUint aKey

PluginCount()

TInt PluginCount()

Method used to clarify how many plug-ins are loaded.

PluginInitializationStatus(TInt)

voidPluginInitializationStatus(TIntaErrorCode)

From MContextPluginObserver. This is derived from MContextPluginObserver and it is called by each plug-in when they have initialized. Error code for the first encountered error is returned as a parameter.

Parameters

TInt aErrorCodeError code for the first error occurred during initialization.

PluginSnapshotStatus(CHarvesterData *)

voidPluginSnapshotStatus(CHarvesterData *aHD)

From MContextPluginObserver. This is derived from MContextPluginObserver and it is called by each plug-in when they have taken the context snapshot. Error code for the first encountered error is returned as a parameter.

Parameters

CHarvesterData * aHD

RunError(TInt)

TInt RunError(TIntaError)[virtual]

From CActive. Handles a leave occurring in the request completion event handler RunL().

Parameters

TInt aErrorAn error code.

RunL()

voidRunL()[virtual]

From CActive. Every call takes a context snapshot from one plug-in.

SetMdeSession(CMdESession *)

voidSetMdeSession(CMdESession *aSession)

Set a pointer to MdESession. The pointer is given forward to context plugins. Session must be set in order to successfully harvest context data.

Parameters

CMdESession * aSessionSession pointer to set.

StartSnapshot(CContextSnapshotItem *)

voidStartSnapshot(CContextSnapshotItem *aItem)

Start taking a context snapshot (for multiple objects).

Parameters

CContextSnapshotItem * aItemObserver to inform about snapshot completion and MdE objects the snapshot is taken to.

Member Enumerations Documentation

Enum TContextEngineState

State for context engine (=this active object). Possible states: Ready for snapshot, initializing plugins or taking a snapshot.

Enumerators

EReady = 0
EInitialization
ESnapshot

Member Data Documentation

MContextSnapshotObserver * iContextSnapshotObserver

MContextSnapshotObserver *iContextSnapshotObserver[private]

This observer is used to inform Context Engine about finishing a context snapshot.

TInt iInitializationError

TInt iInitializationError[private]

First error code encountered in initialization is cached here and returned later.

MContextInitializationObserver * iInitializationObserver

MContextInitializationObserver *iInitializationObserver[private]

This observer is used to inform the client application about finishing plug-in initializations.

CContextSnapshotItem * iItem

CContextSnapshotItem *iItem[private]

Item to which we are currently doing a snapshot for.

TBool iLastPlugin

TBool iLastPlugin[private]

iPropertyWatcher - used to check if only one plugin has not finished work.

CMdESession * iMdESession

CMdESession *iMdESession[private]

iMdESession - MDE session.

TInt iPluginSnapshotsLacking

TInt iPluginSnapshotsLacking[private]

Number of HDs currently not completed the snapshot yet.

RPointerArray< CContextPlugin > iPlugins

RPointerArray< CContextPlugin >iPlugins[private]

Plug-in array contains the plug-ins.

CPropertyWatcher * iPropertyWatcher

CPropertyWatcher *iPropertyWatcher[private]

iPropertyWatcher - constains observed key's, owned by this class.

TInt iSnapshotError

TInt iSnapshotError[private]

First error code encountered in snapshot is cached here and returned later.

TContextEngineState iState

TContextEngineState iState[private]

State of this active object.

TInt iUninitializedPluginsCount

TInt iUninitializedPluginsCount[private]

Number of plug-ins currently not being initialized yet.