Back to index

lightning-sunbird  0.9+nobinonly
nsISearchService.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  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Robert John Churchill      <rjc@netscape.com>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either of the GNU General Public License Version 2 or later (the "GPL"),
00027  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 /*
00040 
00041   The Browser Search service
00042 
00043 */
00044 
00045 #include "nsISupports.idl"
00046 #include "nsIRDFDataSource.idl"
00047 
00048 interface  nsIUnicodeDecoder;
00049 
00050 [scriptable, uuid(1222e6f0-a5e3-11d2-8b7c-00805f8a7db6)]
00051 interface nsILocalSearchService : nsISupports
00052 {
00053 };
00054 
00055 [scriptable, uuid(6bd1d803-1c67-11d3-9820-ed1b357eb3c4)]
00056 interface nsIInternetSearchService : nsISupports
00057 {
00058   // constants set in the whichButtons out param of GetInternetSearchURL() 
00059   const unsigned short kHaveNext = 1;
00060   const unsigned short kHavePrev = 2;
00061 
00062   string      GetInternetSearchURL(in string searchEngineURI, in wstring searchStr, in short direction, in unsigned short pageNumber, out unsigned short whichButtons);
00063   void      RememberLastSearchText(in wstring escapedSearchStr);
00064   boolean      FindInternetSearchResults(in string url);
00065   void      Stop();
00066   void      ClearResults(in boolean flushLastSearchRef);
00067   void      ClearResultSearchSites();
00068   nsIRDFDataSource  GetCategoryDataSource();
00069   void      AddSearchEngine(in string engineURL, in string iconURL,
00070                          in wstring suggestedTitle, in wstring suggestedCategory);
00071 };
00072 
00073 [noscript, uuid(7b171610-80ca-4d33-b16c-4186cd7b7e73)]
00074 interface nsIInternetSearchContext : nsISupports
00075 {
00076   const unsigned long WEB_SEARCH_CONTEXT      = 1;
00077 
00078   // The download of the .src file for a *new* engine.
00079   const unsigned long ENGINE_DOWNLOAD_NEW_CONTEXT = 2;
00080 
00081   // The download of the icon file for a new engine.
00082   const unsigned long ICON_DOWNLOAD_NEW_CONTEXT = 3;
00083 
00084   // The head request to see if we need to update the engine.
00085   const unsigned long ENGINE_UPDATE_HEAD_CONTEXT = 4;
00086 
00087   // The download of the .src file for an engine update.
00088   const unsigned long ENGINE_DOWNLOAD_UPDATE_CONTEXT = 5;
00089 
00090   // The download of the icon file for an engine update.
00091   const unsigned long ICON_DOWNLOAD_UPDATE_CONTEXT = 6;
00092 
00093   // attributes
00094   readonly attribute unsigned long ContextType;
00095 
00096   // methods
00097   nsIUnicodeDecoder  GetUnicodeDecoder();
00098   nsIRDFResource    GetParent();
00099   nsIRDFResource    GetEngine();
00100   void      GetHintConst([shared] out wstring buffer);
00101   void      AppendBytes(in string buffer, in long numBytes);
00102   void      AppendUnicodeBytes(in wstring buffer, in long numUniBytes);
00103   long      GetBufferLength();
00104   void      GetBufferConst([shared] out wstring buffer);
00105   void      Truncate();
00106 };
00107 
00108 %{C++
00109 
00110 #define NS_IINTERNETSEARCHDATASOURCECALLBACK_IID \
00111 { 0x88774583, 0x1edd, 0x11d3, { 0x98, 0x20, 0xbf, 0x1b, 0xe7, 0x7e, 0x61, 0xc4 } }
00112 
00113 #define NS_IINTERNETSEARCHDATAOURCE_IID \
00114 { 0x6bd1d803, 0x1c67, 0x11d3, { 0x98, 0x20, 0xed, 0x1b, 0x35, 0x7e, 0xb3, 0xc4 } }
00115 
00116 #define NS_ILOCALSEARCHDATASOURCE_IID \
00117 { 0x1222e6f0, 0xa5e3, 0x11d2, { 0x8b, 0x7c, 0x00, 0x80, 0x5f, 0x8a, 0x7d, 0xb6 } }
00118 
00119 #define NS_LOCALSEARCH_SERVICE_CONTRACTID \
00120     "@mozilla.org/browser/localsearch-service;1"
00121 #define NS_LOCALSEARCH_DATASOURCE_CONTRACTID \
00122     "@mozilla.org/rdf/datasource;1?name=localsearch"
00123 
00124 #define NS_INTERNETSEARCH_SERVICE_CONTRACTID \
00125     "@mozilla.org/browser/internetsearch-service;1"
00126 #define NS_INTERNETSEARCH_DATASOURCE_CONTRACTID \
00127     "@mozilla.org/rdf/datasource;1?name=internetsearch"
00128 
00129 %}