toolkit/components/autocomplete/nsIAutoCompleteController.idl

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #include "nsISupports.idl"
     7 interface nsIAutoCompleteInput;
     9 [scriptable, uuid(ff9f8465-204a-47a6-b3c9-0628b3856684)]
    10 interface nsIAutoCompleteController : nsISupports
    11 {
    12   /*
    13    * Possible values for the searchStatus attribute
    14    */
    15   const unsigned short STATUS_NONE = 1;
    16   const unsigned short STATUS_SEARCHING = 2;
    17   const unsigned short STATUS_COMPLETE_NO_MATCH = 3;
    18   const unsigned short STATUS_COMPLETE_MATCH = 4;
    20   /*
    21    * The input widget that is currently being controlled.
    22    */
    23   attribute nsIAutoCompleteInput input;
    25   /*
    26    * State which indicates the status of possible ongoing searches
    27    */
    28   readonly attribute unsigned short searchStatus;
    30   /*
    31    * The number of matches
    32    */
    33   readonly attribute unsigned long matchCount;
    35   /*
    36    * Start a search on a string, assuming the input property is already set.
    37    */
    38   void startSearch(in AString searchString);
    40   /* 
    41    * Stop all asynchronous searches
    42    */
    43   void stopSearch();
    45   /*
    46    * Notify the controller that the user has changed text in the textbox.
    47    * This includes all means of changing the text value, including typing a
    48    * character, backspacing, deleting, pasting, committing composition or
    49    * canceling composition.
    50    *
    51    * NOTE: handleText() must be called after composition actually ends, even if
    52    *       the composition is canceled and the textbox value isn't changed.
    53    *       Then, implementation of handleText() can access the editor when
    54    *       it's not in composing mode. DOM compositionend event is not good
    55    *       timing for calling handleText(). DOM input event immediately after
    56    *       DOM compositionend event is the best timing to call this.
    57    */
    58   void handleText();
    60   /*
    61    * Notify the controller that the user wishes to enter the current text. If
    62    * aIsPopupSelection is true, then a selection was made from the popup, so
    63    * fill this value into the input field before continuing. If false, just
    64    * use the current value of the input field.
    65    *
    66    * @return True if the controller wishes to prevent event propagation and default event
    67    */
    68   boolean handleEnter(in boolean aIsPopupSelection);
    70   /*
    71    * Notify the controller that the user wishes to revert autocomplete
    72    *
    73    * @return True if the controller wishes to prevent event propagation and default event
    74    */
    75   boolean handleEscape();
    77   /*
    78    * Notify the controller that the user wishes to start composition
    79    *
    80    * NOTE: nsIAutoCompleteController implementation expects that this is called
    81    *       by DOM compositionstart handler.
    82    */
    83   void handleStartComposition();
    85   /*
    86    * Notify the controller that the user wishes to end composition
    87    *
    88    * NOTE: nsIAutoCompleteController implementation expects that this is called
    89    *       by DOM compositionend handler.
    90    */
    91   void handleEndComposition();
    93   /* 
    94    * Handle tab. Just closes up.
    95    */
    96   void handleTab();
    98   /*
    99    * Notify the controller of the following key navigation events:
   100    *   up, down, left, right, page up, page down
   101    *
   102    * @return True if the controller wishes to prevent event propagation and default event
   103    */
   104   boolean handleKeyNavigation(in unsigned long key);
   106   /*
   107    * Notify the controller that the user chose to delete the current
   108    * auto-complete result.
   109    */
   110   boolean handleDelete();
   112   /*
   113    * Get the value of the result at a given index in the last completed search
   114    */
   115   AString getValueAt(in long index);
   117   /*
   118    * Get the label of the result at a given index in the last completed search
   119    */
   120   AString getLabelAt(in long index);
   122   /*
   123    * Get the comment of the result at a given index in the last completed search
   124    */
   125   AString getCommentAt(in long index);
   127   /*
   128    * Get the style hint for the result at a given index in the last completed search
   129    */
   130   AString getStyleAt(in long index);
   132   /*
   133    * Get the url of the image of the result at a given index in the last completed search
   134    */
   135   AString getImageAt(in long index);
   137   /*
   138    * For the last completed search, get the final value that should be completed
   139    * when the user confirms the match at the given index
   140    */
   141   AString getFinalCompleteValueAt(in long index);
   143   /*
   144    * Get / set the current search string.  Note, setting will not start searching
   145    */
   146   attribute AString searchString;
   147 };

mercurial