2010-07-23 14:35:51 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2012-05-21 04:12:37 -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/. */
|
2010-07-23 14:35:51 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIDOMWindow;
|
2010-09-05 11:00:05 -07:00
|
|
|
interface nsIDOMFile;
|
2010-07-23 14:35:51 -07:00
|
|
|
|
|
|
|
[scriptable, uuid(a4e2b2de-5712-4f80-aabb-7de3a747f227)]
|
|
|
|
interface nsICapturePicker : nsISupports
|
|
|
|
{
|
|
|
|
const long MODE_STILL = 1; // Capture a still (image)
|
|
|
|
const long MODE_AUDIO_CLIP = 2; // Capture a clip of audio
|
|
|
|
const long MODE_VIDEO_CLIP = 3; // Capture a clip of video
|
|
|
|
const long MODE_VIDEO_NO_SOUND_CLIP = 4; // Capture a clip of video (no sound)
|
|
|
|
|
|
|
|
// Return codes from the dialog
|
|
|
|
const long RETURN_OK = 0;
|
|
|
|
const long RETURN_CANCEL = 1;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize the camera picker widget. The camera picker is not valid until this
|
|
|
|
* method is called.
|
|
|
|
*
|
|
|
|
* @param parent nsIDOMWindow parent. This dialog will be dependent
|
|
|
|
* on this parent. This must not be null.
|
|
|
|
* @param title The title for the file widget
|
|
|
|
* @param flags Mode and type flags for what to capture
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void init(in nsIDOMWindow parent, in AString title, in unsigned long mode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show file dialog. The dialog is displayed modally.
|
|
|
|
*
|
|
|
|
* @return returnOK if the user captures the requested content, returnCancel if
|
|
|
|
* the user cancels the capture process
|
|
|
|
*/
|
|
|
|
unsigned long show();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine if the given mode might be available. Consumers should take a
|
|
|
|
* true value to be a hint of what might be available, not a guarantee.
|
|
|
|
*
|
|
|
|
* @param mode Mode to examine
|
|
|
|
*
|
|
|
|
* @return false if the requested mode can definitely not be captured,
|
|
|
|
* true otherwise.
|
|
|
|
*/
|
|
|
|
boolean modeMayBeAvailable(in unsigned long mode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the captured image/video/audio. This may be a data URI, file URI,
|
2012-01-12 02:36:03 -08:00
|
|
|
* or a blob reference URI.
|
2010-07-23 14:35:51 -07:00
|
|
|
*/
|
2010-09-05 11:00:05 -07:00
|
|
|
readonly attribute nsIDOMFile file;
|
2010-07-23 14:35:51 -07:00
|
|
|
|
|
|
|
// The MIME type of the captured content. Cannot be set after calling show()
|
|
|
|
attribute AString type;
|
|
|
|
};
|