/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * The contents of this file are subject to the Netscape Public
 * License Version 1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.mozilla.org/NPL/
 *
 * 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.
 *
 * The Original Code is mozilla.org code.
 *
 * The Initial Developer of the Original Code is Netscape
 * Communications Corporation.  Portions created by Netscape are
 * Copyright (C) 1998 Netscape Communications Corporation. All
 * Rights Reserved.
 *
 * Original Author: Jean-Francois Ducarroz (ducarroz@netscape.com)
 *
 * Contributor(s): 
 */

#include "nsISupports.idl"
#include "nsIAutoCompleteResults.idl"
#include "nsIAutoCompleteListener.idl"

%{ C++
#include "nsIDOMEvent.h"
%}

interface nsIDOMEvents;

[scriptable, uuid(E0140B60-0264-11d4-8378-000000000000)]
interface nsIAutoCompleteSession : nsISupports {

    /* onStartLookup is called when the user has stop typing for a predifined elapse time */
    void onStartLookup(in nsIDOMEvents event, in wstring searchString,
                       in nsIAutoCompleteResults previousSearchResult, in nsIAutoCompleteListener listener);

    /* onStopLookup is called each time the user press a key */
    void onStopLookup(in nsIDOMEvents event);

    /* onAutoComplete is called either when the user press enter/return or when the input element loose focus */
    void onAutoComplete(in nsIDOMEvents event, in wstring searchString,
                        in nsIAutoCompleteResults previousSearchResult, in nsIAutoCompleteListener listener);
};
