toolkit/components/autocomplete/nsIAutoCompleteController.idl

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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
michael@0 7 interface nsIAutoCompleteInput;
michael@0 8
michael@0 9 [scriptable, uuid(ff9f8465-204a-47a6-b3c9-0628b3856684)]
michael@0 10 interface nsIAutoCompleteController : nsISupports
michael@0 11 {
michael@0 12 /*
michael@0 13 * Possible values for the searchStatus attribute
michael@0 14 */
michael@0 15 const unsigned short STATUS_NONE = 1;
michael@0 16 const unsigned short STATUS_SEARCHING = 2;
michael@0 17 const unsigned short STATUS_COMPLETE_NO_MATCH = 3;
michael@0 18 const unsigned short STATUS_COMPLETE_MATCH = 4;
michael@0 19
michael@0 20 /*
michael@0 21 * The input widget that is currently being controlled.
michael@0 22 */
michael@0 23 attribute nsIAutoCompleteInput input;
michael@0 24
michael@0 25 /*
michael@0 26 * State which indicates the status of possible ongoing searches
michael@0 27 */
michael@0 28 readonly attribute unsigned short searchStatus;
michael@0 29
michael@0 30 /*
michael@0 31 * The number of matches
michael@0 32 */
michael@0 33 readonly attribute unsigned long matchCount;
michael@0 34
michael@0 35 /*
michael@0 36 * Start a search on a string, assuming the input property is already set.
michael@0 37 */
michael@0 38 void startSearch(in AString searchString);
michael@0 39
michael@0 40 /*
michael@0 41 * Stop all asynchronous searches
michael@0 42 */
michael@0 43 void stopSearch();
michael@0 44
michael@0 45 /*
michael@0 46 * Notify the controller that the user has changed text in the textbox.
michael@0 47 * This includes all means of changing the text value, including typing a
michael@0 48 * character, backspacing, deleting, pasting, committing composition or
michael@0 49 * canceling composition.
michael@0 50 *
michael@0 51 * NOTE: handleText() must be called after composition actually ends, even if
michael@0 52 * the composition is canceled and the textbox value isn't changed.
michael@0 53 * Then, implementation of handleText() can access the editor when
michael@0 54 * it's not in composing mode. DOM compositionend event is not good
michael@0 55 * timing for calling handleText(). DOM input event immediately after
michael@0 56 * DOM compositionend event is the best timing to call this.
michael@0 57 */
michael@0 58 void handleText();
michael@0 59
michael@0 60 /*
michael@0 61 * Notify the controller that the user wishes to enter the current text. If
michael@0 62 * aIsPopupSelection is true, then a selection was made from the popup, so
michael@0 63 * fill this value into the input field before continuing. If false, just
michael@0 64 * use the current value of the input field.
michael@0 65 *
michael@0 66 * @return True if the controller wishes to prevent event propagation and default event
michael@0 67 */
michael@0 68 boolean handleEnter(in boolean aIsPopupSelection);
michael@0 69
michael@0 70 /*
michael@0 71 * Notify the controller that the user wishes to revert autocomplete
michael@0 72 *
michael@0 73 * @return True if the controller wishes to prevent event propagation and default event
michael@0 74 */
michael@0 75 boolean handleEscape();
michael@0 76
michael@0 77 /*
michael@0 78 * Notify the controller that the user wishes to start composition
michael@0 79 *
michael@0 80 * NOTE: nsIAutoCompleteController implementation expects that this is called
michael@0 81 * by DOM compositionstart handler.
michael@0 82 */
michael@0 83 void handleStartComposition();
michael@0 84
michael@0 85 /*
michael@0 86 * Notify the controller that the user wishes to end composition
michael@0 87 *
michael@0 88 * NOTE: nsIAutoCompleteController implementation expects that this is called
michael@0 89 * by DOM compositionend handler.
michael@0 90 */
michael@0 91 void handleEndComposition();
michael@0 92
michael@0 93 /*
michael@0 94 * Handle tab. Just closes up.
michael@0 95 */
michael@0 96 void handleTab();
michael@0 97
michael@0 98 /*
michael@0 99 * Notify the controller of the following key navigation events:
michael@0 100 * up, down, left, right, page up, page down
michael@0 101 *
michael@0 102 * @return True if the controller wishes to prevent event propagation and default event
michael@0 103 */
michael@0 104 boolean handleKeyNavigation(in unsigned long key);
michael@0 105
michael@0 106 /*
michael@0 107 * Notify the controller that the user chose to delete the current
michael@0 108 * auto-complete result.
michael@0 109 */
michael@0 110 boolean handleDelete();
michael@0 111
michael@0 112 /*
michael@0 113 * Get the value of the result at a given index in the last completed search
michael@0 114 */
michael@0 115 AString getValueAt(in long index);
michael@0 116
michael@0 117 /*
michael@0 118 * Get the label of the result at a given index in the last completed search
michael@0 119 */
michael@0 120 AString getLabelAt(in long index);
michael@0 121
michael@0 122 /*
michael@0 123 * Get the comment of the result at a given index in the last completed search
michael@0 124 */
michael@0 125 AString getCommentAt(in long index);
michael@0 126
michael@0 127 /*
michael@0 128 * Get the style hint for the result at a given index in the last completed search
michael@0 129 */
michael@0 130 AString getStyleAt(in long index);
michael@0 131
michael@0 132 /*
michael@0 133 * Get the url of the image of the result at a given index in the last completed search
michael@0 134 */
michael@0 135 AString getImageAt(in long index);
michael@0 136
michael@0 137 /*
michael@0 138 * For the last completed search, get the final value that should be completed
michael@0 139 * when the user confirms the match at the given index
michael@0 140 */
michael@0 141 AString getFinalCompleteValueAt(in long index);
michael@0 142
michael@0 143 /*
michael@0 144 * Get / set the current search string. Note, setting will not start searching
michael@0 145 */
michael@0 146 attribute AString searchString;
michael@0 147 };

mercurial