Blame xpcom/system/nsIGeolocationProvider.idl

Packit f0b94e
/* This Source Code Form is subject to the terms of the Mozilla Public
Packit f0b94e
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Packit f0b94e
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Packit f0b94e
Packit f0b94e
Packit f0b94e
Packit f0b94e
#include "nsISupports.idl"
Packit f0b94e
Packit f0b94e
interface nsIURI;
Packit f0b94e
interface nsIDOMWindow;
Packit f0b94e
interface nsIDOMElement;
Packit f0b94e
interface nsIDOMGeoPosition;
Packit f0b94e
interface nsIGeolocationPrompt;
Packit f0b94e
Packit f0b94e
/**
Packit f0b94e
Packit f0b94e
 * Interface provides a way for a geolocation provider to
Packit f0b94e
 * notify the system that a new location is available.
Packit f0b94e
 */
Packit f0b94e
[scriptable, uuid(643dc5e9-b911-4b2c-8d44-603162696baf)]
Packit f0b94e
interface nsIGeolocationUpdate : nsISupports {
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * Notify the geolocation service that a new geolocation
Packit f0b94e
   * has been discovered.
Packit f0b94e
   * This must be called on the main thread
Packit f0b94e
   */
Packit f0b94e
  void update(in nsIDOMGeoPosition position);
Packit f0b94e
  /**
Packit f0b94e
   * Notify the geolocation service of an error.
Packit f0b94e
   * This must be called on the main thread.
Packit f0b94e
   * The parameter refers to one of the constants in the
Packit f0b94e
   * nsIDOMGeoPositionError interface.
Packit f0b94e
   * Use this to report spurious errors coming from the
Packit f0b94e
   * provider; for errors occurring inside the methods in
Packit f0b94e
   * the nsIGeolocationProvider interface, just use the return
Packit f0b94e
   * value.
Packit f0b94e
   */
Packit f0b94e
  void notifyError(in unsigned short error);
Packit f0b94e
};
Packit f0b94e
Packit f0b94e
Packit f0b94e
/**
Packit f0b94e
 * Interface provides location information to the nsGeolocator
Packit f0b94e
 * via the nsIDOMGeolocationCallback interface.  After
Packit f0b94e
 * startup is called, any geo location change should call
Packit f0b94e
 * callback.update().
Packit f0b94e
 */
Packit f0b94e
[scriptable, uuid(AC4A133B-9F92-4F7C-B369-D40CB6B17650)]
Packit f0b94e
interface nsIGeolocationProvider : nsISupports {
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * Start up the provider.  This is called before any other
Packit f0b94e
   * method.  may be called multiple times.
Packit f0b94e
   */
Packit f0b94e
  void startup();
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * watch
Packit f0b94e
   * When a location change is observed, notify the callback.
Packit f0b94e
   */
Packit f0b94e
  void watch(in nsIGeolocationUpdate callback);
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * shutdown
Packit f0b94e
   * Shuts down the location device.
Packit f0b94e
   */
Packit f0b94e
  void shutdown();
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * hint to provide to use any amount of power to provide a better result
Packit f0b94e
   */
Packit f0b94e
  void setHighAccuracy(in boolean enable);
Packit f0b94e
Packit f0b94e
};
Packit f0b94e
Packit f0b94e
%{C++
Packit f0b94e
/*
Packit f0b94e
    This must be implemented by geolocation providers.  It
Packit f0b94e
    must support nsIGeolocationProvider.
Packit f0b94e
*/
Packit f0b94e
#define NS_GEOLOCATION_PROVIDER_CONTRACTID "@mozilla.org/geolocation/provider;1"
Packit f0b94e
%}