Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsISpellChecker Class Reference

A generic interface for a spelling checker. More...

#include <nsISpellChecker.h>

Inheritance diagram for nsISpellChecker:
Inheritance graph
[legend]
Collaboration diagram for nsISpellChecker:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_IMETHOD SetDocument (nsITextServicesDocument *aDoc, PRBool aFromStartofDoc)=0
 Tells the spellchecker what document to check.
NS_IMETHOD NextMisspelledWord (nsAString &aWord, nsStringArray *aSuggestions)=0
 Selects (hilites) the next misspelled word in the document.
NS_IMETHOD CheckWord (const nsAString &aWord, PRBool *aIsMisspelled, nsStringArray *aSuggestions)=0
 Checks if a word is misspelled.
NS_IMETHOD Replace (const nsAString &aOldWord, const nsAString &aNewWord, PRBool aAllOccurrences)=0
 Replaces the old word with the specified new word.
NS_IMETHOD IgnoreAll (const nsAString &aWord)=0
 Ignores all occurrences of the specified word in the document.
NS_IMETHOD AddWordToPersonalDictionary (const nsAString &aWord)=0
 Add a word to the user's personal dictionary.
NS_IMETHOD RemoveWordFromPersonalDictionary (const nsAString &aWord)=0
 Remove a word from the user's personal dictionary.
NS_IMETHOD GetPersonalDictionary (nsStringArray *aWordList)=0
 Returns the list of words in the user's personal dictionary.
NS_IMETHOD GetDictionaryList (nsStringArray *aDictionaryList)=0
 Returns the list of strings representing the dictionaries the spellchecker supports.
NS_IMETHOD GetCurrentDictionary (nsAString &aDictionary)=0
 Returns a string representing the current dictionary.
NS_IMETHOD SetCurrentDictionary (const nsAString &aDictionary)=0
 Tells the spellchecker to use a specific dictionary.

Detailed Description

A generic interface for a spelling checker.

Definition at line 57 of file nsISpellChecker.h.


Member Function Documentation

NS_IMETHOD nsISpellChecker::AddWordToPersonalDictionary ( const nsAString &  aWord) [pure virtual]

Add a word to the user's personal dictionary.

Parameters:
aWordis the word to add.

Implemented in mozSpellChecker.

NS_IMETHOD nsISpellChecker::CheckWord ( const nsAString &  aWord,
PRBool aIsMisspelled,
nsStringArray *  aSuggestions 
) [pure virtual]

Checks if a word is misspelled.

No document is required to use this method.

Parameters:
aWordis the word to check.
aIsMisspelledwill be set to true if the word is misspelled.
aSuggestionsis an array of nsStrings which represent the suggested replacements for the misspelled word. The array will be empty if there aren't any suggestions.

Implemented in mozSpellChecker.

NS_IMETHOD nsISpellChecker::GetCurrentDictionary ( nsAString &  aDictionary) [pure virtual]

Returns a string representing the current dictionary.

Parameters:
aDictionarywill contain the name of the dictionary. This name is the same string that is in the list returned by GetDictionaryList().

Implemented in mozSpellChecker.

NS_IMETHOD nsISpellChecker::GetDictionaryList ( nsStringArray *  aDictionaryList) [pure virtual]

Returns the list of strings representing the dictionaries the spellchecker supports.

It was suggested that the strings returned be in the RFC 1766 format. This format looks something like <ISO 639 language code>-<ISO 3166 country code>. For example: en-US

Parameters:
aDictionaryListis an array of nsStrings that represent the dictionaries supported by the spellchecker.

Implemented in mozSpellChecker.

NS_IMETHOD nsISpellChecker::GetPersonalDictionary ( nsStringArray *  aWordList) [pure virtual]

Returns the list of words in the user's personal dictionary.

Parameters:
aWordListis an array of nsStrings that represent the list of words in the user's personal dictionary.

Implemented in mozSpellChecker.

NS_IMETHOD nsISpellChecker::IgnoreAll ( const nsAString &  aWord) [pure virtual]

Ignores all occurrences of the specified word in the document.

Parameters:
aWordis the word to ignore.

Implemented in mozSpellChecker.

NS_IMETHOD nsISpellChecker::NextMisspelledWord ( nsAString &  aWord,
nsStringArray *  aSuggestions 
) [pure virtual]

Selects (hilites) the next misspelled word in the document.

Parameters:
aWordwill contain the misspelled word.
aSuggestionsis an array of nsStrings, that represent the suggested replacements for the misspelled word.

Implemented in mozSpellChecker.

Remove a word from the user's personal dictionary.

Parameters:
aWordis the word to remove.

Implemented in mozSpellChecker.

NS_IMETHOD nsISpellChecker::Replace ( const nsAString &  aOldWord,
const nsAString &  aNewWord,
PRBool  aAllOccurrences 
) [pure virtual]

Replaces the old word with the specified new word.

Parameters:
aOldWordis the word to be replaced.
aNewWordis the word that is to replace old word.
aAllOccurrenceswill replace all occurrences of old word, in the document, with new word when it is true. If false, it will replace the 1st occurrence only!

Implemented in mozSpellChecker.

NS_IMETHOD nsISpellChecker::SetCurrentDictionary ( const nsAString &  aDictionary) [pure virtual]

Tells the spellchecker to use a specific dictionary.

Parameters:
aDictionarya string that is in the list returned by GetDictionaryList().

Implemented in mozSpellChecker.

NS_IMETHOD nsISpellChecker::SetDocument ( nsITextServicesDocument aDoc,
PRBool  aFromStartofDoc 
) [pure virtual]

Tells the spellchecker what document to check.

Parameters:
aDocis the document to check.
aFromStartOfDocIf true, start check from beginning of document, if false, start check from current cursor position.

Implemented in mozSpellChecker.


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