1 /******************************************************************************* 2 * Copyright (c) 2000, 2005 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.help.search; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IProgressMonitor; 15 16 /** 17 * A search engine that is a participant in the help search. All engines 18 * selected by the user to run are executed as background jobs using the same 19 * search expression. Engine is expected to accept the expression and the scope 20 * object. The results should be passed to the result collector object, and the 21 * search progress should be tracked by the progress monitor. 22 * <p> 23 * Search engines that have API access to the search server can provide a list 24 * of individual search results. Search engines for which only the URL is known 25 * are expected to return one search result containing a URL that is sufficient 26 * to open a web browser and see the search results there. 27 * <p> 28 * Search engine must be cancelable. 29 * <p>This interface is intended to be implemented by clients. 30 * 31 * @since 3.1 32 */ 33 34 public interface ISearchEngine { 35 /** 36 * 37 * @param query 38 * the search expression 39 * @param scope 40 * the engine-specific scope object that is used to narrow the 41 * search or <code>null</code> if the default scope is assumed. 42 * @param collector 43 * the search result collector handles results as they arrive 44 * @param monitor 45 * progress monitor to track the search progress 46 * @throws CoreException 47 * when there are problems in the engine 48 */ 49 void run(String query, ISearchScope scope, 50 ISearchEngineResultCollector collector, IProgressMonitor monitor) 51 throws CoreException; 52 } 53