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.
|
|
|
|
*/
|
|
|
|
[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
|
|
|
|
*/
|
2008-08-14 09:35:49 -07:00
|
|
|
void update(in nsIDOMGeoPosition position);
|
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
|
|
|
*/
|
2012-03-21 10:52:35 -07:00
|
|
|
[scriptable, uuid(483BE98B-F747-490A-8AF1-53146D2D5373)]
|
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
|
|
|
|
* When a location change is observed, notify the callback
|
|
|
|
*/
|
|
|
|
void watch(in nsIGeolocationUpdate callback);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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"
|
|
|
|
%}
|