|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsCOMPtr.h" |
|
7 #include "nsIGeolocationProvider.h" |
|
8 |
|
9 /* |
|
10 * The CoreLocationObjects class contains the CoreLocation objects |
|
11 * we'll need. |
|
12 * |
|
13 * Declaring them directly in CoreLocationLocationProvider |
|
14 * would require Objective-C++ syntax, which would contaminate all |
|
15 * files that include this header and require them to be Objective-C++ |
|
16 * as well. |
|
17 * |
|
18 * The solution then is to forward-declare CoreLocationObjects here and |
|
19 * hold a pointer to it in CoreLocationLocationProvider, and only actually |
|
20 * define it in CoreLocationLocationProvider.mm, thus making it safe |
|
21 * for nsGeolocation.cpp, which is C++-only, to include this header. |
|
22 */ |
|
23 class CoreLocationObjects; |
|
24 |
|
25 class CoreLocationLocationProvider |
|
26 : public nsIGeolocationProvider |
|
27 { |
|
28 public: |
|
29 NS_DECL_ISUPPORTS |
|
30 NS_DECL_NSIGEOLOCATIONPROVIDER |
|
31 |
|
32 CoreLocationLocationProvider(); |
|
33 void NotifyError(uint16_t aErrorCode); |
|
34 void Update(nsIDOMGeoPosition* aSomewhere); |
|
35 private: |
|
36 virtual ~CoreLocationLocationProvider() {}; |
|
37 |
|
38 CoreLocationObjects* mCLObjects; |
|
39 nsCOMPtr<nsIGeolocationUpdate> mCallback; |
|
40 }; |