1
/*******************************************************************************
2
* Copyright (c) 2000, 2007 IBM Corporation and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* IBM Corporation - initial API and implementation
10
* Sergey Prigogin (Google)
11
*******************************************************************************/
13
package org.eclipse.cdt.internal.ui.text.spelling.engine;
15
import java.util.Locale;
17
import org.eclipse.cdt.internal.ui.text.spelling.SpellingPreferences;
20
* Interface for a spell check engine.
22
* This engine can be configured with multiple
26
public interface ISpellCheckEngine {
29
* Returns a spell checker configured with the global
30
* dictionaries and the locale dictionary that correspond to the current
31
* {@linkplain SpellingPreferences#getSpellingLocale() locale preference}.
33
* <strong>Note:</strong> Changes to the spelling engine dictionaries
34
* are not propagated to this spell checker.</p>
36
* @return a configured instance of the spell checker or <code>null</code> if none
37
* @throws IllegalStateException if called after being shut down
39
ISpellChecker getSpellChecker() throws IllegalStateException;
42
* Returns the locale of the current spell check engine.
44
* @return the locale of the current spell check engine
49
* Registers a global dictionary.
51
* @param dictionary the global dictionary to register
53
void registerGlobalDictionary(ISpellDictionary dictionary);
56
* Registers a dictionary tuned for the specified locale with this engine.
59
* The locale to register the dictionary with
61
* The dictionary to register
63
void registerDictionary(Locale locale, ISpellDictionary dictionary);
66
* Shuts down this spell check engine and its associated components.
68
* Further calls to this engine result in exceptions.
74
* Unregisters a dictionary previously registered either by a call to
75
* <code>registerDictionary(Locale,ISpellDictionary)</code> or <code>registerDictionary(ISpellDictionary)</code>.
77
* If the dictionary was not registered before, nothing happens.</p>
79
* @param dictionary the dictionary to unregister
81
void unregisterDictionary(ISpellDictionary dictionary);