toolkit/components/autocomplete/nsIAutoCompleteInput.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/autocomplete/nsIAutoCompleteInput.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,150 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "nsISupports.idl"
     1.9 +#include "nsIAutoCompleteController.idl"
    1.10 +
    1.11 +interface nsIAutoCompletePopup;
    1.12 +
    1.13 +[scriptable, uuid(fadb2bb9-3e2e-4ca0-b0e0-0982b8dda9dc)]
    1.14 +interface nsIAutoCompleteInput : nsISupports
    1.15 +{  
    1.16 +  /*
    1.17 +   * The result view that will be used to display results
    1.18 +   */
    1.19 +  readonly attribute nsIAutoCompletePopup popup;
    1.20 +  
    1.21 +  /*
    1.22 +   * The controller.
    1.23 +   */
    1.24 +  readonly attribute nsIAutoCompleteController controller;
    1.25 +
    1.26 +  /* 
    1.27 +   * Indicates if the popup is currently open
    1.28 +   */
    1.29 +  attribute boolean popupOpen;
    1.30 +
    1.31 +  /*
    1.32 +   * Option to disable autocomplete functionality
    1.33 +   */ 
    1.34 +  attribute boolean disableAutoComplete;
    1.35 +  
    1.36 +  /* 
    1.37 +   * If a search result has its defaultIndex set, this will optionally
    1.38 +   * try to complete the text in the textbox to the entire text of the
    1.39 +   * result at the default index as the user types
    1.40 +   */
    1.41 +  attribute boolean completeDefaultIndex;
    1.42 +
    1.43 +  /*
    1.44 +   * complete text in the textbox as the user selects from the dropdown
    1.45 +   * options if set to true
    1.46 +   */
    1.47 +  attribute boolean completeSelectedIndex;
    1.48 +
    1.49 +  /* 
    1.50 +   * Option for completing to the default result whenever the user hits
    1.51 +   * enter or the textbox loses focus
    1.52 +   */
    1.53 +  attribute boolean forceComplete;
    1.54 +    
    1.55 +  /*
    1.56 +   * Option to open the popup only after a certain number of results are available
    1.57 +   */
    1.58 +  attribute unsigned long minResultsForPopup;
    1.59 +  
    1.60 +  /*
    1.61 +   * The maximum number of rows to show in the autocomplete popup.
    1.62 +   */
    1.63 +  attribute unsigned long maxRows;
    1.64 +
    1.65 +  /*
    1.66 +   * Option to show a second column in the popup which contains
    1.67 +   * the comment for each autocomplete result
    1.68 +   */
    1.69 +  attribute boolean showCommentColumn;
    1.70 +
    1.71 +  /*
    1.72 +   * Option to show a third column in the popup which contains
    1.73 +   * an additional image for each autocomplete result
    1.74 +   */
    1.75 +  attribute boolean showImageColumn;
    1.76 +
    1.77 +  /* 
    1.78 +   * Number of milliseconds after a keystroke before a search begins
    1.79 +   */
    1.80 +  attribute unsigned long timeout;
    1.81 +
    1.82 +  /*
    1.83 +   * An extra parameter to configure searches with.
    1.84 +   */
    1.85 +  attribute AString searchParam;
    1.86 +
    1.87 +  /*
    1.88 +   * The number of autocomplete session to search
    1.89 +   */
    1.90 +  readonly attribute unsigned long searchCount;
    1.91 +  
    1.92 +  /*
    1.93 +   * Get the name of one of the autocomplete search session objects
    1.94 +   */
    1.95 +  ACString getSearchAt(in unsigned long index);
    1.96 +
    1.97 +  /*
    1.98 +   * The value of text in the autocomplete textbox
    1.99 +   */
   1.100 +  attribute AString textValue;
   1.101 +
   1.102 +  /*
   1.103 +   * Report the starting index of the cursor in the textbox
   1.104 +   */
   1.105 +  readonly attribute long selectionStart;
   1.106 +
   1.107 +  /*
   1.108 +   * Report the ending index of the cursor in the textbox
   1.109 +   */
   1.110 +  readonly attribute long selectionEnd;
   1.111 +
   1.112 +  /*
   1.113 +   * Select a range of text in the autocomplete textbox
   1.114 +   */
   1.115 +  void selectTextRange(in long startIndex, in long endIndex);
   1.116 +
   1.117 +  /*
   1.118 +   * Notification that the search has started
   1.119 +   */
   1.120 +  void onSearchBegin();
   1.121 +
   1.122 +  /*
   1.123 +   * Notification that the search concluded successfully
   1.124 +   */
   1.125 +  void onSearchComplete();
   1.126 +
   1.127 +  /*
   1.128 +   * Notification that the user selected and entered a result item
   1.129 +   *
   1.130 +   * @return True if the user wishes to prevent the enter
   1.131 +   */
   1.132 +  boolean onTextEntered();
   1.133 +
   1.134 +  /*
   1.135 +   * Notification that the user cancelled the autocomplete session
   1.136 +   *
   1.137 +   * @return True if the user wishes to prevent the revert
   1.138 +   */
   1.139 +  boolean onTextReverted();
   1.140 +
   1.141 +  /*
   1.142 +   * This popup should consume or dispatch the rollup event.
   1.143 +   * TRUE: should consume; FALSE: should dispatch.
   1.144 +   */
   1.145 +  readonly attribute boolean consumeRollupEvent;
   1.146 +
   1.147 +  /*
   1.148 +   * Indicates whether this input is in a "private browsing" context.
   1.149 +   * nsIAutoCompleteSearches for these inputs should not persist any data to disk
   1.150 +   * (such as a history database).
   1.151 +   */
   1.152 +  readonly attribute boolean inPrivateContext;
   1.153 +};

mercurial