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

Member Functions Documentation

HarvestingUpdated(HarvesterEventObserverType, HarvesterEventState, TInt)

voidHarvestingUpdated(HarvesterEventObserverTypeaHEObserverType,
HarvesterEventStateaHarvesterEventState,
TIntaItemsLeft
)[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 aHEObserverTypeDefines the observer type to which this events is related
HarvesterEventState aHarvesterEventStateEvent that occurred
TInt aItemsLeftNumber of items left regarding the harvesting procedure (defined by aHEObserverType)