diff -r 000000000000 -r c316ab048e9d plugin/poi/landmarks/provider/inc/Remote.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugin/poi/landmarks/provider/inc/Remote.h Fri Jun 25 12:50:05 2010 +0200 @@ -0,0 +1,66 @@ +/* + * Name : Remote.h + * Description : + * Project : This file is part of OpenMAR, an Open Mobile Augmented Reality browser + * Website : http://OpenMAR.org + * + * Copyright (c) 2010 David Caabeiro + * + * All rights reserved. This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 which accompanies this + * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html + * + */ + +#ifndef REMOTE_H_ +#define REMOTE_H_ + +#include +#include +#include +#include + +#include "Loader.h" + +class TCoordinate; +class CHttpClient; + +/** + * @brief Retrieves landmarks from a remote database + */ + +class CRemoteLoader : public CActive, public MLandmarkLoader, public MHTTPTransactionCallback +{ +public: + static CRemoteLoader* NewL(MLandmarkLoaderObserver& aObserver, const TDesC8& aProviderUri); + ~CRemoteLoader(); + +protected: + CRemoteLoader(MLandmarkLoaderObserver& aObserver); + void ConstructL(const TDesC8& aProviderUri); + + void RunL(); + void DoCancel(); + +public: + // From MLandmarkLoader + void RequestL(const TCoordinate& aCoordinate, TReal32 aRadius); + +protected: + // From MHTTPTransactionCallback + void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent); + TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent); + +private: + MLandmarkLoaderObserver& iObserver; + + HBufC8* iBaseUri; + CHttpClient* iClient; + RBuf8 iBuffer; + + CPosLandmarkParser* iParser; + CPosLmOperation* iOperation; + TReal32 iProgress; +}; + +#endif // REMOTE_H_