Back to index

lightning-sunbird  0.9+nobinonly
nsIAutoCompleteInput.idl
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is mozilla.org code.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corporation.
00018  * Portions created by the Initial Developer are Copyright (C) 2001
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *   Joe Hewitt <hewitt@netscape.com> (Original Author)
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #include "nsISupports.idl"
00039 #include "nsIAutoCompleteController.idl"
00040 
00041 interface nsIAutoCompletePopup;
00042 
00043 [scriptable, uuid(e312267f-8f57-43e8-a904-ff9b5d3f5aef)]
00044 interface nsIAutoCompleteInput : nsISupports
00045 {  
00046   /*
00047    * The result view that will be used to display results
00048    */
00049   readonly attribute nsIAutoCompletePopup popup;
00050   
00051   /*
00052    * The controller.
00053    */
00054   readonly attribute nsIAutoCompleteController controller;
00055 
00056   /* 
00057    * Indicates if the popup is currently open
00058    */
00059   attribute boolean popupOpen;
00060 
00061   /*
00062    * Option to disable autocomplete functionality
00063    */ 
00064   attribute boolean disableAutoComplete;
00065   
00066   /* 
00067    * If a search result has its defaultIndex set, this will optionally
00068    * try to complete the text in the textbox to the entire text of the
00069    * result at the default index as the user types
00070    */
00071   attribute boolean completeDefaultIndex;
00072 
00073   /*
00074    * complete text in the textbox as the user selects from the dropdown
00075    * options if set to true
00076    */
00077   attribute boolean completeSelectedIndex;
00078 
00079   /* 
00080    * Option for completing to the default result whenever the user hits
00081    * enter or the textbox loses focus
00082    */
00083   attribute boolean forceComplete;
00084     
00085   /*
00086    * Option to open the popup only after a certain number of results are available
00087    */
00088   attribute unsigned long minResultsForPopup;
00089   
00090   /*
00091    * The maximum number of rows to show in the autocomplete popup.
00092    */
00093   attribute unsigned long maxRows;
00094 
00095   /*
00096    * Option to show a second column in the popup which contains
00097    * the comment for each autocomplete result
00098    */
00099   attribute unsigned long showCommentColumn;
00100 
00101   /* 
00102    * Number of milliseconds after a keystroke before a search begins
00103    */
00104   attribute unsigned long timeout;
00105 
00106   /*
00107    * An extra parameter to configure searches with.
00108    */
00109   attribute AString searchParam;
00110 
00111   /*
00112    * The number of autocomplete session to search
00113    */
00114   readonly attribute unsigned long searchCount;
00115   
00116   /*
00117    * Get the name of one of the autocomplete search session objects
00118    */
00119   ACString getSearchAt(in unsigned long index);
00120 
00121   /*
00122    * The value of text in the autocomplete textbox
00123    */
00124   attribute AString textValue;
00125 
00126   /*
00127    * Report the starting index of the cursor in the textbox
00128    */
00129   readonly attribute long selectionStart;
00130 
00131   /*
00132    * Report the ending index of the cursor in the textbox
00133    */
00134   readonly attribute long selectionEnd;
00135 
00136   /*
00137    * Select a range of text in the autocomplete textbox
00138    */
00139   void selectTextRange(in long startIndex, in long endIndex);
00140 
00141   /*
00142    * Notification that the search concluded successfully
00143    */
00144   void onSearchComplete();
00145 
00146   /*
00147    * Notification that the user selected and entered a result item
00148    *
00149    * @return True if the user wishes to prevent the enter
00150    */
00151   boolean onTextEntered();
00152 
00153   /*
00154    * Notification that the user cancelled the autocomplete session
00155    *
00156    * @return True if the user wishes to prevent the revert
00157    */
00158   boolean onTextReverted();
00159 };
00160 
00161 [scriptable, uuid(CCD37136-76E8-47a7-B46C-B8FEE8EB0536)]
00162 interface nsIAutoCompleteInput_MOZILLA_1_8_BRANCH : nsIAutoCompleteInput
00163 {
00164   /*
00165    * This popup should consume or dispatch the rollup event.
00166    * TRUE: should consume; FALSE: should dispatch.
00167    */
00168   readonly attribute boolean consumeRollupEvent;
00169 };