Initial revision
[old-projects.git] / ekit / com / swabunga / spell / event / SpellCheckEvent.java
CommitLineData
6dd70280
JL
1package com.swabunga.spell.event;\r\r
2\r\r
3import java.util.*;\r\r
4\r\r
5/** This event is fired off by the SpellChecker and is passed to the\r\r
6 * registered SpellCheckListeners\r\r
7 * <p>AFAIK we will only require one implementation of the SpellCheckEvent\r\r
8 * (BasicSpellCheckEvent) but I have defnied this interface just in case. The\r\r
9 * BasicSpellCheckEvent implementation is currently package private.\r\r
10 * </p>\r\r
11 *\r\r
12 * @author Jason Height (jheight@chariot.net.au)\r\r
13 */\r\r
14public interface SpellCheckEvent {\r\r
15 /** Field indicating that the incorrect word should be ignored*/\r\r
16 public static final short IGNORE = 0;\r\r
17 /** Field indicating that the incorrect word should be ignored forever*/\r\r
18 public static final short IGNOREALL = 1;\r\r
19 /** Field indicating that the incorrect word should be replaced*/\r\r
20 public static final short REPLACE = 2;\r\r
21 /** Field indicating that the incorrect word should be replaced always*/\r\r
22 public static final short REPLACEALL = 3;\r\r
23 /** Field indicating that the incorrect word should be added to the dictionary*/\r\r
24 public static final short ADDTODICT = 4;\r\r
25 /** Field indicating that the spell checking should be terminated*/\r\r
26 public static final short CANCEL = 5;\r\r
27 /** Initial case for the action */\r\r
28 public static final short INITIAL = -1;\r\r
29\r\r
30 /** Returns the list of suggested Word objects*/\r\r
31 public List getSuggestions();\r\r
32\r\r
33 /** Returns the currently misspelt word*/\r\r
34 public String getInvalidWord();\r\r
35\r\r
36 /** Returns the context in which the misspelt word is used*/\r\r
37 public String getWordContext();\r\r
38\r\r
39 /** Returns the start position of the misspelt word in the context*/\r\r
40 public int getWordContextPosition();\r\r
41\r\r
42 public short getAction();\r\r
43\r\r
44 public String getReplaceWord();\r\r
45\r\r
46 /** Set the action to replace the currently misspelt word with the new word\r\r
47 * @param String newWord The word to replace the currently misspelt word\r\r
48 * @param boolean replaceAll If set to true, the SpellChecker will replace all\r\r
49 * further occurances of the misspelt word without firing a SpellCheckEvent.\r\r
50 */\r\r
51 public void replaceWord(String newWord, boolean replaceAll);\r\r
52\r\r
53 /** Set the action it ignore the currently misspelt word.\r\r
54 * @param boolean ignoreAll If set to true, the SpellChecker will replace all\r\r
55 * further occurances of the misspelt word without firing a SpellCheckEvent.\r\r
56 */\r\r
57 public void ignoreWord(boolean ignoreAll);\r\r
58\r\r
59 /** Set the action to add a new word into the dictionary. This will also replace the\r\r
60 * currently misspelt word.\r\r
61 */\r\r
62 public void addToDictionary(String newWord);\r\r
63\r\r
64 /** Set the action to terminate processing of the spellchecker.\r\r
65 */\r\r
66 public void cancel();\r\r
67}