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) |
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
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) |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.