Back to index

lightning-sunbird  0.9+nobinonly
nsIAutoCompleteController.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  *   Dean Tessman <dean_tessman@hotmail.com>
00024  *   Masayuki Nakano <masayuki@d-toybox.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #include "nsISupports.idl"
00041 
00042 interface nsIAutoCompleteInput;
00043 
00044 [scriptable, uuid(CF2ACA0C-4FB1-42e4-8A54-23E832CB2A98)]
00045 interface nsIAutoCompleteController : nsISupports
00046 {
00047   /*
00048    * Possible values for the searchStatus attribute
00049    */
00050   const unsigned short STATUS_NONE = 1;
00051   const unsigned short STATUS_SEARCHING = 2;
00052   const unsigned short STATUS_COMPLETE_NO_MATCH = 3;
00053   const unsigned short STATUS_COMPLETE_MATCH = 4;
00054 
00055   /*
00056    * Possible key navigation values
00057    */
00058   const unsigned short KEY_UP = 1;
00059   const unsigned short KEY_DOWN = 2;
00060   const unsigned short KEY_LEFT = 3;
00061   const unsigned short KEY_RIGHT = 4;
00062   const unsigned short KEY_PAGE_UP = 5;
00063   const unsigned short KEY_PAGE_DOWN = 6;
00064   const unsigned short KEY_HOME = 7;
00065   const unsigned short KEY_END = 8;
00066   
00067   /*
00068    * The input widget that is currently being controlled.
00069    */
00070   attribute nsIAutoCompleteInput input;
00071 
00072   /*
00073    * State which indicates the status of possible ongoing searches
00074    */
00075   readonly attribute unsigned short searchStatus;
00076 
00077   /*
00078    * The number of matches
00079    */
00080   readonly attribute unsigned long matchCount;
00081 
00082   /*
00083    * Start a search on a string, assuming the input property is already set.
00084    */
00085   void startSearch(in AString searchString);
00086 
00087   /*
00088    * Notify the controller that the user has changed text in the textbox.  This includes all
00089    * means of changing the text value, including typing a character, backspacing, deleting, or
00090    * pasting in an entirely new value.
00091    */
00092   void handleText(in boolean aIgnoreSelection);
00093 
00094   /*
00095    * Notify the controller that the user wishes to enter the current text
00096    *
00097    * @return True if the controller wishes to prevent event propagation and default event
00098    */
00099   boolean handleEnter();
00100 
00101   /*
00102    * Notify the controller that the user wishes to revert autocomplete
00103    *
00104    * @return True if the controller wishes to prevent event propagation and default event
00105    */
00106   boolean handleEscape();
00107 
00108   /*
00109    * Notify the controller that the user wishes to start composition
00110    */
00111   void handleStartComposition();
00112 
00113   /*
00114    * Notify the controller that the user wishes to end composition
00115    */
00116   void handleEndComposition();
00117 
00118   /* 
00119    * Handle tab. Just closes up.
00120    */
00121   void handleTab();
00122 
00123   /*
00124    * Notify the controller of the following key navigation events:
00125    *   up, down, left, right, page up, page down
00126    *
00127    * @return True if the controller wishes to prevent event propagation and default event
00128    */
00129   boolean handleKeyNavigation(in unsigned short key);
00130 
00131   /*
00132    * Notify the controller that the user chose to delete the current
00133    * auto-complete result.
00134    */
00135   boolean handleDelete();
00136   
00137   /*
00138    * Get the value of the result at a given index in the last completed search
00139    */
00140   AString getValueAt(in long index);
00141 
00142   /*
00143    * Get the comment of the result at a given index in the last completed search
00144    */
00145   AString getCommentAt(in long index);
00146 
00147   /*
00148    * Get a the style hint for the result at a given index in the last completed search
00149    */
00150   AString getStyleAt(in long index);
00151 
00152   /*
00153    * Set the current search string, but don't start searching
00154    */
00155   void setSearchString(in AString aSearchString);
00156 };
00157 
00158 [scriptable, uuid(729CB096-D5F1-4fc4-97CD-4B86E6917F97)]
00159 interface nsIAutoCompleteController_MOZILLA_1_8_BRANCH : nsIAutoCompleteController
00160 {
00161   /*
00162    * Attach or Detach rollup-listener
00163    */
00164   void attachRollupListener();
00165   void detachRollupListener();
00166 };