2002-09-28 00:38:20 +00:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2005-02-01 17:07:35 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2002-09-28 00:38:20 +00:00
|
|
|
*
|
2005-02-01 17:07:35 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
2002-09-28 00:38:20 +00:00
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2005-02-01 17:07:35 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2002-09-28 00:38:20 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2001
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Joe Hewitt <hewitt@netscape.com> (Original Author)
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2005-02-01 17:07:35 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2002-09-28 00:38:20 +00:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2005-02-01 17:07:35 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2002-09-28 00:38:20 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2002-10-11 07:50:53 +00:00
|
|
|
#include "nsIAutoCompleteController.idl"
|
2002-09-28 00:38:20 +00:00
|
|
|
|
|
|
|
interface nsIAutoCompletePopup;
|
|
|
|
|
2007-11-06 05:31:22 +00:00
|
|
|
[scriptable, uuid(916aa9a0-e049-4ef9-a6dc-ff2f9f0f210b)]
|
2002-09-28 00:38:20 +00:00
|
|
|
interface nsIAutoCompleteInput : nsISupports
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* The result view that will be used to display results
|
|
|
|
*/
|
|
|
|
readonly attribute nsIAutoCompletePopup popup;
|
|
|
|
|
2002-10-11 07:50:53 +00:00
|
|
|
/*
|
|
|
|
* The controller.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIAutoCompleteController controller;
|
|
|
|
|
2002-09-28 00:38:20 +00:00
|
|
|
/*
|
|
|
|
* Indicates if the popup is currently open
|
|
|
|
*/
|
|
|
|
attribute boolean popupOpen;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Option to disable autocomplete functionality
|
|
|
|
*/
|
|
|
|
attribute boolean disableAutoComplete;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If a search result has its defaultIndex set, this will optionally
|
|
|
|
* try to complete the text in the textbox to the entire text of the
|
|
|
|
* result at the default index as the user types
|
|
|
|
*/
|
|
|
|
attribute boolean completeDefaultIndex;
|
|
|
|
|
2005-02-18 12:40:00 +00:00
|
|
|
/*
|
|
|
|
* complete text in the textbox as the user selects from the dropdown
|
|
|
|
* options if set to true
|
|
|
|
*/
|
|
|
|
attribute boolean completeSelectedIndex;
|
|
|
|
|
2002-09-28 00:38:20 +00:00
|
|
|
/*
|
|
|
|
* Option for completing to the default result whenever the user hits
|
|
|
|
* enter or the textbox loses focus
|
|
|
|
*/
|
|
|
|
attribute boolean forceComplete;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Option to open the popup only after a certain number of results are available
|
|
|
|
*/
|
|
|
|
attribute unsigned long minResultsForPopup;
|
|
|
|
|
2003-07-13 02:27:25 +00:00
|
|
|
/*
|
|
|
|
* The maximum number of rows to show in the autocomplete popup.
|
|
|
|
*/
|
|
|
|
attribute unsigned long maxRows;
|
|
|
|
|
2002-09-28 00:38:20 +00:00
|
|
|
/*
|
|
|
|
* Option to show a second column in the popup which contains
|
|
|
|
* the comment for each autocomplete result
|
|
|
|
*/
|
2007-08-31 20:19:19 +00:00
|
|
|
attribute boolean showCommentColumn;
|
|
|
|
|
2002-09-28 00:38:20 +00:00
|
|
|
/*
|
|
|
|
* Number of milliseconds after a keystroke before a search begins
|
|
|
|
*/
|
|
|
|
attribute unsigned long timeout;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* An extra parameter to configure searches with.
|
|
|
|
*/
|
|
|
|
attribute AString searchParam;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The number of autocomplete session to search
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long searchCount;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get the name of one of the autocomplete search session objects
|
|
|
|
*/
|
|
|
|
ACString getSearchAt(in unsigned long index);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The value of text in the autocomplete textbox
|
|
|
|
*/
|
|
|
|
attribute AString textValue;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Report the starting index of the cursor in the textbox
|
|
|
|
*/
|
|
|
|
readonly attribute long selectionStart;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Report the ending index of the cursor in the textbox
|
|
|
|
*/
|
|
|
|
readonly attribute long selectionEnd;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Select a range of text in the autocomplete textbox
|
|
|
|
*/
|
|
|
|
void selectTextRange(in long startIndex, in long endIndex);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Notification that the search concluded successfully
|
|
|
|
*/
|
|
|
|
void onSearchComplete();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Notification that the user selected and entered a result item
|
|
|
|
*
|
|
|
|
* @return True if the user wishes to prevent the enter
|
|
|
|
*/
|
|
|
|
boolean onTextEntered();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Notification that the user cancelled the autocomplete session
|
|
|
|
*
|
|
|
|
* @return True if the user wishes to prevent the revert
|
|
|
|
*/
|
|
|
|
boolean onTextReverted();
|
2006-05-31 17:55:19 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This popup should consume or dispatch the rollup event.
|
|
|
|
* TRUE: should consume; FALSE: should dispatch.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean consumeRollupEvent;
|
2002-09-28 00:38:20 +00:00
|
|
|
};
|