2012-05-21 15:12:37 +04: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-16 03:37:48 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIURI;
|
|
|
|
interface nsIDOMWindow;
|
2010-05-13 21:44:51 +04:00
|
|
|
interface nsIDOMElement;
|
2008-08-14 20:35:49 +04:00
|
|
|
interface nsIDOMGeoPosition;
|
2008-07-16 03:37:48 +04: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 20:35:49 +04:00
|
|
|
void update(in nsIDOMGeoPosition position);
|
2008-07-16 03:37:48 +04: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 20:47:33 +04:00
|
|
|
* callback.update().
|
2008-07-16 03:37:48 +04:00
|
|
|
*/
|
2012-03-21 21:52:35 +04:00
|
|
|
[scriptable, uuid(483BE98B-F747-490A-8AF1-53146D2D5373)]
|
2008-07-16 03:37:48 +04: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 20:41:57 +03:00
|
|
|
* Shuts down the location device.
|
2008-07-16 03:37:48 +04:00
|
|
|
*/
|
|
|
|
void shutdown();
|
2012-03-21 21:52:35 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* hint to provide to use any amount of power to provide a better result
|
|
|
|
*/
|
|
|
|
void setHighAccuracy(in boolean enable);
|
|
|
|
|
2008-07-16 03:37:48 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
%{C++
|
2008-10-23 22:01:32 +04:00
|
|
|
/*
|
|
|
|
This must be implemented by geolocation providers. It
|
|
|
|
must support nsIGeolocationProvider.
|
|
|
|
*/
|
2008-07-16 03:37:48 +04:00
|
|
|
#define NS_GEOLOCATION_PROVIDER_CONTRACTID "@mozilla.org/geolocation/provider;1"
|
|
|
|
%}
|