/*
 * BEGIN FLOCK GPL
 * 
 * Copyright Flock Inc. 2005-2006
 * http://flock.com
 * 
 * This file may be used under the terms of of the
 * GNU General Public License Version 2 or later (the "GPL"),
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 * 
 * END FLOCK GPL
 */

#include "nsISupports.idl"
#include "nsIDOMDocument.idl"
#include "nsIRDFDataSource.idl"
#include "flockIHistorySearchService.idl"


[scriptable, uuid(5d8477b5-3ce0-4bbd-a7f2-6405aeee436e)]
interface flockILuceneAsync : nsISupports
{
	/**
	 * Initialize using a database named @aTarget
	 */
	void Init (in string aTarget);

	/**
	 * Add the document in @aText with title @aTitle, tags @aTags and url 
     * @aURL to the index. The request to do this will be dispatched to 
     * the worker thread for the actual indexing.
	 */
	void AddDocumentText (in string aURL, in string aTags, in long aIsFavorite, in AString aTitle, in AString aDescription, in AString aText);

	/** 
	 * Remove the document identified by hash @hash from the index.
	 */
	void DeleteDocument(in string aURL);

	/** 
	 * Search the index with the query @query and return at most 
	 * @max_results results to @listener.
	 */
	void Search (in AString query, in long max_results, in flockIHistorySearchListener listener, in nsIRDFDataSource data_source);

	/**
	 * Shut down the worker thread and cancel outstanding requests.
	 */
	void Shutdown ();
};

