MHarvesterEventObserver Class Reference

class MHarvesterEventObserver

Observer interface to inform about events that happen inside the observer framework

Example of MHarvesterEventObserver , RHarvesterClient::AddHarvesterEventObserver and RHarvesterClient::RemoveHarvesterEventObserver usage:

void CHarvestObserver::ConstructL() { // iHClient is instance of RHarvesterClient iHClient.Connect();

// Listen to placeholder changes to "full" metadata objects - request notification // after 100 items have changed. TInt err = iHClient.AddHarvesterEventObserver( *this, EHEObserverTypePlaceholder, 100 ); if (err == KErrNone) { // do something now that event observer is setup } }

void CHarvestObserver::HarvestingUpdated( HarvesterEventObserverType aHEObserverType, HarvesterEventState aHarvesterEventState, TInt aItemsLeft ) { // Check the observer notification type if (aHEObserverType == EHEObserverTypePlaceholder) { // Checking if there are more than 1000 items left to process if (aItemsLeft > 1000) { // do something since there are some many items still placeholders } if (aItemsLeft == 0) { all placeholders changed to "full" objects - do something... } } }

CHarvestObserver::~CHarvestObserver() { // Removing the observer in destructor iHClient.RemoveHarvesterEventObserver( *this ); }

Public Member Functions
void HarvestingUpdated ( HarvesterEventObserverType , HarvesterEventState , TInt )

Member Functions Documentation

HarvestingUpdated(HarvesterEventObserverType, HarvesterEventState, TInt)

void HarvestingUpdated ( HarvesterEventObserverType aHEObserverType,
HarvesterEventState aHarvesterEventState,
TInt aItemsLeft
) [pure virtual]

Callback interface which informs about harvesting changes based on the observers that the end user has setup/registered.

RHarvesterClient::AddHarvesterEventObserver RHarvesterClient::RemoveHarvesterEventObserver

Parameters

HarvesterEventObserverType aHEObserverType Defines the observer type to which this events is related
HarvesterEventState aHarvesterEventState Event that occurred
TInt aItemsLeft Number of items left regarding the harvesting procedure (defined by aHEObserverType)