xpcom/system/nsIGeolocationProvider.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #include "nsISupports.idl"
     9 interface nsIURI;
    10 interface nsIDOMWindow;
    11 interface nsIDOMElement;
    12 interface nsIDOMGeoPosition;
    13 interface nsIGeolocationPrompt;
    15 /**
    17  * Interface provides a way for a geolocation provider to
    18  * notify the system that a new location is available.
    19  */
    20 [scriptable, uuid(643dc5e9-b911-4b2c-8d44-603162696baf)]
    21 interface nsIGeolocationUpdate : nsISupports {
    23   /**
    24    * Notify the geolocation service that a new geolocation
    25    * has been discovered.
    26    * This must be called on the main thread
    27    */
    28   void update(in nsIDOMGeoPosition position);
    30   /**
    31    * Notify the geolocation service that the location has
    32    * potentially changed, and thus a new position is in the
    33    * process of being acquired.
    34    */
    35   void locationUpdatePending();
    37   /**
    38    * Notify the geolocation service of an error.
    39    * This must be called on the main thread.
    40    * The parameter refers to one of the constants in the
    41    * nsIDOMGeoPositionError interface.
    42    * Use this to report spurious errors coming from the
    43    * provider; for errors occurring inside the methods in
    44    * the nsIGeolocationProvider interface, just use the return
    45    * value.
    46    */
    47   void notifyError(in unsigned short error);
    48 };
    51 /**
    52  * Interface provides location information to the nsGeolocator
    53  * via the nsIDOMGeolocationCallback interface.  After
    54  * startup is called, any geo location change should call
    55  * callback.update().
    56  */
    57 [scriptable, uuid(AC4A133B-9F92-4F7C-B369-D40CB6B17650)]
    58 interface nsIGeolocationProvider : nsISupports {
    60   /**
    61    * Start up the provider.  This is called before any other
    62    * method.  may be called multiple times.
    63    */
    64   void startup();
    66   /**
    67    * watch
    68    * When a location change is observed, notify the callback.
    69    */
    70   void watch(in nsIGeolocationUpdate callback);
    72   /**
    73    * shutdown
    74    * Shuts down the location device.
    75    */
    76   void shutdown();
    78   /**
    79    * hint to provide to use any amount of power to provide a better result
    80    */
    81   void setHighAccuracy(in boolean enable);
    83 };
    85 %{C++
    86 /*  
    87     This must be implemented by geolocation providers.  It
    88     must support nsIGeolocationProvider.
    89 */
    90 #define NS_GEOLOCATION_PROVIDER_CONTRACTID "@mozilla.org/geolocation/provider;1"
    91 %}

mercurial