1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
14 * The Original Code is mozilla.org code.
16 * The Initial Developer of the Original Code is
17 * Netscape Communications Corporation.
18 * Portions created by the Initial Developer are Copyright (C) 2001
19 * the Initial Developer. All Rights Reserved.
22 * Joe Hewitt <hewitt@netscape.com> (Original Author)
23 * Dean Tessman <dean_tessman@hotmail.com>
24 * Masayuki Nakano <masayuki@d-toybox.com>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #include
"nsISupports.idl"
42 interface nsIAutoCompleteInput
;
44 [scriptable
, uuid(6F08D134
-8536-4B28
-B456
-D150FBAA66A9
)]
45 interface nsIAutoCompleteController
: nsISupports
48 * Possible values for the searchStatus attribute
50 const unsigned short STATUS_NONE
= 1;
51 const unsigned short STATUS_SEARCHING
= 2;
52 const unsigned short STATUS_COMPLETE_NO_MATCH
= 3;
53 const unsigned short STATUS_COMPLETE_MATCH
= 4;
56 * The input widget that is currently being controlled.
58 attribute nsIAutoCompleteInput input
;
61 * State which indicates the status of possible ongoing searches
63 readonly attribute
unsigned short searchStatus
;
66 * The number of matches
68 readonly attribute
unsigned long matchCount
;
71 * Start a search on a string, assuming the input property is already set.
73 void startSearch
(in AString searchString
);
76 * Stop all asynchronous searches
81 * Notify the controller that the user has changed text in the textbox. This includes all
82 * means of changing the text value, including typing a character, backspacing, deleting, or
83 * pasting in an entirely new value.
85 void handleText
(in boolean aIgnoreSelection
);
88 * Notify the controller that the user wishes to enter the current text. If
89 * aIsPopupSelection is true, then a selection was made from the popup, so
90 * fill this value into the input field before continuing. If false, just
91 * use the current value of the input field.
93 * @return True if the controller wishes to prevent event propagation and default event
95 boolean handleEnter
(in boolean aIsPopupSelection
);
98 * Notify the controller that the user wishes to revert autocomplete
100 * @return True if the controller wishes to prevent event propagation and default event
102 boolean handleEscape
();
105 * Notify the controller that the user wishes to start composition
107 void handleStartComposition
();
110 * Notify the controller that the user wishes to end composition
112 void handleEndComposition
();
115 * Handle tab. Just closes up.
120 * Notify the controller of the following key navigation events:
121 * up, down, left, right, page up, page down
123 * @return True if the controller wishes to prevent event propagation and default event
125 boolean handleKeyNavigation
(in unsigned long key
);
128 * Notify the controller that the user chose to delete the current
129 * auto-complete result.
131 boolean handleDelete
();
134 * Get the value of the result at a given index in the last completed search
136 AString getValueAt
(in long index
);
139 * Get the comment of the result at a given index in the last completed search
141 AString getCommentAt
(in long index
);
144 * Get a the style hint for the result at a given index in the last completed search
146 AString getStyleAt
(in long index
);
149 * Get the url of the image of the result at a given index in the last completed search
151 AString getImageAt
(in long index
);
154 * Get / set the current search string. Note, setting will not start searching
156 attribute AString searchString
;