embedding/components/find/public/nsIWebBrowserFind.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsISupports.idl"
     8 #include "domstubs.idl"
    10 /* THIS IS A PUBLIC EMBEDDING API */
    13 /**
    14  * nsIWebBrowserFind
    15  *
    16  * Searches for text in a web browser.
    17  *
    18  * Get one by doing a GetInterface on an nsIWebBrowser.
    19  *
    20  * By default, the implementation will search the focussed frame, or
    21  * if there is no focussed frame, the web browser content area. It
    22  * does not by default search subframes or iframes. To change this
    23  * behaviour, and to explicitly set the frame to search, 
    24  * QueryInterface to nsIWebBrowserFindInFrames.
    25  */
    27 [scriptable, uuid(2f977d44-5485-11d4-87e2-0010a4e75ef2)]
    28 interface nsIWebBrowserFind : nsISupports
    29 {
    30     /**
    31      * findNext
    32      *
    33      * Finds, highlights, and scrolls into view the next occurrence of the
    34      * search string, using the current search settings. Fails if the
    35      * search string is empty.
    36      *
    37      * @return  Whether an occurrence was found
    38      */
    39 	boolean		findNext();
    41     /**
    42      * searchString
    43      *
    44      * The string to search for. This must be non-empty to search.
    45      */
    46     attribute wstring searchString;
    48     /**
    49      * findBackwards
    50      *
    51      * Whether to find backwards (towards the beginning of the document).
    52      * Default is false (search forward).
    53      */
    54     attribute boolean findBackwards;
    56     /**
    57      * wrapFind
    58      *
    59      * Whether the search wraps around to the start (or end) of the document
    60      * if no match was found between the current position and the end (or
    61      * beginning). Works correctly when searching backwards. Default is
    62      * false.
    63      */
    64     attribute boolean wrapFind;
    66     /**
    67      * entireWord
    68      *
    69      * Whether to match entire words only. Default is false.
    70      */
    71     attribute boolean entireWord;
    73     /**
    74      * matchCase
    75      *
    76      * Whether to match case (case sensitive) when searching. Default is false.
    77      */
    78     attribute boolean matchCase;
    80     /**
    81      * searchFrames
    82      *
    83      * Whether to search through all frames in the content area. Default is true.
    84      * 
    85      * Note that you can control whether the search propagates into child or
    86      * parent frames explicitly using nsIWebBrowserFindInFrames, but if one,
    87      * but not both, of searchSubframes and searchParentFrames are set, this
    88      * returns false.
    89      */
    90     attribute boolean searchFrames;
    91 };
    95 /**
    96  * nsIWebBrowserFindInFrames
    97  *
    98  * Controls how find behaves when multiple frames or iframes are present.
    99  *
   100  * Get by doing a QueryInterface from nsIWebBrowserFind.
   101  */
   103 [scriptable, uuid(e0f5d182-34bc-11d5-be5b-b760676c6ebc)]
   104 interface nsIWebBrowserFindInFrames : nsISupports
   105 {
   106     /**
   107      * currentSearchFrame
   108      *
   109      * Frame at which to start the search. Once the search is done, this will
   110      * be set to be the last frame searched, whether or not a result was found.
   111      * Has to be equal to or contained within the rootSearchFrame.
   112      */
   113     attribute nsIDOMWindow  currentSearchFrame;
   115     /**
   116      * rootSearchFrame
   117      *
   118      * Frame within which to confine the search (normally the content area frame).
   119      * Set this to only search a subtree of the frame hierarchy.
   120      */
   121     attribute nsIDOMWindow  rootSearchFrame;
   123     /**
   124      * searchSubframes
   125      *
   126      * Whether to recurse down into subframes while searching. Default is true.
   127      *
   128      * Setting nsIWebBrowserfind.searchFrames to true sets this to true.
   129      */
   130     attribute boolean searchSubframes;
   132     /**
   133      * searchParentFrames
   134      *
   135      * Whether to allow the search to propagate out of the currentSearchFrame into its
   136      * parent frame(s). Search is always confined within the rootSearchFrame. Default
   137      * is true.
   138      *
   139      * Setting nsIWebBrowserfind.searchFrames to true sets this to true.
   140      */
   141     attribute boolean searchParentFrames;
   143 };

mercurial