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"
10 interface nsIDOMGeoPosition
;
11 interface nsIGeolocationPrompt
;
15 * Interface provides a way for a geolocation provider to
16 * notify the system that a new location is available.
18 [scriptable
, uuid(643dc5e9
-b911
-4b2c
-8d44
-603162696baf
)]
19 interface nsIGeolocationUpdate
: nsISupports
{
22 * Notify the geolocation service that a new geolocation
23 * has been discovered.
24 * This must be called on the main thread
26 void update
(in nsIDOMGeoPosition position
);
28 * Notify the geolocation service of an error.
29 * This must be called on the main thread.
30 * The parameter refers to one of the constants in the
31 * nsIDOMGeoPositionError interface.
32 * Use this to report spurious errors coming from the
33 * provider; for errors occurring inside the methods in
34 * the nsIGeolocationProvider interface, just use the return
38 void notifyError
(in unsigned short error
);
43 * Interface provides location information to the nsGeolocator
44 * via the nsIDOMGeolocationCallback interface. After
45 * startup is called, any geo location change should call
48 [scriptable
, uuid(AC4A133B
-9F92
-4F7C
-B369
-D40CB6B17650
)]
49 interface nsIGeolocationProvider
: nsISupports
{
52 * Start up the provider. This is called before any other
53 * method. may be called multiple times.
59 * When a location change is observed, notify the callback.
61 void watch
(in nsIGeolocationUpdate
callback);
65 * Shuts down the location device.
70 * hint to provide to use any amount of power to provide a better result
72 void setHighAccuracy
(in boolean enable
);
78 This must be implemented by geolocation providers. It
79 must support nsIGeolocationProvider.
81 #define NS_GEOLOCATION_PROVIDER_CONTRACTID
"@mozilla.org/geolocation/provider;1"