2013-05-17 18:48:25 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2013-05-09 23:25:25 -07:00
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2013-05-17 18:48:25 -07: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/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
dictionary CameraPictureOptions {
|
|
|
|
|
|
|
|
/* an object with a combination of 'height' and 'width' properties
|
|
|
|
chosen from nsICameraCapabilities.pictureSizes */
|
|
|
|
// XXXbz this should be a CameraSize dictionary, but we don't have that yet.
|
|
|
|
any pictureSize = null;
|
|
|
|
|
|
|
|
/* one of the file formats chosen from
|
|
|
|
nsICameraCapabilities.fileFormats */
|
|
|
|
DOMString fileFormat = "";
|
|
|
|
|
|
|
|
/* the rotation of the image in degrees, from 0 to 270 in
|
|
|
|
steps of 90; this doesn't affect the image, only the
|
|
|
|
rotation recorded in the image header.*/
|
|
|
|
long rotation = 0;
|
|
|
|
|
|
|
|
/* an object containing any or all of 'latitude', 'longitude',
|
|
|
|
'altitude', and 'timestamp', used to record when and where
|
|
|
|
the image was taken. e.g.
|
|
|
|
{
|
|
|
|
latitude: 43.647118,
|
|
|
|
longitude: -79.3943,
|
|
|
|
altitude: 500
|
|
|
|
// timestamp not specified, in this case, and
|
|
|
|
// won't be included in the image header
|
|
|
|
}
|
|
|
|
|
|
|
|
can be null in the case where position information isn't
|
|
|
|
available/desired.
|
|
|
|
|
|
|
|
'altitude' is in metres; 'timestamp' is UTC, in seconds from
|
|
|
|
January 1, 1970.
|
|
|
|
*/
|
|
|
|
any position = null;
|
|
|
|
|
|
|
|
/* the number of seconds from January 1, 1970 UTC. This can be
|
|
|
|
different from the positional timestamp (above). */
|
|
|
|
// XXXbz this should really accept a date too, no?
|
|
|
|
long long dateTime = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
// If we start using CameraPictureOptions here, remove it from DummyBinding.
|
2013-05-09 23:25:25 -07:00
|
|
|
|
|
|
|
interface GetCameraCallback;
|
|
|
|
interface CameraErrorCallback;
|
|
|
|
|
2013-05-15 04:07:08 -07:00
|
|
|
/* Select a camera to use. */
|
|
|
|
dictionary CameraSelector {
|
|
|
|
DOMString camera = "back";
|
|
|
|
};
|
|
|
|
|
2013-05-09 23:25:25 -07:00
|
|
|
interface CameraManager {
|
2013-05-14 03:59:11 -07:00
|
|
|
/* get a camera instance; options will be used to specify which
|
|
|
|
camera to get from the list returned by getListOfCameras(), e.g.:
|
|
|
|
{
|
|
|
|
camera: "front"
|
|
|
|
}
|
|
|
|
*/
|
2013-05-09 23:25:25 -07:00
|
|
|
[Throws]
|
2013-05-15 04:07:08 -07:00
|
|
|
void getCamera(CameraSelector options, GetCameraCallback callback,
|
2013-05-09 23:25:25 -07:00
|
|
|
optional CameraErrorCallback errorCallback);
|
2013-05-14 03:59:11 -07:00
|
|
|
|
|
|
|
/* return an array of camera identifiers, e.g.
|
|
|
|
[ "front", "back" ]
|
|
|
|
*/
|
2013-05-09 23:25:25 -07:00
|
|
|
[Throws]
|
|
|
|
sequence<DOMString> getListOfCameras();
|
|
|
|
};
|