Bug 1837620 - Part 1: Remove baseline ICs that guard shapes when the shape becomes...
[gecko.git] / xpcom / system / nsIGeolocationProvider.idl
blobff2f5a500476fb07f24665bcbb595f5fe148a6c2
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 nsIDOMGeoPosition;
11 interface nsIGeolocationPrompt;
13 /**
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 {
21 /**
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);
27 /**
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
35 * value.
37 [can_run_script]
38 void notifyError(in unsigned short error);
42 /**
43 * Interface provides location information to the nsGeolocator
44 * via the nsIDOMGeolocationCallback interface. After
45 * startup is called, any geo location change should call
46 * callback.update().
48 [scriptable, uuid(AC4A133B-9F92-4F7C-B369-D40CB6B17650)]
49 interface nsIGeolocationProvider : nsISupports {
51 /**
52 * Start up the provider. This is called before any other
53 * method. may be called multiple times.
55 void startup();
57 /**
58 * watch
59 * When a location change is observed, notify the callback.
61 void watch(in nsIGeolocationUpdate callback);
63 /**
64 * shutdown
65 * Shuts down the location device.
67 void shutdown();
69 /**
70 * hint to provide to use any amount of power to provide a better result
72 void setHighAccuracy(in boolean enable);
76 %{C++
78 This must be implemented by geolocation providers. It
79 must support nsIGeolocationProvider.
81 #define NS_GEOLOCATION_PROVIDER_CONTRACTID "@mozilla.org/geolocation/provider;1"