Back to index

lightning-sunbird  0.9+nobinonly
nsITypeAheadFind.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Blake Ross.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Blake Ross      <blake@cs.stanford.edu> (Original Author)
00024  *   Masayuki Nakano <masayuki@d-toybox.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 
00041 /********************************* #includes *********************************/
00042 
00043 #include "domstubs.idl"                 // nsIDOMElement, nsIDOMWindow
00044 #include "nsISupports.idl"              // nsISupports
00045 
00046 
00047 /******************************** Declarations *******************************/
00048 
00049 interface nsIDocShell;
00050 
00051 
00052 /****************************** nsTypeAheadFind ******************************/
00053 
00054 [scriptable, uuid(376da416-e6b3-4bac-98f3-6aa408742751)]
00055 interface nsITypeAheadFind : nsISupports
00056 {
00057   /****************************** Initializer ******************************/
00058 
00059   /* Necessary initialization that can't happen in the constructor, either
00060    * because function calls here may fail, or because the docShell is
00061    * required. */
00062   void init(in nsIDocShell aDocShell);
00063 
00064 
00065   /***************************** Core functions ****************************/
00066 
00067   /* Find aSearchString in page.  If aLinksOnly is true, only search the page's
00068    * hyperlinks for the string.  aHasFocus will be true if the "Find" textfield
00069    * has focus. */
00070   unsigned short find(in AString aSearchString, in boolean aLinksOnly);
00071 
00072   /* Find next match in the page. */
00073   unsigned short findNext();
00074 
00075   /* Find previous match in the page. */
00076   unsigned short findPrevious();
00077 
00078 
00079   /**************************** Helper functions ***************************/
00080 
00081   /* Change searched docShell.  This happens when e.g. we use the same
00082    * nsITypeAheadFind object to search different tabs. */
00083   void setDocShell(in nsIDocShell aDocShell);
00084 
00085 
00086   /******************************* Attributes ******************************/
00087 
00088   readonly attribute AString searchString;
00089                                         // Most recent search string
00090   attribute boolean focusLinks;         // DOES NOTHING
00091   attribute boolean caseSensitive;      // Searches are case sensitive
00092   readonly attribute nsIDOMElement foundLink;
00093                                         // Most recent elem found, if a link
00094   readonly attribute nsIDOMWindow currentWindow;
00095                                         // Window of most recent match
00096 
00097 
00098   /******************************* Constants *******************************/
00099 
00100   /* Find return codes */
00101   const unsigned short FIND_FOUND    = 0;
00102                                         // Successful find
00103   const unsigned short FIND_NOTFOUND = 1;
00104                                         // Unsuccessful find
00105   const unsigned short FIND_WRAPPED  = 2;
00106                                         // Successful find, but wrapped around
00107 
00108 
00109   /*************************************************************************/
00110 
00111 };
00112 
00113 
00114 /********************* nsTypeAheadFind_MOZILLA_1_8_BRANCH ********************/
00115 
00116 [scriptable, uuid(6e934f17-1975-49c2-880e-4f9fa79a1b2e)]
00117 interface nsITypeAheadFind_MOZILLA_1_8_BRANCH : nsITypeAheadFind
00118 {
00119   /**************************** Helper functions ***************************/
00120 
00121   /* Change the look of the the "found match" selection to aToggle, and repaint
00122    * the selection. */
00123   void setSelectionModeAndRepaint(in short toggle);
00124 
00125   /* Collapse the "found match" selection to its start.  Because not all
00126    * matches are owned by the same selection controller, this doesn't
00127    * necessarily happen automatically. */
00128   void collapseSelection();
00129 
00130 
00131   /******************************* Attributes ******************************/
00132 
00133   readonly attribute nsIDOMElement foundEditable;
00134                                         // Most recent elem found, if editable
00135 
00136 
00137   /*************************************************************************/
00138 
00139 };
00140 
00141 
00142 /*****************************************************************************/