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 nsIStringEnumerator; michael@0: michael@0: [scriptable, uuid(7EF52EAF-B7E1-462B-87E2-5D1DBACA9048)] michael@0: michael@0: /** michael@0: * This interface represents a Personal Dictionary. michael@0: */ michael@0: michael@0: interface mozIPersonalDictionary : nsISupports { michael@0: michael@0: /** michael@0: * Load the dictionary michael@0: */ michael@0: void load(); michael@0: michael@0: /** michael@0: * Save the dictionary michael@0: */ michael@0: void save(); michael@0: michael@0: /** michael@0: * Get the (lexicographically sorted) list of words michael@0: */ michael@0: readonly attribute nsIStringEnumerator wordList; michael@0: michael@0: /** michael@0: * Check a unicode string michael@0: */ michael@0: boolean check(in wstring word, in wstring lang); michael@0: michael@0: /** michael@0: * Add a word to the personal dictionary michael@0: */ michael@0: void addWord(in wstring word, in wstring lang); michael@0: michael@0: /** michael@0: * Remove a word from the personal dictionary michael@0: */ michael@0: void removeWord(in wstring word, in wstring lang); michael@0: michael@0: /** michael@0: * Add a word to the ignore all list michael@0: */ michael@0: void ignoreWord(in wstring word); michael@0: michael@0: /** michael@0: * Clear the ignore list michael@0: */ michael@0: void endSession(); michael@0: michael@0: /** michael@0: * These three functions are here in case we want to store previous michael@0: * misspellings and return them at the head of the misspell list. michael@0: */ michael@0: michael@0: /** michael@0: * Add a misspelling to the list of corrections michael@0: */ michael@0: void addCorrection(in wstring word,in wstring correction, in wstring lang); michael@0: michael@0: /** michael@0: * Remove a misspelling from the list of corrections michael@0: */ michael@0: void removeCorrection(in wstring word,in wstring correction, in wstring lang); michael@0: michael@0: /** michael@0: * Get a list of previous corrections for the word michael@0: */ michael@0: void getCorrection(in wstring word, [array, size_is(count)] out wstring words, out uint32_t count); michael@0: };