diff options
Diffstat (limited to 'dom/interfaces/geolocation')
-rw-r--r-- | dom/interfaces/geolocation/moz.build | 17 | ||||
-rw-r--r-- | dom/interfaces/geolocation/nsIDOMGeoGeolocation.idl | 32 | ||||
-rw-r--r-- | dom/interfaces/geolocation/nsIDOMGeoPosition.idl | 14 | ||||
-rw-r--r-- | dom/interfaces/geolocation/nsIDOMGeoPositionCallback.idl | 13 | ||||
-rw-r--r-- | dom/interfaces/geolocation/nsIDOMGeoPositionCoords.idl | 18 | ||||
-rw-r--r-- | dom/interfaces/geolocation/nsIDOMGeoPositionError.idl | 24 | ||||
-rw-r--r-- | dom/interfaces/geolocation/nsIDOMGeoPositionErrorCallback.idl | 13 |
7 files changed, 131 insertions, 0 deletions
diff --git a/dom/interfaces/geolocation/moz.build b/dom/interfaces/geolocation/moz.build new file mode 100644 index 000000000..37d12600e --- /dev/null +++ b/dom/interfaces/geolocation/moz.build @@ -0,0 +1,17 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +XPIDL_SOURCES += [ + 'nsIDOMGeoGeolocation.idl', + 'nsIDOMGeoPosition.idl', + 'nsIDOMGeoPositionCallback.idl', + 'nsIDOMGeoPositionCoords.idl', + 'nsIDOMGeoPositionError.idl', + 'nsIDOMGeoPositionErrorCallback.idl', +] + +XPIDL_MODULE = 'dom_geolocation' + diff --git a/dom/interfaces/geolocation/nsIDOMGeoGeolocation.idl b/dom/interfaces/geolocation/nsIDOMGeoGeolocation.idl new file mode 100644 index 000000000..1b54b6e2f --- /dev/null +++ b/dom/interfaces/geolocation/nsIDOMGeoGeolocation.idl @@ -0,0 +1,32 @@ +/* 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 "domstubs.idl" + +interface nsIDOMGeoPositionCallback; +interface nsIDOMGeoPositionErrorCallback; + +%{C++ +namespace mozilla { +namespace dom { +struct PositionOptions; +} // namespace dom +} // namespace mozilla + +#include "mozilla/UniquePtr.h" +%} + +native PositionOptionsRef(mozilla::UniquePtr<mozilla::dom::PositionOptions>&&); + +[builtinclass, uuid(9142ab45-0ab5-418c-9bab-338a6d271d4f)] +interface nsIDOMGeoGeolocation : nsISupports +{ + int32_t watchPosition(in nsIDOMGeoPositionCallback callback, + in nsIDOMGeoPositionErrorCallback errorCallback, + in PositionOptionsRef options); + void getCurrentPosition(in nsIDOMGeoPositionCallback callback, + in nsIDOMGeoPositionErrorCallback errorCallback, + in PositionOptionsRef options); + void clearWatch(in long watchId); +}; diff --git a/dom/interfaces/geolocation/nsIDOMGeoPosition.idl b/dom/interfaces/geolocation/nsIDOMGeoPosition.idl new file mode 100644 index 000000000..621df8cbd --- /dev/null +++ b/dom/interfaces/geolocation/nsIDOMGeoPosition.idl @@ -0,0 +1,14 @@ +/* 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 "domstubs.idl" +#include "nsIDOMGeoPositionCoords.idl" + +[scriptable, uuid(dd9f7e81-0f74-4fb5-b361-37019bf60c3f)] +interface nsIDOMGeoPosition : nsISupports +{ + readonly attribute DOMTimeStamp timestamp; + readonly attribute nsIDOMGeoPositionCoords coords; +}; diff --git a/dom/interfaces/geolocation/nsIDOMGeoPositionCallback.idl b/dom/interfaces/geolocation/nsIDOMGeoPositionCallback.idl new file mode 100644 index 000000000..9abb6b793 --- /dev/null +++ b/dom/interfaces/geolocation/nsIDOMGeoPositionCallback.idl @@ -0,0 +1,13 @@ +/* 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 "domstubs.idl" + +interface nsIDOMGeoPosition; + +[scriptable, function, uuid(527E8B53-6F29-4B6A-8D04-5C1666A4C4C1)] +interface nsIDOMGeoPositionCallback : nsISupports { + void handleEvent(in nsIDOMGeoPosition position); +}; diff --git a/dom/interfaces/geolocation/nsIDOMGeoPositionCoords.idl b/dom/interfaces/geolocation/nsIDOMGeoPositionCoords.idl new file mode 100644 index 000000000..a25fb9822 --- /dev/null +++ b/dom/interfaces/geolocation/nsIDOMGeoPositionCoords.idl @@ -0,0 +1,18 @@ +/* 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 "domstubs.idl" + +[scriptable, uuid(B31702D0-6DAC-4FA0-B93B-F043E71C8F9A)] +interface nsIDOMGeoPositionCoords : nsISupports +{ + readonly attribute double latitude; + readonly attribute double longitude; + readonly attribute double altitude; + readonly attribute double accuracy; + readonly attribute double altitudeAccuracy; + readonly attribute double heading; + readonly attribute double speed; +}; diff --git a/dom/interfaces/geolocation/nsIDOMGeoPositionError.idl b/dom/interfaces/geolocation/nsIDOMGeoPositionError.idl new file mode 100644 index 000000000..720836a92 --- /dev/null +++ b/dom/interfaces/geolocation/nsIDOMGeoPositionError.idl @@ -0,0 +1,24 @@ +/* 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 "domstubs.idl" + +// undef the GetMessage macro defined in winuser.h from the MS Platform SDK +%{C++ +#ifdef GetMessage +#undef GetMessage +#endif +%} + +[uuid(85255CC3-07BA-49FD-BC9B-18D2963DAF7F)] +interface nsIDOMGeoPositionError : nsISupports +{ + const unsigned short PERMISSION_DENIED = 1; + const unsigned short POSITION_UNAVAILABLE = 2; + const unsigned short TIMEOUT = 3; + + readonly attribute short code; + readonly attribute AString message; +}; diff --git a/dom/interfaces/geolocation/nsIDOMGeoPositionErrorCallback.idl b/dom/interfaces/geolocation/nsIDOMGeoPositionErrorCallback.idl new file mode 100644 index 000000000..e2b707d8a --- /dev/null +++ b/dom/interfaces/geolocation/nsIDOMGeoPositionErrorCallback.idl @@ -0,0 +1,13 @@ +/* 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 "domstubs.idl" + +interface nsIDOMGeoPositionError; + +[scriptable, function, uuid(7D9B09D9-4843-43EB-A7A7-67F7DDA6B3C4)] +interface nsIDOMGeoPositionErrorCallback : nsISupports { + void handleEvent(in nsIDOMGeoPositionError positionError); +}; |