2003-07-25 01:39:28 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2003-07-25 01:39:28 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2011-02-18 03:09:40 +03:00
|
|
|
interface nsIFile;
|
2003-07-25 01:39:28 +04:00
|
|
|
interface mozIPersonalDictionary;
|
|
|
|
|
2011-09-13 22:58:54 +04:00
|
|
|
[scriptable, uuid(8ba643a4-7ddc-4662-b976-7ec123843f10)]
|
2003-07-25 01:39:28 +04:00
|
|
|
|
|
|
|
/**
|
2004-01-12 15:13:57 +03:00
|
|
|
* This interface represents a SpellChecker.
|
|
|
|
*/
|
2003-07-25 01:39:28 +04:00
|
|
|
|
|
|
|
interface mozISpellCheckingEngine : nsISupports {
|
2004-01-12 15:13:57 +03:00
|
|
|
/**
|
2011-09-13 22:58:54 +04:00
|
|
|
* The name of the current dictionary. Is either a value from
|
|
|
|
* getDictionaryList or the empty string if no dictionary is selected.
|
|
|
|
* Setting this attribute to a value not in getDictionaryList will throw
|
|
|
|
* NS_ERROR_FILE_NOT_FOUND.
|
|
|
|
*
|
|
|
|
* If the dictionary is changed to no dictionary (the empty string), an
|
|
|
|
* observer is allowed to set another dictionary before it returns.
|
2004-01-12 15:13:57 +03:00
|
|
|
*/
|
2003-07-25 01:39:28 +04:00
|
|
|
attribute wstring dictionary;
|
|
|
|
|
2004-01-12 15:13:57 +03:00
|
|
|
/**
|
|
|
|
* The language this spellchecker is using when checking
|
|
|
|
*/
|
2003-07-25 01:39:28 +04:00
|
|
|
readonly attribute wstring language;
|
|
|
|
|
2004-01-12 15:13:57 +03:00
|
|
|
/**
|
|
|
|
* Does the engine provide its own personal dictionary?
|
|
|
|
*/
|
2003-07-25 01:39:28 +04:00
|
|
|
readonly attribute boolean providesPersonalDictionary;
|
|
|
|
|
2004-01-12 15:13:57 +03:00
|
|
|
/**
|
|
|
|
* Does the engine provide its own word utils?
|
|
|
|
*/
|
2003-07-25 01:39:28 +04:00
|
|
|
readonly attribute boolean providesWordUtils;
|
|
|
|
|
2004-01-12 15:13:57 +03:00
|
|
|
/**
|
|
|
|
* The name of the engine
|
|
|
|
*/
|
2003-07-25 01:39:28 +04:00
|
|
|
readonly attribute wstring name;
|
|
|
|
|
2004-01-12 15:13:57 +03:00
|
|
|
/**
|
|
|
|
* a string indicating the copyright of the engine
|
|
|
|
*/
|
2003-07-25 01:39:28 +04:00
|
|
|
readonly attribute wstring copyright;
|
|
|
|
|
2004-01-12 15:13:57 +03:00
|
|
|
/**
|
|
|
|
* the personal dictionary
|
|
|
|
*/
|
2003-07-25 01:39:28 +04:00
|
|
|
attribute mozIPersonalDictionary personalDictionary;
|
|
|
|
|
2004-01-12 15:13:57 +03:00
|
|
|
/**
|
|
|
|
* Get the list of dictionaries
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
void getDictionaryList([array, size_is(count)] out wstring dictionaries, out uint32_t count);
|
2003-07-25 01:39:28 +04:00
|
|
|
|
2004-01-12 15:13:57 +03:00
|
|
|
/**
|
|
|
|
* check a word
|
|
|
|
*/
|
|
|
|
boolean check(in wstring word);
|
2003-07-25 01:39:28 +04:00
|
|
|
|
2004-01-12 15:13:57 +03:00
|
|
|
/**
|
|
|
|
* get a list of suggestions for a misspelled word
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
void suggest(in wstring word,[array, size_is(count)] out wstring suggestions, out uint32_t count);
|
2011-02-18 03:09:40 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Load dictionaries from the specified dir
|
|
|
|
*/
|
|
|
|
void loadDictionariesFromDir(in nsIFile dir);
|
2011-09-13 22:58:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add dictionaries from a directory to the spell checker
|
|
|
|
*/
|
|
|
|
void addDirectory(in nsIFile dir);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove dictionaries from a directory from the spell checker
|
|
|
|
*/
|
|
|
|
void removeDirectory(in nsIFile dir);
|
2003-07-25 01:39:28 +04:00
|
|
|
};
|
2006-06-29 10:03:12 +04:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
#define DICTIONARY_SEARCH_DIRECTORY "DictD"
|
|
|
|
#define DICTIONARY_SEARCH_DIRECTORY_LIST "DictDL"
|
2011-09-13 22:58:54 +04:00
|
|
|
|
2015-09-15 09:05:10 +03:00
|
|
|
#define SPELLCHECK_DICTIONARY_REMOVE_NOTIFICATION \
|
|
|
|
"spellcheck-dictionary-remove"
|
2006-06-29 10:03:12 +04:00
|
|
|
%}
|