|
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 |
|
7 [scriptable, uuid(9203c031-c4e7-4537-a4ec-81443d623d5a)] |
|
8 interface nsIAutoCompleteResult : nsISupports |
|
9 { |
|
10 /** |
|
11 * Possible values for the searchResult attribute |
|
12 */ |
|
13 const unsigned short RESULT_IGNORED = 1; /* indicates invalid searchString */ |
|
14 const unsigned short RESULT_FAILURE = 2; /* indicates failure */ |
|
15 const unsigned short RESULT_NOMATCH = 3; /* indicates success with no matches |
|
16 and that the search is complete */ |
|
17 const unsigned short RESULT_SUCCESS = 4; /* indicates success with matches |
|
18 and that the search is complete */ |
|
19 const unsigned short RESULT_NOMATCH_ONGOING = 5; /* indicates success |
|
20 with no matches |
|
21 and that the search |
|
22 is still ongoing */ |
|
23 const unsigned short RESULT_SUCCESS_ONGOING = 6; /* indicates success |
|
24 with matches |
|
25 and that the search |
|
26 is still ongoing */ |
|
27 /** |
|
28 * The original search string |
|
29 */ |
|
30 readonly attribute AString searchString; |
|
31 |
|
32 /** |
|
33 * The result of the search |
|
34 */ |
|
35 readonly attribute unsigned short searchResult; |
|
36 |
|
37 /** |
|
38 * Index of the default item that should be entered if none is selected |
|
39 */ |
|
40 readonly attribute long defaultIndex; |
|
41 |
|
42 /** |
|
43 * A string describing the cause of a search failure |
|
44 */ |
|
45 readonly attribute AString errorDescription; |
|
46 |
|
47 /** |
|
48 * The number of matches |
|
49 */ |
|
50 readonly attribute unsigned long matchCount; |
|
51 |
|
52 /** |
|
53 * If true, the results will not be displayed in the popup. However, |
|
54 * if a default index is specified, the default item will still be |
|
55 * completed in the input. |
|
56 */ |
|
57 readonly attribute boolean typeAheadResult; |
|
58 |
|
59 /** |
|
60 * Get the value of the result at the given index |
|
61 */ |
|
62 AString getValueAt(in long index); |
|
63 |
|
64 /** |
|
65 * This returns the string that is displayed in the dropdown |
|
66 */ |
|
67 AString getLabelAt(in long index); |
|
68 |
|
69 /** |
|
70 * Get the comment of the result at the given index |
|
71 */ |
|
72 AString getCommentAt(in long index); |
|
73 |
|
74 /** |
|
75 * Get the style hint for the result at the given index |
|
76 */ |
|
77 AString getStyleAt(in long index); |
|
78 |
|
79 /** |
|
80 * Get the image of the result at the given index |
|
81 */ |
|
82 AString getImageAt(in long index); |
|
83 |
|
84 /** |
|
85 * Get the final value that should be completed when the user confirms |
|
86 * the match at the given index. |
|
87 */ |
|
88 AString getFinalCompleteValueAt(in long index); |
|
89 |
|
90 /** |
|
91 * Remove the value at the given index from the autocomplete results. |
|
92 * If removeFromDb is set to true, the value should be removed from |
|
93 * persistent storage as well. |
|
94 */ |
|
95 void removeValueAt(in long rowIndex, in boolean removeFromDb); |
|
96 }; |