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
49 * <code>registerDictionary(Locale,ISpellDictionary)</code> for each of
50 * the locales returned by <code>Locale.getAvailableLocales()</code>.
54 * The dictionary to register
56 void registerDictionary(ISpellDictionary dictionary);
59 * Registers a dictionary tuned for the specified locale with this engine.
62 * The locale to register the dictionary with
64 * The dictionary to register
66 void registerDictionary(Locale locale, ISpellDictionary dictionary);
69 * Unloads the spell check engine and its associated components.
71 * All registered dictionaries are unloaded and the engine unregisters for
72 * preference changes. After a new call to
73 * <code>getSpellChecker(Locale)</code>, it registers again for
74 * preference changes. The dictionaries perform lazy loading, that is to say
75 * on the next query they reload their associated word lists.
80 * Unregisters a dictionary previously registered either by a call to
81 * <code>registerDictionary(Locale,ISpellDictionary)</code> or
82 * <code>registerDictionary(ISpellDictionary)</code>. If the dictionary
83 * was not registered before, nothing happens.
86 * The dictionary to unregister
88 void unregisterDictionary(ISpellDictionary dictionary);