2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2008-07-15 23:37:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIURI;
|
|
|
|
interface nsIDOMWindow;
|
2010-05-13 17:44:51 +00:00
|
|
|
interface nsIDOMElement;
|
2008-08-14 16:35:49 +00:00
|
|
|
interface nsIDOMGeoPosition;
|
2008-07-15 23:37:48 +00:00
|
|
|
interface nsIGeolocationPrompt;
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Interface provides a way for a geolocation provider to
|
|
|
|
* notify the system that a new location is available.
|
|
|
|
*/
|
2014-01-08 21:04:37 +00:00
|
|
|
[scriptable, uuid(643dc5e9-b911-4b2c-8d44-603162696baf)]
|
2008-07-15 23:37:48 +00:00
|
|
|
interface nsIGeolocationUpdate : nsISupports {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify the geolocation service that a new geolocation
|
|
|
|
* has been discovered.
|
|
|
|
* This must be called on the main thread
|
|
|
|
*/
|
2008-08-14 16:35:49 +00:00
|
|
|
void update(in nsIDOMGeoPosition position);
|
2013-06-19 19:08:11 +00:00
|
|
|
|
2014-01-08 21:04:37 +00:00
|
|
|
/**
|
|
|
|
* Notify the geolocation service that the location has
|
|
|
|
* potentially changed, and thus a new position is in the
|
|
|
|
* process of being acquired.
|
|
|
|
*/
|
|
|
|
void locationUpdatePending();
|
|
|
|
|
2013-06-19 19:08:11 +00:00
|
|
|
/**
|
|
|
|
* Notify the geolocation service of an error.
|
|
|
|
* This must be called on the main thread.
|
|
|
|
* The parameter refers to one of the constants in the
|
|
|
|
* nsIDOMGeoPositionError interface.
|
|
|
|
* Use this to report spurious errors coming from the
|
|
|
|
* provider; for errors occurring inside the methods in
|
|
|
|
* the nsIGeolocationProvider interface, just use the return
|
|
|
|
* value.
|
|
|
|
*/
|
|
|
|
void notifyError(in unsigned short error);
|
2008-07-15 23:37:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface provides location information to the nsGeolocator
|
|
|
|
* via the nsIDOMGeolocationCallback interface. After
|
|
|
|
* startup is called, any geo location change should call
|
2009-09-02 16:47:33 +00:00
|
|
|
* callback.update().
|
2008-07-15 23:37:48 +00:00
|
|
|
*/
|
2013-06-13 02:20:07 +00:00
|
|
|
[scriptable, uuid(AC4A133B-9F92-4F7C-B369-D40CB6B17650)]
|
2008-07-15 23:37:48 +00:00
|
|
|
interface nsIGeolocationProvider : nsISupports {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start up the provider. This is called before any other
|
|
|
|
* method. may be called multiple times.
|
|
|
|
*/
|
|
|
|
void startup();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* watch
|
2013-06-13 02:20:07 +00:00
|
|
|
* When a location change is observed, notify the callback.
|
2008-07-15 23:37:48 +00:00
|
|
|
*/
|
2013-06-13 02:20:07 +00:00
|
|
|
void watch(in nsIGeolocationUpdate callback);
|
2008-07-15 23:37:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* shutdown
|
2009-01-07 17:41:57 +00:00
|
|
|
* Shuts down the location device.
|
2008-07-15 23:37:48 +00:00
|
|
|
*/
|
|
|
|
void shutdown();
|
2012-03-21 17:52:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* hint to provide to use any amount of power to provide a better result
|
|
|
|
*/
|
|
|
|
void setHighAccuracy(in boolean enable);
|
|
|
|
|
2008-07-15 23:37:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
%{C++
|
2008-10-23 18:01:32 +00:00
|
|
|
/*
|
|
|
|
This must be implemented by geolocation providers. It
|
|
|
|
must support nsIGeolocationProvider.
|
|
|
|
*/
|
2008-07-15 23:37:48 +00:00
|
|
|
#define NS_GEOLOCATION_PROVIDER_CONTRACTID "@mozilla.org/geolocation/provider;1"
|
|
|
|
%}
|