Struct xpcom::interfaces::nsIAutoCompleteSimpleResult [] [src]

#[repr(C)]
pub struct nsIAutoCompleteSimpleResult { /* fields omitted */ }

interface nsIAutoCompleteSimpleResult : nsIAutoCompleteResult

/**
 * This class implements nsIAutoCompleteResult and provides simple methods
 * for setting the value and result items. It can be used whenever some basic
 * auto complete results are needed that can be pre-generated and filled into
 * an array.
 */

Methods

impl nsIAutoCompleteSimpleResult
[src]

[src]

Cast this nsIAutoCompleteSimpleResult to one of its base interfaces.

impl nsIAutoCompleteSimpleResult
[src]

[src]

/**
   * A writer for the readonly attribute 'searchString' which should contain
   * the string that the user typed.
   */

void setSearchString (in AString aSearchString);

[src]

/**
   * A writer for the readonly attribute 'errorDescription'.
   */

void setErrorDescription (in AString aErrorDescription);

[src]

/**
   * A writer for the readonly attribute 'defaultIndex' which should contain
   * the index of the list that will be selected by default (normally 0).
   */

void setDefaultIndex (in long aDefaultIndex);

[src]

/**
   * A writer for the readonly attribute 'searchResult' which should contain
   * one of the constants nsIAutoCompleteResult.RESULT_* indicating the success
   * of the search.
   */

void setSearchResult (in unsigned short aSearchResult);

[src]

/**
   * Inserts a match consisting of the given value, comment, image, style and
   * the value to use for defaultIndex completion at a given position.
   * @param aIndex
   *        The index to insert at
   * @param aValue
   *        The value to autocomplete to
   * @param aComment
   *        Comment shown in the autocomplete widget to describe this match
   * @param aImage
   *        Image shown in the autocomplete widget for this match.
   * @param aStyle
   *        Describes how to style the match in the autocomplete widget
   * @param aFinalCompleteValue
   *        Value used when the user confirms selecting this match. If not
   *        provided, aValue will be used.
   */

void insertMatchAt (in long aIndex, in AString aValue, in AString aComment, [optional] in AString aImage, [optional] in AString aStyle, [optional] in AString aFinalCompleteValue, [optional] in AString aLabel);

[src]

/**
   * Appends a match consisting of the given value, comment, image, style and
   * the value to use for defaultIndex completion.
   * @param aValue
   *        The value to autocomplete to
   * @param aComment
   *        Comment shown in the autocomplete widget to describe this match
   * @param aImage
   *        Image shown in the autocomplete widget for this match.
   * @param aStyle
   *        Describes how to style the match in the autocomplete widget
   * @param aFinalCompleteValue
   *        Value used when the user confirms selecting this match. If not
   *        provided, aValue will be used.
   */

void appendMatch (in AString aValue, in AString aComment, [optional] in AString aImage, [optional] in AString aStyle, [optional] in AString aFinalCompleteValue, [optional] in AString aLabel);

[src]

/**
   * Removes an existing match.
   * @note this is different from removeValueAt, since it's not a consequence of
   * a user action, and as such it won't notify onValueRemoved.
   */

void removeMatchAt (in long aIndex);

[src]

/**
   * Gets the listener for changes in the result.
   */

nsIAutoCompleteSimpleResultListener getListener ();

[src]

/**
   * Sets a listener for changes in the result.
   */

void setListener (in nsIAutoCompleteSimpleResultListener aListener);

Methods from Deref<Target = nsIAutoCompleteResult>

[src]

Cast this nsIAutoCompleteResult to one of its base interfaces.

[src]

/**
   * The original search string
   */

readonly attribute AString searchString;

[src]

/**
   * The result of the search
   */

readonly attribute unsigned short searchResult;

[src]

/**
   * Index of the default item that should be entered if none is selected
   */

readonly attribute long defaultIndex;

[src]

/**
   * A string describing the cause of a search failure
   */

readonly attribute AString errorDescription;

[src]

/**
   * The number of matches
   */

readonly attribute unsigned long matchCount;

[src]

/**
   * Get the value of the result at the given index
   */

AString getValueAt (in long index);

[src]

/**
   * This returns the string that is displayed in the dropdown
   */

AString getLabelAt (in long index);

[src]

/**
   * Get the comment of the result at the given index
   */

AString getCommentAt (in long index);

[src]

/**
   * Get the style hint for the result at the given index
   */

AString getStyleAt (in long index);

[src]

/**
   * Get the image of the result at the given index
   */

AString getImageAt (in long index);

[src]

/**
   * Get the final value that should be completed when the user confirms
   * the match at the given index.
   */

AString getFinalCompleteValueAt (in long index);

[src]

/**
   * Remove the value at the given index from the autocomplete results.
   * If removeFromDb is set to true, the value should be removed from
   * persistent storage as well.
   */

void removeValueAt (in long rowIndex, in boolean removeFromDb);

Trait Implementations

impl XpCom for nsIAutoCompleteSimpleResult
[src]

IID: nsIID = nsID(601791638, 48843, 19725, [169, 187, 29, 19, 28, 227, 97, 181])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsIAutoCompleteSimpleResult
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIAutoCompleteSimpleResult
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.