forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 2
/
nsIGeolocationProvider.idl
72 lines (57 loc) · 1.74 KB
/
nsIGeolocationProvider.idl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
interface nsIURI;
interface nsIDOMWindow;
interface nsIDOMElement;
interface nsIDOMGeoPosition;
interface nsIGeolocationPrompt;
/**
* Interface provides a way for a geolocation provider to
* notify the system that a new location is available.
*/
[scriptable, uuid(B89D7227-9F04-4236-A582-25A3F2779D72)]
interface nsIGeolocationUpdate : nsISupports {
/**
* Notify the geolocation service that a new geolocation
* has been discovered.
* This must be called on the main thread
*/
void update(in nsIDOMGeoPosition position);
};
/**
* Interface provides location information to the nsGeolocator
* via the nsIDOMGeolocationCallback interface. After
* startup is called, any geo location change should call
* callback.update().
*/
[scriptable, uuid(483BE98B-F747-490A-8AF1-53146D2D5373)]
interface nsIGeolocationProvider : nsISupports {
/**
* Start up the provider. This is called before any other
* method. may be called multiple times.
*/
void startup();
/**
* watch
* When a location change is observed, notify the callback
*/
void watch(in nsIGeolocationUpdate callback);
/**
* shutdown
* Shuts down the location device.
*/
void shutdown();
/**
* hint to provide to use any amount of power to provide a better result
*/
void setHighAccuracy(in boolean enable);
};
%{C++
/*
This must be implemented by geolocation providers. It
must support nsIGeolocationProvider.
*/
#define NS_GEOLOCATION_PROVIDER_CONTRACTID "@mozilla.org/geolocation/provider;1"
%}