2012-02-06 22:48:50 -08: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/. */
|
|
|
|
|
|
|
|
#include "domstubs.idl"
|
|
|
|
|
|
|
|
[scriptable, uuid(3615a616-571d-4194-bf54-ccf546067b14)]
|
|
|
|
interface nsIB2GCameraContent : nsISupports
|
|
|
|
{
|
2012-06-06 05:19:33 -07:00
|
|
|
/* temporary solution, waiting for getUserMedia */
|
|
|
|
DOMString getCameraURI([optional] in jsval options);
|
2012-03-19 10:30:51 -07:00
|
|
|
};
|
|
|
|
|
2013-04-13 07:53:41 -07:00
|
|
|
[scriptable, uuid(40ad96b2-9efa-41fb-84c7-fbcec9b153f0)]
|
2012-03-19 10:30:51 -07:00
|
|
|
interface nsIB2GKeyboard : nsISupports
|
|
|
|
{
|
2012-06-06 05:19:33 -07:00
|
|
|
void sendKey(in long keyCode, in long charCode);
|
|
|
|
|
|
|
|
// Select the <select> option specified by index.
|
|
|
|
// If this method is called on a <select> that support multiple
|
|
|
|
// selection, then the option specified by index will be added to
|
|
|
|
// the selection.
|
|
|
|
// If this method is called for a select that does not support multiple
|
|
|
|
// selection the previous element will be unselected.
|
|
|
|
void setSelectedOption(in jsval index);
|
|
|
|
|
|
|
|
// Select the <select> options specified by indexes. All other options
|
|
|
|
// will be deselected.
|
|
|
|
// If this method is called for a <select> that does not support multiple
|
|
|
|
// selection, then the last index specified in indexes will be selected.
|
|
|
|
void setSelectedOptions(in jsval indexes);
|
|
|
|
|
2012-06-06 05:19:33 -07:00
|
|
|
// Set the value on the currently focused element. This has to be used
|
|
|
|
// for special situations where the value had to be chosen amongst a
|
|
|
|
// list (type=month) or a widget (type=date, time, etc.).
|
|
|
|
// If the value passed in parameter isn't valid (in the term of HTML5
|
2013-04-13 07:53:41 -07:00
|
|
|
// Forms Validation), the value will simply be ignored by the element.
|
2012-06-06 05:19:33 -07:00
|
|
|
void setValue(in jsval value);
|
|
|
|
|
2012-10-17 04:18:14 -07:00
|
|
|
void removeFocus();
|
|
|
|
|
2012-06-06 05:19:33 -07:00
|
|
|
attribute nsIDOMEventListener onfocuschange;
|
2013-03-15 05:28:51 -07:00
|
|
|
|
|
|
|
// Fires when user moves the cursor, changes the selection, or alters the
|
|
|
|
// composing text length
|
|
|
|
attribute nsIDOMEventListener onselectionchange;
|
|
|
|
|
|
|
|
// The start position of the selection.
|
|
|
|
readonly attribute long selectionStart;
|
|
|
|
|
|
|
|
// The stop position of the selection.
|
|
|
|
readonly attribute long selectionEnd;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set the selection range of the the editable text.
|
|
|
|
*
|
|
|
|
* @param start The beginning of the selected text.
|
|
|
|
* @param end The end of the selected text.
|
|
|
|
*
|
|
|
|
* Note that the start position should be less or equal to the end position.
|
|
|
|
* To move the cursor, set the start and end position to the same value.
|
|
|
|
*/
|
|
|
|
void setSelectionRange(in long start, in long end);
|
2013-04-13 07:53:41 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Replace text around the beginning of the current selection range of the
|
|
|
|
* editable text.
|
|
|
|
*
|
|
|
|
* @param text The string to be replaced with.
|
|
|
|
* @param beforeLength The number of characters to be deleted before the
|
|
|
|
* beginning of the current selection range. Defaults to 0.
|
|
|
|
* @param afterLength The number of characters to be deleted after the
|
|
|
|
* beginning of the current selection range. Defaults to 0.
|
|
|
|
*/
|
|
|
|
void replaceSurroundingText(in DOMString text,
|
|
|
|
[optional] in long beforeLength,
|
|
|
|
[optional] in long afterLength);
|
2012-02-06 22:48:50 -08:00
|
|
|
};
|