/* -*- 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"
#include "nsIAutoCompleteResults.idl"


typedef long AutoCompleteStatus;

[scriptable, uuid(4BA0A180-097C-11d4-A449-CD1A8B47ED7C)]
interface nsIAutoCompleteStatus {
    const long failed           = -1;
    const long noMatch          = 0;
    const long matchFound       = 1;
    const long ignored          = 2;

    // like failed, in that no successful matches were found, however,
    // results should be displayed anyway, because they contain info about  
    // the failure in question
    //
    const long failureItems     = 3;    

    // the following status values indicate that the async search hasn't ended
    const long noMatchYet       = 4;
    const long matchSoFar       = 5;
};

[scriptable, uuid(4BA0A181-097C-11d4-A449-CD1A8B47ED7C)]
interface nsIAutoCompleteListener : nsISupports {

    /* onStatus is called by the autocomplete session during the search */
    void onStatus(in wstring statusText);

    /* onAutoComplete is called by the autocomplete session when the search is done or over */
    void onAutoComplete(in nsIAutoCompleteResults result, in AutoCompleteStatus status);
    
    /* private param used by the autocomplete widget */
    attribute nsISupports param;
};
