class MHarvestObserver |
Observer interface to inform when fast harvesting is completed with the HarvestingComplete callback.
Example of MHarvestObserver and RHarvesterClient::HarvestFile usage:
Client application (like Camera) which wants to observe the completion of harvesting requests (issued with RHarvesterClient::Harvestile method) needs implement the interface MHarvestObserver::HarvestingComplete . Callback HarvestingComplete provides the name of the harvested file (aURI) and also possible error code (aError).
class CHarvestingObserver : public MHarvestObserver { void HarvestingComplete( TDesC& aURI, TInt aError ) ; // from MHarvestObserver void IssueHarvestingRequests();
RHarvesterClient iHClient; }
void CHarvestObserver::ConstructL() { // connecting to Harvester server iHClient.Connect(); }
void CHarvestObserver::IssueHarvestingRequests() { // new harvesting request data _LIT( KNewFile, "C:\\Data\\ThisIsANewFile1.jpg" ); RArray<TItemId> defaultPhotoAlbums; defaultPhotoAlbums.Append( 123 ); defaultPhotoAlbums.Append( 456 ); defaultPhotoAlbums.Append( 789 );
// setting this class as the observer for the fast harvesting calls iHClient.SetObserver(this);
// issu new harvesting request and requesting location data to be harvested iHClient.HarvestFile( KNewFile, defaultPhotoAlbums, ETrue ); }
void CHarvestObserver::HarvestingComplete( TDesC& aURI, TInt aError ) { _LIT( KExpectedFile, "C:\\Data\\ThisIsANewFile1.jpg" );
// Checking if an error occurred and if this was the expected file if ((aError == KErrNone) && (aURI.CompareC(KExpectedFile) == 0)) { // do something } }
Public Member Functions | |
---|---|
void | HarvestingComplete ( TDesC &, TInt ) |
void | HarvestingComplete | ( | TDesC & | aURI, |
TInt | aError | |||
) | [pure virtual] |
Callback to inform when fast harvesting of a file is complete.
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.