Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes
nsFormHistoryResult Class Reference
Inheritance diagram for nsFormHistoryResult:
Inheritance graph
[legend]
Collaboration diagram for nsFormHistoryResult:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsFormHistoryResult (const nsAString &aFieldName)
nsresult Init ()
NS_DECL_ISUPPORTS NS_IMETHOD GetSearchString (nsAString &_result)
NS_IMETHOD GetSearchResult (PRUint16 *_result)
NS_IMETHOD GetDefaultIndex (PRInt32 *_result)
NS_IMETHOD GetErrorDescription (nsAString &_result)
NS_IMETHOD GetMatchCount (PRUint32 *_result)
NS_IMETHOD GetValueAt (PRInt32 aIndex, nsAString &_result)
NS_IMETHOD GetCommentAt (PRInt32 aIndex, nsAString &_result)
NS_IMETHOD GetStyleAt (PRInt32 aIndex, nsAString &_result)
NS_IMETHOD RemoveValueAt (PRInt32 aRowIndex, PRBool aRemoveFromDB)
void setSearchString (in AString aSearchString)
 A writer for the readonly attribute 'searchString' which should contain the string that the user typed.
void setErrorDescription (in AString aErrorDescription)
 A writer for the readonly attribute 'errorDescription'.
void setDefaultIndex (in long aDefaultIndex)
 A writer for the readonly attribute 'defaultIndex' which should contain the index of the list that will be selected by default (normally 0).
void setSearchResult (in unsigned short aSearchResult)
 A writer for the readonly attribute 'searchResult' which should contain one of the constants nsIAutoCompleteResult.RESULT_* indicating the success of the search.
void appendMatch (in AString aValue, in AString aComment)
 Appends a result item consisting of the given value and comment.
AString getValueAt (in long index)
 Get the value of the result at the given index.
AString getCommentAt (in long index)
 Get the comment of the result at the given index.
AString getStyleAt (in long index)
 Get the style hint for the result at the given index.
void removeValueAt (in long rowIndex, in boolean removeFromDb)
 Remove the value at the given index from the autocomplete results.

Public Attributes

const unsigned short RESULT_IGNORED = 1
 Possible values for the searchResult attribute.
const unsigned short RESULT_FAILURE = 2
const unsigned short RESULT_NOMATCH = 3
const unsigned short RESULT_SUCCESS = 4
readonly attribute AString searchString
 The original search string.
readonly attribute unsigned short searchResult
 The result of the search.
readonly attribute long defaultIndex
 Index of the default item that should be entered if none is selected.
readonly attribute AString errorDescription
 A string describing the cause of a search failure.
readonly attribute unsigned long matchCount
 The number of matches.

Protected Attributes

nsCOMPtr
< nsIAutoCompleteSimpleResult
mResult
nsString mFieldName

Detailed Description

Definition at line 78 of file nsStorageFormHistory.cpp.


Constructor & Destructor Documentation

nsFormHistoryResult::nsFormHistoryResult ( const nsAString &  aFieldName) [inline]

Definition at line 81 of file nsStorageFormHistory.cpp.

    : mFieldName(aFieldName) {}

Here is the caller graph for this function:


Member Function Documentation

void nsIAutoCompleteSimpleResult::appendMatch ( in AString  aValue,
in AString  aComment 
) [inherited]

Appends a result item consisting of the given value and comment.

This is how you add results.

AString nsIAutoCompleteResult::getCommentAt ( in long  index) [inherited]

Get the comment of the result at the given index.

NS_IMETHOD nsFormHistoryResult::GetCommentAt ( PRInt32  aIndex,
nsAString &  _result 
) [inline]

Definition at line 101 of file nsStorageFormHistory.cpp.

  { return mResult->GetCommentAt(aIndex, _result); }

Definition at line 93 of file nsStorageFormHistory.cpp.

  { return mResult->GetDefaultIndex(_result); }
NS_IMETHOD nsFormHistoryResult::GetErrorDescription ( nsAString &  _result) [inline]

Definition at line 95 of file nsStorageFormHistory.cpp.

  { return mResult->GetErrorDescription(_result); }

Definition at line 97 of file nsStorageFormHistory.cpp.

  { return mResult->GetMatchCount(_result); }

Definition at line 91 of file nsStorageFormHistory.cpp.

  { return mResult->GetSearchResult(_result); }

Definition at line 89 of file nsStorageFormHistory.cpp.

  { return mResult->GetSearchString(_result); }
AString nsIAutoCompleteResult::getStyleAt ( in long  index) [inherited]

Get the style hint for the result at the given index.

NS_IMETHOD nsFormHistoryResult::GetStyleAt ( PRInt32  aIndex,
nsAString &  _result 
) [inline]

Definition at line 103 of file nsStorageFormHistory.cpp.

  { return mResult->GetStyleAt(aIndex, _result); }
AString nsIAutoCompleteResult::getValueAt ( in long  index) [inherited]

Get the value of the result at the given index.

NS_IMETHOD nsFormHistoryResult::GetValueAt ( PRInt32  aIndex,
nsAString &  _result 
) [inline]

Definition at line 99 of file nsStorageFormHistory.cpp.

  { return mResult->GetValueAt(aIndex, _result); }
void nsIAutoCompleteResult::removeValueAt ( in long  rowIndex,
in boolean  removeFromDb 
) [inherited]

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.

NS_IMETHODIMP nsFormHistoryResult::RemoveValueAt ( PRInt32  aRowIndex,
PRBool  aRemoveFromDB 
)

Definition at line 125 of file nsStorageFormHistory.cpp.

{
  if (!aRemoveFromDB) {
    return mResult->RemoveValueAt(aRowIndex, aRemoveFromDB);
  }

  nsAutoString value;
  nsresult rv = mResult->GetValueAt(aRowIndex, value);
  NS_ENSURE_SUCCESS(rv, rv);

  rv = mResult->RemoveValueAt(aRowIndex, aRemoveFromDB);
  NS_ENSURE_SUCCESS(rv, rv);

  nsFormHistory* fh = nsFormHistory::GetInstance();
  NS_ENSURE_TRUE(fh, NS_ERROR_OUT_OF_MEMORY);
  return fh->RemoveEntry(mFieldName, value);
}

Here is the call graph for this function:

void nsIAutoCompleteSimpleResult::setDefaultIndex ( in long  aDefaultIndex) [inherited]

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

void nsIAutoCompleteSimpleResult::setErrorDescription ( in AString  aErrorDescription) [inherited]

A writer for the readonly attribute 'errorDescription'.

void nsIAutoCompleteSimpleResult::setSearchResult ( in unsigned short  aSearchResult) [inherited]

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

void nsIAutoCompleteSimpleResult::setSearchString ( in AString  aSearchString) [inherited]

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


Member Data Documentation

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

Definition at line 64 of file nsIAutoCompleteResult.idl.

readonly attribute AString nsIAutoCompleteResult::errorDescription [inherited]

A string describing the cause of a search failure.

Definition at line 69 of file nsIAutoCompleteResult.idl.

readonly attribute unsigned long nsIAutoCompleteResult::matchCount [inherited]

The number of matches.

Definition at line 74 of file nsIAutoCompleteResult.idl.

Definition at line 110 of file nsStorageFormHistory.cpp.

Definition at line 109 of file nsStorageFormHistory.cpp.

const unsigned short nsIAutoCompleteResult::RESULT_FAILURE = 2 [inherited]

Definition at line 47 of file nsIAutoCompleteResult.idl.

const unsigned short nsIAutoCompleteResult::RESULT_IGNORED = 1 [inherited]

Possible values for the searchResult attribute.

Definition at line 46 of file nsIAutoCompleteResult.idl.

const unsigned short nsIAutoCompleteResult::RESULT_NOMATCH = 3 [inherited]

Definition at line 48 of file nsIAutoCompleteResult.idl.

const unsigned short nsIAutoCompleteResult::RESULT_SUCCESS = 4 [inherited]

Definition at line 49 of file nsIAutoCompleteResult.idl.

readonly attribute unsigned short nsIAutoCompleteResult::searchResult [inherited]

The result of the search.

Definition at line 59 of file nsIAutoCompleteResult.idl.

readonly attribute AString nsIAutoCompleteResult::searchString [inherited]

The original search string.

Definition at line 54 of file nsIAutoCompleteResult.idl.


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