plugin/poi/landmarks/overlay/inc/Position.h
changeset 0 c316ab048e9d
equal deleted inserted replaced
-1:000000000000 0:c316ab048e9d
       
     1 /*
       
     2  * Name        : Position.h
       
     3  * Description : Position helper class
       
     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 POSITION_H_
       
    16 #define POSITION_H_
       
    17 
       
    18 #include <e32base.h>
       
    19 #include <Lbs.h>
       
    20 #include <LbsPositionInfo.h>
       
    21 
       
    22 class MPositionObserver
       
    23 {
       
    24 public:
       
    25     virtual void PositionUpdateL(TInt aError, const TPosition& aPosition) = 0;
       
    26 };
       
    27 
       
    28 /**
       
    29  * @brief 
       
    30  * 
       
    31  */
       
    32 class CPosition : public CActive
       
    33 {
       
    34 public:
       
    35     static CPosition* NewL(MPositionObserver& aObserver);
       
    36     ~CPosition();
       
    37 
       
    38 protected:
       
    39     CPosition(MPositionObserver& aObserver);
       
    40     void ConstructL();
       
    41 
       
    42 public:
       
    43     void Request();
       
    44 
       
    45 protected:
       
    46     void RunL();
       
    47     void DoCancel();
       
    48     TInt RunError(TInt aError);
       
    49 
       
    50 private:
       
    51     MPositionObserver& iObserver;
       
    52 
       
    53     RPositionServer iServer;
       
    54     RPositioner iPositioner;
       
    55     TPositionInfo iPositionInfo;
       
    56 
       
    57     enum TState {
       
    58         EUnknown,
       
    59         ECache,
       
    60         EGps
       
    61     } iState;
       
    62 };
       
    63 
       
    64 #endif  // POSITION_H_