1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
12 package net.sourceforge.phpdt.internal.ui.text.spelling.engine;
14 import java.util.Locale;
16 import org.eclipse.jface.preference.IPreferenceStore;
19 * Interface for spell-check engines.
23 public interface ISpellCheckEngine {
26 * Creates a configured instance of a spell-checker that uses the
27 * appropriate dictionaries.
30 * The locale to get the spell checker for
32 * The preference store for the spell-checker
33 * @return A configured instance of a spell checker, or <code>null</code>
34 * iff no dictionary could be found for that locale
36 ISpellChecker createSpellChecker(Locale locale, IPreferenceStore store);
39 * Returns the current locale of the spell check engine.
41 * @return The current locale of the engine
46 * Registers a dictionary for all locales available on the platform.
48 * This call is equivalent to calling <code>registerDictionary(Locale,ISpellDictionary)</code>
49 * for each of the locales returned by <code>Locale.getAvailableLocales()</code>.
53 * The dictionary to register
55 void registerDictionary(ISpellDictionary dictionary);
58 * Registers a dictionary tuned for the specified locale with this engine.
61 * The locale to register the dictionary with
63 * The dictionary to register
65 void registerDictionary(Locale locale, ISpellDictionary dictionary);
68 * Unloads the spell check engine and its associated components.
70 * All registered dictionaries are unloaded and the engine unregisters for
71 * preference changes. After a new call to <code>getSpellChecker(Locale)</code>,
72 * it registers again for preference changes. The dictionaries perform lazy
73 * loading, that is to say on the next query they reload their associated
79 * Unregisters a dictionary previously registered either by a call to
80 * <code>registerDictionary(Locale,ISpellDictionary)</code> or <code>registerDictionary(ISpellDictionary)</code>.
81 * If the dictionary was not registered before, nothing happens.
84 * The dictionary to unregister
86 void unregisterDictionary(ISpellDictionary dictionary);