|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #include "nsISupports.idl" |
|
6 #include "nsIAutoCompleteController.idl" |
|
7 |
|
8 interface nsIAutoCompletePopup; |
|
9 |
|
10 [scriptable, uuid(fadb2bb9-3e2e-4ca0-b0e0-0982b8dda9dc)] |
|
11 interface nsIAutoCompleteInput : nsISupports |
|
12 { |
|
13 /* |
|
14 * The result view that will be used to display results |
|
15 */ |
|
16 readonly attribute nsIAutoCompletePopup popup; |
|
17 |
|
18 /* |
|
19 * The controller. |
|
20 */ |
|
21 readonly attribute nsIAutoCompleteController controller; |
|
22 |
|
23 /* |
|
24 * Indicates if the popup is currently open |
|
25 */ |
|
26 attribute boolean popupOpen; |
|
27 |
|
28 /* |
|
29 * Option to disable autocomplete functionality |
|
30 */ |
|
31 attribute boolean disableAutoComplete; |
|
32 |
|
33 /* |
|
34 * If a search result has its defaultIndex set, this will optionally |
|
35 * try to complete the text in the textbox to the entire text of the |
|
36 * result at the default index as the user types |
|
37 */ |
|
38 attribute boolean completeDefaultIndex; |
|
39 |
|
40 /* |
|
41 * complete text in the textbox as the user selects from the dropdown |
|
42 * options if set to true |
|
43 */ |
|
44 attribute boolean completeSelectedIndex; |
|
45 |
|
46 /* |
|
47 * Option for completing to the default result whenever the user hits |
|
48 * enter or the textbox loses focus |
|
49 */ |
|
50 attribute boolean forceComplete; |
|
51 |
|
52 /* |
|
53 * Option to open the popup only after a certain number of results are available |
|
54 */ |
|
55 attribute unsigned long minResultsForPopup; |
|
56 |
|
57 /* |
|
58 * The maximum number of rows to show in the autocomplete popup. |
|
59 */ |
|
60 attribute unsigned long maxRows; |
|
61 |
|
62 /* |
|
63 * Option to show a second column in the popup which contains |
|
64 * the comment for each autocomplete result |
|
65 */ |
|
66 attribute boolean showCommentColumn; |
|
67 |
|
68 /* |
|
69 * Option to show a third column in the popup which contains |
|
70 * an additional image for each autocomplete result |
|
71 */ |
|
72 attribute boolean showImageColumn; |
|
73 |
|
74 /* |
|
75 * Number of milliseconds after a keystroke before a search begins |
|
76 */ |
|
77 attribute unsigned long timeout; |
|
78 |
|
79 /* |
|
80 * An extra parameter to configure searches with. |
|
81 */ |
|
82 attribute AString searchParam; |
|
83 |
|
84 /* |
|
85 * The number of autocomplete session to search |
|
86 */ |
|
87 readonly attribute unsigned long searchCount; |
|
88 |
|
89 /* |
|
90 * Get the name of one of the autocomplete search session objects |
|
91 */ |
|
92 ACString getSearchAt(in unsigned long index); |
|
93 |
|
94 /* |
|
95 * The value of text in the autocomplete textbox |
|
96 */ |
|
97 attribute AString textValue; |
|
98 |
|
99 /* |
|
100 * Report the starting index of the cursor in the textbox |
|
101 */ |
|
102 readonly attribute long selectionStart; |
|
103 |
|
104 /* |
|
105 * Report the ending index of the cursor in the textbox |
|
106 */ |
|
107 readonly attribute long selectionEnd; |
|
108 |
|
109 /* |
|
110 * Select a range of text in the autocomplete textbox |
|
111 */ |
|
112 void selectTextRange(in long startIndex, in long endIndex); |
|
113 |
|
114 /* |
|
115 * Notification that the search has started |
|
116 */ |
|
117 void onSearchBegin(); |
|
118 |
|
119 /* |
|
120 * Notification that the search concluded successfully |
|
121 */ |
|
122 void onSearchComplete(); |
|
123 |
|
124 /* |
|
125 * Notification that the user selected and entered a result item |
|
126 * |
|
127 * @return True if the user wishes to prevent the enter |
|
128 */ |
|
129 boolean onTextEntered(); |
|
130 |
|
131 /* |
|
132 * Notification that the user cancelled the autocomplete session |
|
133 * |
|
134 * @return True if the user wishes to prevent the revert |
|
135 */ |
|
136 boolean onTextReverted(); |
|
137 |
|
138 /* |
|
139 * This popup should consume or dispatch the rollup event. |
|
140 * TRUE: should consume; FALSE: should dispatch. |
|
141 */ |
|
142 readonly attribute boolean consumeRollupEvent; |
|
143 |
|
144 /* |
|
145 * Indicates whether this input is in a "private browsing" context. |
|
146 * nsIAutoCompleteSearches for these inputs should not persist any data to disk |
|
147 * (such as a history database). |
|
148 */ |
|
149 readonly attribute boolean inPrivateContext; |
|
150 }; |