nsISupports
Last changed in Gecko 1.7 This interface represents a spell checking engine. The built in Hunspell engine has contract ID "@mozilla.org/spellchecker/engine;1". Extensions can use this interface to check spelling or provide its own spell checker to editors.
void addDirectory(in |
boolean check(in wstring word); |
void getDictionaryList([array, size_is(count)] out wstring dictionaries, out PRUint32 count); |
void removeDirectory(in |
void suggest(in wstring word,[array, size_is(count)] out wstring suggestions, out PRUint32 count); |
| Attribute | Type | Description |
copyright |
wstring |
A string indicating the copyright of the engine. Not currently used. Read only. |
dictionary |
wstring |
The name of the current
Note: Setting this value to a value that doesn't match an existing dictionary throws a
NS_ERROR_FILE_NOT_FOUND exception.When this attribute's value is changed, a "spellcheck-dictionary-update" notification is sent. If the dictionary was set to "no dictionary" (that is, by specifying an empty string), the observer may select another dictionary before returning. |
language |
wstring |
The When this changes, the spell checker sends a "spellcheck-dictionary-update" notification. |
name |
wstring |
The name of the engine. Not currently used. Read only. |
personalDictionary |
mozIPersonalDictionary |
The personal dictionary. |
providesPersonalDictionary |
boolean |
Does the engine provide its own personalDictionary? Read only. |
providesWordUtils |
boolean |
Does the engine provide its own word utilities? Read only. |
Adds all the dictionaries in the specified directory to the spell checker.
void addDirectory( nsIFile dir );
dirnsIFile object indicating the directory from which to add dictionaries.Checks a word to determine if it's spelled correctly.
When this changes, the spell checker sends a "spellcheck-dictionary-update" notification.
boolean check( in wstring word );
wordReturns true if word is spelled correctly according to the dictionary attribute, and returns false if word is misspelled.
Gets the list of dictionaries.
void getDictionaryList( [array, size_is(count)] out wstring dictionaries, out PRUint32 count );
dictionariesdictionary attribute can be set to one of these. Each dictionary name is typically but not always a locale code.countdictionaries.Removes all the dictionaries in the specified directory from the spell checker.
void removeDirectory( nsIFile dir );
dirnsIFile object indicating the directory whose spell checkers are to be removed from the spell checker.Gets a list of suggestions for a misspelled word.
When this changes, the spell checker sends a "spellcheck-dictionary-update" notification.
void suggest( in wstring word, [array, size_is(count)] out wstring suggestions, out PRUint32 count );
wordcheck.suggestionsword.countsuggestions.