Bumping manifests a=b2g-bump
[gecko.git] / xpcom / system / nsIGeolocationProvider.idl
blob482dec317537fb7958a41c84f749fed8de5095b9
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 interface nsIURI;
10 interface nsIDOMWindow;
11 interface nsIDOMElement;
12 interface nsIDOMGeoPosition;
13 interface nsIGeolocationPrompt;
15 /**
17 * Interface provides a way for a geolocation provider to
18 * notify the system that a new location is available.
20 [scriptable, uuid(643dc5e9-b911-4b2c-8d44-603162696baf)]
21 interface nsIGeolocationUpdate : nsISupports {
23 /**
24 * Notify the geolocation service that a new geolocation
25 * has been discovered.
26 * This must be called on the main thread
28 void update(in nsIDOMGeoPosition position);
30 /**
31 * Notify the geolocation service that the location has
32 * potentially changed, and thus a new position is in the
33 * process of being acquired.
35 void locationUpdatePending();
37 /**
38 * Notify the geolocation service of an error.
39 * This must be called on the main thread.
40 * The parameter refers to one of the constants in the
41 * nsIDOMGeoPositionError interface.
42 * Use this to report spurious errors coming from the
43 * provider; for errors occurring inside the methods in
44 * the nsIGeolocationProvider interface, just use the return
45 * value.
47 void notifyError(in unsigned short error);
51 /**
52 * Interface provides location information to the nsGeolocator
53 * via the nsIDOMGeolocationCallback interface. After
54 * startup is called, any geo location change should call
55 * callback.update().
57 [scriptable, uuid(AC4A133B-9F92-4F7C-B369-D40CB6B17650)]
58 interface nsIGeolocationProvider : nsISupports {
60 /**
61 * Start up the provider. This is called before any other
62 * method. may be called multiple times.
64 void startup();
66 /**
67 * watch
68 * When a location change is observed, notify the callback.
70 void watch(in nsIGeolocationUpdate callback);
72 /**
73 * shutdown
74 * Shuts down the location device.
76 void shutdown();
78 /**
79 * hint to provide to use any amount of power to provide a better result
81 void setHighAccuracy(in boolean enable);
85 %{C++
86 /*
87 This must be implemented by geolocation providers. It
88 must support nsIGeolocationProvider.
90 #define NS_GEOLOCATION_PROVIDER_CONTRACTID "@mozilla.org/geolocation/provider;1"