diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /widget/nsIColorPicker.idl | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'widget/nsIColorPicker.idl')
-rw-r--r-- | widget/nsIColorPicker.idl | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/widget/nsIColorPicker.idl b/widget/nsIColorPicker.idl new file mode 100644 index 000000000..24b128e1b --- /dev/null +++ b/widget/nsIColorPicker.idl @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * 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 "nsISupports.idl" + +interface mozIDOMWindowProxy; + +/** + * nsIColorPicker is representing colors as strings because the internal + * representation will depend on the underlying backend. + * The format of the colors taken in input and returned will always follow the + * format of the <input type='color'> value as described in the HTML + * specifications. + */ + +[scriptable, uuid(d2ce78d1-40b5-49d1-b66d-5801fcb9a385)] +interface nsIColorPickerShownCallback : nsISupports +{ + /** + * Callback called when the color picker requests a color update. + * This callback can not be called after done() was called. + * When this callback is used, the consumer can assume that the color value has + * changed. + * + * @param color The new selected color value following the format specifed on + * top of this file. + */ + void update(in AString color); + + /** + * Callback called when the color picker is dismissed. + * When this callback is used, the color might have changed or could stay the + * same. + * If the color has not changed, the color parameter will be the empty string. + * + * @param color The new selected color value following the format specifed on + * top of this file or the empty string. + */ + void done(in AString color); +}; + +[scriptable, uuid(de229d37-a8a6-46f1-969a-0c1de33d0ad7)] +interface nsIColorPicker : nsISupports +{ + /** + * Initialize the color picker widget. The color picker will not be shown until + * open() is called. + * If the backend doesn't support setting a title to the native color picker + * widget, the title parameter might be ignored. + * If the initialColor parameter does not follow the format specified on top of + * this file, the behavior will be unspecified. The initialColor could be the + * one used by the underlying backend or an arbitrary one. The backend could + * also assert. + * + * @param parent nsIDOMWindow parent. This dialog will be dependent + * on this parent. parent must be non-null. + * @param title The title for the color picker widget. + * @param initialColor The color to show when the widget is opened. The + * parameter has to follow the format specified on top + * of this file. + */ + void init(in mozIDOMWindowProxy parent, in AString title, in AString initialColor); + + /** + * Opens the color dialog asynchrounously. + * The results are provided via the callback object. + */ + void open(in nsIColorPickerShownCallback aColorPickerShownCallback); +}; |