Bug 1869043 add a main thread record of track audio outputs r=padenot
[gecko.git] / extensions / spellcheck / idl / mozISpellCheckingEngine.idl
blobf3e67280f6fe6fb4e23e595221398d9fc890f972
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"
8 interface nsIFile;
9 interface nsIURI;
10 interface mozIPersonalDictionary;
12 /**
13 * This interface represents a SpellChecker.
15 [scriptable, uuid(8ba643a4-7ddc-4662-b976-7ec123843f10)]
16 interface mozISpellCheckingEngine : nsISupports {
17 /**
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;
28 /**
29 * the personal dictionary
31 attribute mozIPersonalDictionary personalDictionary;
33 /**
34 * Get the list of dictionaries
36 Array<ACString> getDictionaryList();
38 /**
39 * check a word
41 boolean check(in AString word);
43 /**
44 * get a list of suggestions for a misspelled word
46 Array<AString> suggest(in AString word);
48 /**
49 * Load dictionaries from the specified dir
51 void loadDictionariesFromDir(in nsIFile dir);
53 /**
54 * Add dictionaries from a directory to the spell checker
56 void addDirectory(in nsIFile dir);
58 /**
59 * Remove dictionaries from a directory from the spell checker
61 void removeDirectory(in nsIFile dir);
63 /**
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
67 * ".dic" extension.
69 void addDictionary(in AString lang, in nsIURI file);
71 /**
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
74 * removed.
76 * @returns True if the dictionary was found and removed.
78 bool removeDictionary(in AString lang, in nsIURI file);
81 %{C++
82 #define SPELLCHECK_DICTIONARY_REMOVE_NOTIFICATION \
83 "spellcheck-dictionary-remove"