refactory: added UI removed from core plugin.
[phpeclipse.git] / net.sourceforge.phpeclipse.ui / src / net / sourceforge / phpdt / internal / ui / text / spelling / engine / ISpellDictionary.java
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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11
12 package net.sourceforge.phpdt.internal.ui.text.spelling.engine;
13
14 import java.util.Set;
15
16 /**
17  * Interface of dictionaries to use for spell-checking.
18  * 
19  * @since 3.0
20  */
21 public interface ISpellDictionary {
22
23         /**
24          * Returns whether this dictionary accepts new words.
25          * 
26          * @return <code>true</code> if this dictionary accepts new words,
27          *         <code>false</code> otherwise
28          */
29         public boolean acceptsWords();
30
31         /**
32          * Externalizes the specified word.
33          * 
34          * @param word
35          *            The word to externalize in the dictionary
36          */
37         public void addWord(String word);
38
39         /**
40          * Returns the ranked word proposals for an incorrectly spelled word.
41          * 
42          * @param word
43          *            The word to retrieve the proposals for
44          * @param sentence
45          *            <code>true</code> iff the proposals start a new sentence,
46          *            <code>false</code> otherwise
47          * @return Array of ranked word proposals
48          */
49         public Set getProposals(String word, boolean sentence);
50
51         /**
52          * Is the specified word correctly spelled?
53          * 
54          * @param word
55          *            The word to spell-check
56          * @return <code>true</code> iff this word is correctly spelled,
57          *         <code>false</code> otherwise.
58          */
59         public boolean isCorrect(String word);
60
61         /**
62          * Is the dictionary loaded?
63          * 
64          * @return <code>true</code> iff it is loaded, <code>false</code>
65          *         otherwise
66          */
67         public boolean isLoaded();
68
69         /**
70          * Empties the dictionary.
71          */
72         public void unload();
73 }