1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
10 interface mozIPersonalDictionary
;
13 * This interface represents a SpellChecker.
15 [scriptable
, uuid(8ba643a4
-7ddc
-4662-b976
-7ec123843f10
)]
16 interface mozISpellCheckingEngine
: nsISupports
{
18 * The names of the dictionaries currently used. These are either values
19 * from getDictionaryList or the empty array if no dictionary is selected.
20 * Setting this attribute to contain a value not in getDictionaryList will
21 * throw NS_ERROR_FILE_NOT_FOUND.
23 * If the dictionaries are changed to no dictionary (the empty array), an
24 * observer is allowed to set another dictionary before it returns.
26 attribute Array
<ACString
> dictionaries
;
29 * the personal dictionary
31 attribute mozIPersonalDictionary personalDictionary
;
34 * Get the list of dictionaries
36 Array
<ACString
> getDictionaryList
();
41 boolean check
(in AString word
);
44 * get a list of suggestions for a misspelled word
46 Array
<AString
> suggest
(in AString word
);
49 * Load dictionaries from the specified dir
51 void loadDictionariesFromDir
(in nsIFile dir
);
54 * Add dictionaries from a directory to the spell checker
56 void addDirectory
(in nsIFile dir
);
59 * Remove dictionaries from a directory from the spell checker
61 void removeDirectory
(in nsIFile dir
);
64 * Add a dictionary with the given language code and source URI. The URI
65 * must point to an affix file, with the ".aff" extension. The word list
66 * file must be in the same directory, with the same base name, and the
69 void addDictionary
(in AString lang
, in nsIURI file
);
72 * Remove a dictionary with the given language code and path. If the path does
73 * not match that of the current entry with the given language code, it is not
76 * @returns True if the dictionary was found and removed.
78 bool removeDictionary
(in AString lang
, in nsIURI file
);
82 #define SPELLCHECK_DICTIONARY_REMOVE_NOTIFICATION \
83 "spellcheck-dictionary-remove"