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 ()
void DoCancel ()
CContextEngineAO * NewL ( MContextInitializationObserver *, MContextSnapshotObserver *)
void NotifyKeyL (const TInt , const TUid , const TUint )
TInt PluginCount ()
void PluginInitializationStatus ( TInt )
void PluginSnapshotStatus (CHarvesterData *)
TInt RunError ( TInt )
void RunL ()
void SetMdeSession (CMdESession *)
void StartSnapshot ( CContextSnapshotItem *)
Private Member Functions
CContextEngineAO ( MContextInitializationObserver *, MContextSnapshotObserver *)
void BackupRestoreReady ()
void BackupRestoreStart ()
void ConstructL ()
void HandleBackupRestoreKeyAction (const TUint )
void InitializeL ()
void LoadPluginsL ()
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
enum TContextEngineState { 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()

void BackupRestoreReady ( ) [private]

Called when Backup&Restore has finished backup or restore.

BackupRestoreStart()

void BackupRestoreStart ( ) [private]

Called when Backup&Restore is backing up or restoring.

ConstructL()

void ConstructL ( ) [private]

2nd phase construction, called by NewL() .

DoCancel()

void DoCancel ( ) [virtual]

From CActive . Cancels ????.

HandleBackupRestoreKeyAction(const TUint)

void HandleBackupRestoreKeyAction ( const TUint aKeyValue ) [private]

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

Parameters

const TUint aKeyValue

InitializeL()

void InitializeL ( ) [private]

Initialize this object. Thus load and initialize context plugins.

LoadPluginsL()

void LoadPluginsL ( ) [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)

void NotifyKeyL ( const TInt aKeyValue,
const TUid aPropertyCategory,
const TUint aKey
)

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)

void PluginInitializationStatus ( TInt aErrorCode )

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 aErrorCode Error code for the first error occurred during initialization.

PluginSnapshotStatus(CHarvesterData *)

void PluginSnapshotStatus ( 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 ( TInt aError ) [virtual]

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

Parameters

TInt aError An error code.

RunL()

void RunL ( ) [virtual]

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

SetMdeSession(CMdESession *)

void SetMdeSession ( 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 * aSession Session pointer to set.

StartSnapshot(CContextSnapshotItem *)

void StartSnapshot ( CContextSnapshotItem * aItem )

Start taking a context snapshot (for multiple objects).

Parameters

CContextSnapshotItem * aItem Observer 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.