Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIFile; |
michael@0 | 9 | interface mozIPersonalDictionary; |
michael@0 | 10 | |
michael@0 | 11 | [scriptable, uuid(8ba643a4-7ddc-4662-b976-7ec123843f10)] |
michael@0 | 12 | |
michael@0 | 13 | /** |
michael@0 | 14 | * This interface represents a SpellChecker. |
michael@0 | 15 | */ |
michael@0 | 16 | |
michael@0 | 17 | interface mozISpellCheckingEngine : nsISupports { |
michael@0 | 18 | /** |
michael@0 | 19 | * The name of the current dictionary. Is either a value from |
michael@0 | 20 | * getDictionaryList or the empty string if no dictionary is selected. |
michael@0 | 21 | * Setting this attribute to a value not in getDictionaryList will throw |
michael@0 | 22 | * NS_ERROR_FILE_NOT_FOUND. |
michael@0 | 23 | * |
michael@0 | 24 | * The spellcheck engine will send a notification with |
michael@0 | 25 | * "spellcheck-dictionary-update" as topic when this changes. |
michael@0 | 26 | * If the dictionary is changed to no dictionary (the empty string), an |
michael@0 | 27 | * observer is allowed to set another dictionary before it returns. |
michael@0 | 28 | */ |
michael@0 | 29 | attribute wstring dictionary; |
michael@0 | 30 | |
michael@0 | 31 | /** |
michael@0 | 32 | * The language this spellchecker is using when checking |
michael@0 | 33 | * |
michael@0 | 34 | * The spellcheck engine will send a notification with |
michael@0 | 35 | * "spellcheck-dictionary-update" as topic when this changes. |
michael@0 | 36 | */ |
michael@0 | 37 | readonly attribute wstring language; |
michael@0 | 38 | |
michael@0 | 39 | /** |
michael@0 | 40 | * Does the engine provide its own personal dictionary? |
michael@0 | 41 | */ |
michael@0 | 42 | readonly attribute boolean providesPersonalDictionary; |
michael@0 | 43 | |
michael@0 | 44 | /** |
michael@0 | 45 | * Does the engine provide its own word utils? |
michael@0 | 46 | */ |
michael@0 | 47 | readonly attribute boolean providesWordUtils; |
michael@0 | 48 | |
michael@0 | 49 | /** |
michael@0 | 50 | * The name of the engine |
michael@0 | 51 | */ |
michael@0 | 52 | readonly attribute wstring name; |
michael@0 | 53 | |
michael@0 | 54 | /** |
michael@0 | 55 | * a string indicating the copyright of the engine |
michael@0 | 56 | */ |
michael@0 | 57 | readonly attribute wstring copyright; |
michael@0 | 58 | |
michael@0 | 59 | /** |
michael@0 | 60 | * the personal dictionary |
michael@0 | 61 | */ |
michael@0 | 62 | attribute mozIPersonalDictionary personalDictionary; |
michael@0 | 63 | |
michael@0 | 64 | /** |
michael@0 | 65 | * Get the list of dictionaries |
michael@0 | 66 | */ |
michael@0 | 67 | void getDictionaryList([array, size_is(count)] out wstring dictionaries, out uint32_t count); |
michael@0 | 68 | |
michael@0 | 69 | /** |
michael@0 | 70 | * check a word |
michael@0 | 71 | * |
michael@0 | 72 | * The spellcheck engine will send a notification with |
michael@0 | 73 | * "spellcheck-dictionary-update" as topic when this changes. |
michael@0 | 74 | */ |
michael@0 | 75 | boolean check(in wstring word); |
michael@0 | 76 | |
michael@0 | 77 | /** |
michael@0 | 78 | * get a list of suggestions for a misspelled word |
michael@0 | 79 | * |
michael@0 | 80 | * The spellcheck engine will send a notification with |
michael@0 | 81 | * "spellcheck-dictionary-update" as topic when this changes. |
michael@0 | 82 | */ |
michael@0 | 83 | void suggest(in wstring word,[array, size_is(count)] out wstring suggestions, out uint32_t count); |
michael@0 | 84 | |
michael@0 | 85 | /** |
michael@0 | 86 | * Load dictionaries from the specified dir |
michael@0 | 87 | */ |
michael@0 | 88 | void loadDictionariesFromDir(in nsIFile dir); |
michael@0 | 89 | |
michael@0 | 90 | /** |
michael@0 | 91 | * Add dictionaries from a directory to the spell checker |
michael@0 | 92 | */ |
michael@0 | 93 | void addDirectory(in nsIFile dir); |
michael@0 | 94 | |
michael@0 | 95 | /** |
michael@0 | 96 | * Remove dictionaries from a directory from the spell checker |
michael@0 | 97 | */ |
michael@0 | 98 | void removeDirectory(in nsIFile dir); |
michael@0 | 99 | }; |
michael@0 | 100 | |
michael@0 | 101 | %{C++ |
michael@0 | 102 | #define DICTIONARY_SEARCH_DIRECTORY "DictD" |
michael@0 | 103 | #define DICTIONARY_SEARCH_DIRECTORY_LIST "DictDL" |
michael@0 | 104 | |
michael@0 | 105 | #define SPELLCHECK_DICTIONARY_UPDATE_NOTIFICATION \ |
michael@0 | 106 | "spellcheck-dictionary-update" |
michael@0 | 107 | %} |