/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * The contents of this file are subject to the Mozilla 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/MPL/
 * 
 * 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) 2001 Netscape Communications Corporation.  All
 * Rights Reserved.
 * 
 * Contributor(s): Dan Mosedale <dmose@netscape.com> (Original Author)
 *
 */

#include "nsIAutoCompleteSession.idl"

interface nsILDAPURL;   // forward decl

/**
 * Extends nsIAutoCompleteSession to have various LDAP-specific parameters.
 * and output format.
 */
[scriptable, uuid(82b6a78e-1dd2-11b2-a3d0-876e20e7b350)]
interface nsILDAPAutoCompleteSession : nsIAutoCompleteSession {

    /**
     * A template used to construct the RFC 1960 LDAP search filter to use 
     * while autocompleting.  
     *
     * XXX syntax to-be-determined in an upcoming checkin
     * 
     * @exception NS_ERROR_NULL_POINTER     NULL pointer passed to getter
     * @exception NS_ERROR_OUT_OF_MEMORY    Getter couldn't allocate string
     */
    attribute wstring filterTemplate;

    /**
     * A template for formatting the autocompletion results.  
     * 
     * XXX syntax to-be-determined
     *
     * @exception NS_ERROR_NULL_POINTER     NULL pointer passed to getter
     * @exception NS_ERROR_OUT_OF_MEMORY    Getter couldn't allocate string
     */
    attribute wstring outputFormat;

    /**
     * If non-zero, limit lookups to at most this many entries.  If this
     * limit is hit during a lookup, the search will simply return 
     * |nsIAutoCompleteStatus::ignored|.
     *
     * @exception NS_ERROR_NULL_POINTER  NULL pointer passed to getter
     */
    attribute long sizeLimit;

    /**
     * Strings shorter than this will return |nsIAutoCompleteStatus::ignored|
     * rather than triggering a search.  This allows browsers to be
     * configured to not search on substrings so short that they
     * aren't indexed by the LDAP server (such searches can use significantly 
     * more server resources and return a very large number of entries).
     * The default is 0, meaning that no such limit is in effect.
     * 
     * @exception NS_ERROR_NULL_POINTER  NULL pointer passed to getter
     */
    attribute unsigned long minStringLength;

    /**
     * LDAP server to complete against, in ldap: URL format.  
     * May change to an nsILDAPServer once that infrastructure lands.
     *
     * @exception NS_ERROR_NULL_POINTER     NULL pointer passed to getter    
     */
    attribute nsILDAPURL serverURL;
};
