1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/typeaheadfind/nsITypeAheadFind.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,88 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 +/********************************* #includes *********************************/ 1.11 + 1.12 +#include "domstubs.idl" // nsIDOMElement, nsIDOMWindow 1.13 +#include "nsISupports.idl" // nsISupports 1.14 + 1.15 + 1.16 +/******************************** Declarations *******************************/ 1.17 + 1.18 +interface nsIDocShell; 1.19 + 1.20 + 1.21 +/****************************** nsTypeAheadFind ******************************/ 1.22 + 1.23 +[scriptable, uuid(0749a445-19d3-4eb9-9d66-78eca8c6f604)] 1.24 +interface nsITypeAheadFind : nsISupports 1.25 +{ 1.26 + /****************************** Initializer ******************************/ 1.27 + 1.28 + /* Necessary initialization that can't happen in the constructor, either 1.29 + * because function calls here may fail, or because the docShell is 1.30 + * required. */ 1.31 + void init(in nsIDocShell aDocShell); 1.32 + 1.33 + 1.34 + /***************************** Core functions ****************************/ 1.35 + 1.36 + /* Find aSearchString in page. If aLinksOnly is true, only search the page's 1.37 + * hyperlinks for the string. */ 1.38 + unsigned short find(in AString aSearchString, in boolean aLinksOnly); 1.39 + 1.40 + /* Find another match in the page. */ 1.41 + unsigned short findAgain(in boolean findBackwards, in boolean aLinksOnly); 1.42 + 1.43 + 1.44 + /**************************** Helper functions ***************************/ 1.45 + 1.46 + /* Change searched docShell. This happens when e.g. we use the same 1.47 + * nsITypeAheadFind object to search different tabs. */ 1.48 + void setDocShell(in nsIDocShell aDocShell); 1.49 + 1.50 + /* Change the look of the the "found match" selection to aToggle, and repaint 1.51 + * the selection. */ 1.52 + void setSelectionModeAndRepaint(in short toggle); 1.53 + 1.54 + /* Collapse the "found match" selection to its start. Because not all 1.55 + * matches are owned by the same selection controller, this doesn't 1.56 + * necessarily happen automatically. */ 1.57 + void collapseSelection(); 1.58 + 1.59 + 1.60 + /******************************* Attributes ******************************/ 1.61 + 1.62 + readonly attribute AString searchString; 1.63 + // Most recent search string 1.64 + attribute boolean caseSensitive; // Searches are case sensitive 1.65 + readonly attribute nsIDOMElement foundLink; 1.66 + // Most recent elem found, if a link 1.67 + readonly attribute nsIDOMElement foundEditable; 1.68 + // Most recent elem found, if editable 1.69 + readonly attribute nsIDOMWindow currentWindow; 1.70 + // Window of most recent match 1.71 + 1.72 + 1.73 + /******************************* Constants *******************************/ 1.74 + 1.75 + /* Find return codes */ 1.76 + const unsigned short FIND_FOUND = 0; 1.77 + // Successful find 1.78 + const unsigned short FIND_NOTFOUND = 1; 1.79 + // Unsuccessful find 1.80 + const unsigned short FIND_WRAPPED = 2; 1.81 + // Successful find, but wrapped around 1.82 + const unsigned short FIND_PENDING = 3; 1.83 + // Unknown status, find has not finished 1.84 + 1.85 + 1.86 + /*************************************************************************/ 1.87 + 1.88 +}; 1.89 + 1.90 + 1.91 +/*****************************************************************************/