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