/*
 * 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"

[scriptable, uuid(8dc0eea1-1f4a-4d42-9193-fa177a171db2)]
interface flockIHistorySearchListener : nsISupports
{
	void FoundResults (in long aNumResults, in nsIRDFDataSource aDataSource);
};



[scriptable, uuid(a5670b75-1988-46e2-a505-3742ecdba945)]
interface flockIHistorySearchService : nsISupports
{
	/**
	 * 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 aDocument, in AString aText);

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

	/** 
	 * Search the index with the query @aQuery and return at most 
	 * @aMaxResults results to @aListener in @aDataSource.
	 */
	void Search (in AString aQuery, in long aMaxResults, in flockIHistorySearchListener aListener, in nsIRDFDataSource aDataSource);

    const long FAVORITE_YES   = 1;
    const long FAVORITE_NO    = 0;
    const long FAVORITE_COPY  = -1;
};
