xpcom/system/nsIGeolocationProvider.idl
author Josh Matthews <josh@joshmatthews.net>
Wed, 28 Nov 2012 11:20:20 -0500
changeset 119942 7c45205a61a0d6681f5302d4670bc74d9bed6636
parent 96742 f4157e8c410708d76703f19e4dfb61859bfe32d8
child 119947 9659f41bda78ea565addb4ca85c9e210a02444ab
permissions -rw-r--r--
Bug 769285 - Use separate access tokens for private and public geolocation requests. r=dougt

/* 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/. */



#include "nsISupports.idl"

interface nsIURI;
interface nsIDOMWindow;
interface nsIDOMElement;
interface nsIDOMGeoPosition;
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
   */
  void update(in nsIDOMGeoPosition position);
};


/**
 * Interface provides location information to the nsGeolocator
 * via the nsIDOMGeolocationCallback interface.  After
 * startup is called, any geo location change should call
 * callback.update().
 */
[scriptable, uuid(d32b87b3-fe96-4f42-81ab-2f39f7ec43ff)]
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. The privacy
   * argument informs the provider whether the initiating request came from
   * a private context; it is up to the provider to use that information
   * in a sensible manner.
   */
  void watch(in nsIGeolocationUpdate callback, in boolean requestPrivate);

  /**
   * shutdown
   * Shuts down the location device.
   */
  void shutdown();

  /**
   * hint to provide to use any amount of power to provide a better result
   */
  void setHighAccuracy(in boolean enable);

};

%{C++
/*  
    This must be implemented by geolocation providers.  It
    must support nsIGeolocationProvider.
*/
#define NS_GEOLOCATION_PROVIDER_CONTRACTID "@mozilla.org/geolocation/provider;1"
%}