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 );
dir
nsIFile
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 );
word
Returns 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 );
dictionaries
dictionary
attribute can be set to one of these. Each dictionary name is typically but not always a locale code.count
dictionaries
.Removes all the dictionaries in the specified directory from the spell checker.
void removeDirectory( nsIFile dir );
dir
nsIFile
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 );
word
check.
suggestions
word
.count
suggestions
.