toolkit/components/autocomplete/nsIAutoCompleteSimpleResult.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #include "nsISupports.idl"
michael@0 6 #include "nsIAutoCompleteResult.idl"
michael@0 7
michael@0 8 interface nsIAutoCompleteSimpleResultListener;
michael@0 9
michael@0 10 /**
michael@0 11 * This class implements nsIAutoCompleteResult and provides simple methods
michael@0 12 * for setting the value and result items. It can be used whenever some basic
michael@0 13 * auto complete results are needed that can be pre-generated and filled into
michael@0 14 * an array.
michael@0 15 */
michael@0 16
michael@0 17 [scriptable, uuid(fe8802f9-c2b7-4141-8e5b-280df3f62251)]
michael@0 18 interface nsIAutoCompleteSimpleResult : nsIAutoCompleteResult
michael@0 19 {
michael@0 20 /**
michael@0 21 * A writer for the readonly attribute 'searchString' which should contain
michael@0 22 * the string that the user typed.
michael@0 23 */
michael@0 24 void setSearchString(in AString aSearchString);
michael@0 25
michael@0 26 /**
michael@0 27 * A writer for the readonly attribute 'errorDescription'.
michael@0 28 */
michael@0 29 void setErrorDescription(in AString aErrorDescription);
michael@0 30
michael@0 31 /**
michael@0 32 * A writer for the readonly attribute 'defaultIndex' which should contain
michael@0 33 * the index of the list that will be selected by default (normally 0).
michael@0 34 */
michael@0 35 void setDefaultIndex(in long aDefaultIndex);
michael@0 36
michael@0 37 /**
michael@0 38 * A writer for the readonly attribute 'searchResult' which should contain
michael@0 39 * one of the constants nsIAutoCompleteResult.RESULT_* indicating the success
michael@0 40 * of the search.
michael@0 41 */
michael@0 42 void setSearchResult(in unsigned short aSearchResult);
michael@0 43
michael@0 44 /**
michael@0 45 * A writer for the readonly attribute 'typeAheadResult', typically set
michael@0 46 * because a result is only intended for type-ahead completion.
michael@0 47 */
michael@0 48 void setTypeAheadResult(in boolean aHidden);
michael@0 49
michael@0 50 /**
michael@0 51 * Appends a match consisting of the given value, comment, image, style and
michael@0 52 * the value to use for defaultIndex completion.
michael@0 53 * @param aValue
michael@0 54 * The value to autocomplete to
michael@0 55 * @param aComment
michael@0 56 * Comment shown in the autocomplete widget to describe this match
michael@0 57 * @param aImage
michael@0 58 * Image shown in the autocomplete widget for this match.
michael@0 59 * @param aStyle
michael@0 60 * Describes how to style the match in the autocomplete widget
michael@0 61 * @param aFinalCompleteValue
michael@0 62 * Value used when the user confirms selecting this match. If not
michael@0 63 * provided, aValue will be used.
michael@0 64 */
michael@0 65 void appendMatch(in AString aValue,
michael@0 66 in AString aComment,
michael@0 67 [optional] in AString aImage,
michael@0 68 [optional] in AString aStyle,
michael@0 69 [optional] in AString aFinalCompleteValue);
michael@0 70
michael@0 71 /**
michael@0 72 * Sets a listener for changes in the result.
michael@0 73 */
michael@0 74 void setListener(in nsIAutoCompleteSimpleResultListener aListener);
michael@0 75 };
michael@0 76
michael@0 77 [scriptable, uuid(004efdc5-1989-4874-8a7a-345bf2fa33af)]
michael@0 78 interface nsIAutoCompleteSimpleResultListener : nsISupports
michael@0 79 {
michael@0 80 /**
michael@0 81 * Dispatched after a value is removed from the result.
michael@0 82 * @param aResult
michael@0 83 * The result from which aValue has been removed.
michael@0 84 * @param aValue
michael@0 85 * The removed value.
michael@0 86 * @param aRemoveFromDb
michael@0 87 * Whether the value should be removed from persistent storage as well.
michael@0 88 */
michael@0 89 void onValueRemoved(in nsIAutoCompleteSimpleResult aResult, in AString aValue,
michael@0 90 in boolean aRemoveFromDb);
michael@0 91 };

mercurial