Public Member Functions | Public Attributes

nsILDAPAutoCompFormatter Interface Reference

An interface to allow different users of nsILDAPAutoCompleteSession to format each nsILDAPMessage into an nsIAutoCompleteItem as it sees fit. More...

import "nsILDAPAutoCompFormatter.idl";

Inheritance diagram for nsILDAPAutoCompFormatter:

List of all members.

Public Member Functions

nsIAutoCompleteItem format (in nsILDAPMessage aMessage)
 Returns an nsIAutoCompleteItem generated from the data in the given nsILDAPMessage.
void getAttributes (out unsigned long aCount,[retval, array, size_is(aCount)] out string aAttrs)
 Gets a list of all the LDAP attributes that should be requested from the LDAP server when a lookup is done.
nsIAutoCompleteItem formatException (in long aState, in nsresult aErrorCode)
 This method formats an error condition into an nsIAutoCompleteItem for display to the user.

Public Attributes

const long STATE_UNBOUND = 0
 Possible states that can be passed in aState to formatException.
const long STATE_INITIALIZING = 1
const long STATE_BINDING = 2
const long STATE_BOUND = 3
const long STATE_SEARCHING = 4

Detailed Description

An interface to allow different users of nsILDAPAutoCompleteSession to format each nsILDAPMessage into an nsIAutoCompleteItem as it sees fit.


Member Function Documentation

nsIAutoCompleteItem nsILDAPAutoCompFormatter::format ( in nsILDAPMessage  aMessage  ) 

Returns an nsIAutoCompleteItem generated from the data in the given nsILDAPMessage.

Parameters:
aMessage message to be formatted
Returns:
resulting nsIAutoCompleteItem
nsIAutoCompleteItem nsILDAPAutoCompFormatter::formatException ( in long  aState,
in nsresult  aErrorCode 
)

This method formats an error condition into an nsIAutoCompleteItem for display to the user.

Specifically, the state that the session was in when the error occured (aState) is formatted into a general error message which is put in the value attribute of the item, and the specific error (aErrorCode) is formatted into another message which is put in an nsISupportsString in the param attribute of the item.

Parameters:
aState state of autocomplete session when error occurred
aErrorCode specific error encountered
Returns:
newly generated item
void nsILDAPAutoCompFormatter::getAttributes ( out unsigned long  aCount,
[retval, array, size_is(aCount)] out string  aAttrs 
)

Gets a list of all the LDAP attributes that should be requested from the LDAP server when a lookup is done.

This avoids wasting server time, bandwidth, and client time processing unused attributes.

Note that this is only required to be called by the nsILDAPAutoCompleteSession implementation when the nsILDAPAutoCompleteSession::formatter IDL attribute is set. . So if for some reason, the LDAP attributes to be returned by searches has to change (eg because the user changed a preference), the nsILDAPAutoCompleteSession::formatter IDL attribute should be re-set to the same object to force a new getAttributes() call.

Parameters:
aCount number of attributes in the array
aAttrs list of LDAP attributes to request

Member Data Documentation

Possible states that can be passed in aState to formatException.


The documentation for this interface was generated from the following file: