/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

%{ C++
#include "nsIAutoCompleteResults.h"
#include "nsIAutoCompleteListener.h"
%}

interface nsIAutoCompleteResults;
interface nsIAutoCompleteListener;

[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 wstring searchString, in nsIAutoCompleteResults previousSearchResult,
                       in nsIAutoCompleteListener listener);

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

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