michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIFile; michael@0: interface mozIPersonalDictionary; michael@0: michael@0: [scriptable, uuid(8ba643a4-7ddc-4662-b976-7ec123843f10)] michael@0: michael@0: /** michael@0: * This interface represents a SpellChecker. michael@0: */ michael@0: michael@0: interface mozISpellCheckingEngine : nsISupports { michael@0: /** michael@0: * The name of the current dictionary. Is either a value from michael@0: * getDictionaryList or the empty string if no dictionary is selected. michael@0: * Setting this attribute to a value not in getDictionaryList will throw michael@0: * NS_ERROR_FILE_NOT_FOUND. michael@0: * michael@0: * The spellcheck engine will send a notification with michael@0: * "spellcheck-dictionary-update" as topic when this changes. michael@0: * If the dictionary is changed to no dictionary (the empty string), an michael@0: * observer is allowed to set another dictionary before it returns. michael@0: */ michael@0: attribute wstring dictionary; michael@0: michael@0: /** michael@0: * The language this spellchecker is using when checking michael@0: * michael@0: * The spellcheck engine will send a notification with michael@0: * "spellcheck-dictionary-update" as topic when this changes. michael@0: */ michael@0: readonly attribute wstring language; michael@0: michael@0: /** michael@0: * Does the engine provide its own personal dictionary? michael@0: */ michael@0: readonly attribute boolean providesPersonalDictionary; michael@0: michael@0: /** michael@0: * Does the engine provide its own word utils? michael@0: */ michael@0: readonly attribute boolean providesWordUtils; michael@0: michael@0: /** michael@0: * The name of the engine michael@0: */ michael@0: readonly attribute wstring name; michael@0: michael@0: /** michael@0: * a string indicating the copyright of the engine michael@0: */ michael@0: readonly attribute wstring copyright; michael@0: michael@0: /** michael@0: * the personal dictionary michael@0: */ michael@0: attribute mozIPersonalDictionary personalDictionary; michael@0: michael@0: /** michael@0: * Get the list of dictionaries michael@0: */ michael@0: void getDictionaryList([array, size_is(count)] out wstring dictionaries, out uint32_t count); michael@0: michael@0: /** michael@0: * check a word michael@0: * michael@0: * The spellcheck engine will send a notification with michael@0: * "spellcheck-dictionary-update" as topic when this changes. michael@0: */ michael@0: boolean check(in wstring word); michael@0: michael@0: /** michael@0: * get a list of suggestions for a misspelled word michael@0: * michael@0: * The spellcheck engine will send a notification with michael@0: * "spellcheck-dictionary-update" as topic when this changes. michael@0: */ michael@0: void suggest(in wstring word,[array, size_is(count)] out wstring suggestions, out uint32_t count); michael@0: michael@0: /** michael@0: * Load dictionaries from the specified dir michael@0: */ michael@0: void loadDictionariesFromDir(in nsIFile dir); michael@0: michael@0: /** michael@0: * Add dictionaries from a directory to the spell checker michael@0: */ michael@0: void addDirectory(in nsIFile dir); michael@0: michael@0: /** michael@0: * Remove dictionaries from a directory from the spell checker michael@0: */ michael@0: void removeDirectory(in nsIFile dir); michael@0: }; michael@0: michael@0: %{C++ michael@0: #define DICTIONARY_SEARCH_DIRECTORY "DictD" michael@0: #define DICTIONARY_SEARCH_DIRECTORY_LIST "DictDL" michael@0: michael@0: #define SPELLCHECK_DICTIONARY_UPDATE_NOTIFICATION \ michael@0: "spellcheck-dictionary-update" michael@0: %}