plugin/poi/landmarks/provider/inc/Remote.h
changeset 0 c316ab048e9d
equal deleted inserted replaced
-1:000000000000 0:c316ab048e9d
       
     1 /*
       
     2  * Name        : Remote.h
       
     3  * Description : 
       
     4  * Project     : This file is part of OpenMAR, an Open Mobile Augmented Reality browser
       
     5  * Website     : http://OpenMAR.org
       
     6  *
       
     7  * Copyright (c) 2010 David Caabeiro
       
     8  *
       
     9  * All rights reserved. This program and the accompanying materials are made available 
       
    10  * under the terms of the Eclipse Public License v1.0 which accompanies this 
       
    11  * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
       
    12  *
       
    13  */
       
    14 
       
    15 #ifndef REMOTE_H_
       
    16 #define REMOTE_H_
       
    17 
       
    18 #include <e32base.h>
       
    19 #include <EPos_CPosLandmark.h>
       
    20 #include <EPos_CPosLandmarkParser.h>
       
    21 #include <http/MHttpTransactionCallback.h>
       
    22 
       
    23 #include "Loader.h"
       
    24 
       
    25 class TCoordinate;
       
    26 class CHttpClient;
       
    27 
       
    28 /**
       
    29  * @brief Retrieves landmarks from a remote database
       
    30  */
       
    31 
       
    32 class CRemoteLoader : public CActive, public MLandmarkLoader, public MHTTPTransactionCallback
       
    33 {
       
    34 public:
       
    35     static CRemoteLoader* NewL(MLandmarkLoaderObserver& aObserver, const TDesC8& aProviderUri);
       
    36     ~CRemoteLoader();
       
    37 
       
    38 protected:
       
    39     CRemoteLoader(MLandmarkLoaderObserver& aObserver);
       
    40     void ConstructL(const TDesC8& aProviderUri);
       
    41 
       
    42     void RunL();
       
    43     void DoCancel();
       
    44 
       
    45 public:
       
    46     // From MLandmarkLoader
       
    47     void RequestL(const TCoordinate& aCoordinate, TReal32 aRadius);
       
    48 
       
    49 protected:
       
    50     // From MHTTPTransactionCallback
       
    51     void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent);
       
    52     TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent);
       
    53 
       
    54 private:
       
    55     MLandmarkLoaderObserver& iObserver;
       
    56 
       
    57     HBufC8* iBaseUri;
       
    58     CHttpClient* iClient;
       
    59     RBuf8 iBuffer;
       
    60 
       
    61     CPosLandmarkParser* iParser;
       
    62     CPosLmOperation* iOperation;
       
    63     TReal32 iProgress;
       
    64 };
       
    65 
       
    66 #endif  // REMOTE_H_