2012-05-21 04:12:37 -07: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 16:37:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIURI;
|
|
|
|
interface nsIDOMWindow;
|
2010-05-13 10:44:51 -07:00
|
|
|
interface nsIDOMElement;
|
2008-08-14 09:35:49 -07:00
|
|
|
interface nsIDOMGeoPosition;
|
2008-07-15 16:37:48 -07:00
|
|
|
interface nsIGeolocationPrompt;
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Interface provides a way for a geolocation provider to
|
|
|
|
* notify the system that a new location is available.
|
|
|
|
*/
|
2013-06-19 12:08:11 -07:00
|
|
|
[scriptable, uuid(f00ff730-acff-4e8c-9991-0d4c84ba0e10)]
|
2008-07-15 16:37:48 -07: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 09:35:49 -07:00
|
|
|
void update(in nsIDOMGeoPosition position);
|
2013-06-19 12:08:11 -07: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 16:37:48 -07: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 09:47:33 -07:00
|
|
|
* callback.update().
|
2008-07-15 16:37:48 -07:00
|
|
|
*/
|
2013-06-12 19:20:07 -07:00
|
|
|
[scriptable, uuid(AC4A133B-9F92-4F7C-B369-D40CB6B17650)]
|
2008-07-15 16:37:48 -07: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-12 19:20:07 -07:00
|
|
|
* When a location change is observed, notify the callback.
|
2008-07-15 16:37:48 -07:00
|
|
|
*/
|
2013-06-12 19:20:07 -07:00
|
|
|
void watch(in nsIGeolocationUpdate callback);
|
2008-07-15 16:37:48 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* shutdown
|
2009-01-07 09:41:57 -08:00
|
|
|
* Shuts down the location device.
|
2008-07-15 16:37:48 -07:00
|
|
|
*/
|
|
|
|
void shutdown();
|
2012-03-21 10:52:35 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* hint to provide to use any amount of power to provide a better result
|
|
|
|
*/
|
|
|
|
void setHighAccuracy(in boolean enable);
|
|
|
|
|
2008-07-15 16:37:48 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
%{C++
|
2008-10-23 11:01:32 -07:00
|
|
|
/*
|
|
|
|
This must be implemented by geolocation providers. It
|
|
|
|
must support nsIGeolocationProvider.
|
|
|
|
*/
|
2008-07-15 16:37:48 -07:00
|
|
|
#define NS_GEOLOCATION_PROVIDER_CONTRACTID "@mozilla.org/geolocation/provider;1"
|
|
|
|
%}
|