All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WindowsLocationService.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include <LocationApi.h>
6 #include "ILocationService.h"
7 #include "Types.h"
8 #include "VectorMath.h"
9 #include "InteriorId.h"
10 
11 struct WindowsNativeState;
12 
13 namespace Eegeo
14 {
15  namespace Windows
16  {
18  {
19  double latRadians;
20  double lonRadians;
21  double altitudeMeters;
22  double horizontalAccuracyMeters;
23  double headingDegrees;
24  };
25 
27  {
28  private:
29  LocationOverride* m_pLocationOverride;
30  double latRadians;
31  double lonRadians;
32  double altitudeMeters;
33  double horizontalAccuracyMeters;
34  double headingDegrees;
35  bool hasLocation;
36  bool hasAccuracy;
37  bool hasAltitude;
38  bool hasHeading;
39  bool isAuthorized;
40  bool hasPermissionBeenDenied;
41 
42  WindowsNativeState* pState;
43 
44  void UpdateLatLong();
45  void UpdateHeading();
46 
47  CComPtr<ILocation> m_pLocationService;
48 
49  public:
50  WindowsLocationService(WindowsNativeState* pState, LocationOverride* locationOverride = NULL);
52 
53  void StopListening();
54 
55  const bool GetIsAuthorized() const { return isAuthorized; }
56  bool IsIndoors();
57  Resources::Interiors::InteriorId GetInteriorId();
58  bool GetLocation(Eegeo::Space::LatLong& latlong);
59  bool GetAltitude(double& altitude);
60  bool GetFloorIndex(int& floorIndex);
61  bool GetHorizontalAccuracy(double& accuracy);
62  bool GetHeadingDegrees(double& headingDegrees);
63  };
64  }
65 }