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;
17 * Interface for spell-checkers.
21 public interface ISpellChecker {
24 * Adds a dictionary to the list of active dictionaries.
27 * The dictionary to add
29 public void addDictionary(ISpellDictionary dictionary);
32 * Adds a spell event listener to the active listeners.
37 public void addListener(ISpellEventListener listener);
40 * Returns whether this spell checker accepts word additions.
42 * @return <code>true</code> if word additions are accepted,
43 * <code>false</code> otherwise
45 public boolean acceptsWords();
48 * Adds the specified word to the set of correct words.
51 * The word to add to the set of correct words
53 public void addWord(String word);
56 * Checks the specified word until calling <code>ignoreWord(String)</code>.
61 public void checkWord(String word);
64 * Checks the spelling with the spell-check iterator. Implementations must
65 * be thread safe as this may be called inside a reconciler thread.
68 * The iterator to use for spell-checking
70 public void execute(ISpellCheckIterator iterator);
73 * Returns the ranked proposals for a word.
76 * The word to retrieve the proposals for
78 * <code>true</code> iff the proposals should start a sentence,
79 * <code>false</code> otherwise
80 * @return Set of ranked proposals for the word
82 public Set getProposals(String word, boolean sentence);
85 * Ignores the specified word until calling <code>checkWord(String)</code>.
90 public void ignoreWord(String word);
93 * Is the specified word correctly spelled? Implementations must be thread
94 * safe as this may be called from within a reconciler thread.
97 * The word to check its spelling
98 * @return <code>true</code> iff the word is correctly spelled,
99 * <code>false</code> otherwise
101 public boolean isCorrect(String word);
104 * Remove a dictionary from the list of active dictionaries.
107 * The dictionary to remove
109 public void removeDictionary(ISpellDictionary dictionary);
112 * Removes a spell event listener from the active listeners.
115 * The listener to remove
117 public void removeListener(ISpellEventListener listener);