diff options
author | George Hazan <george.hazan@gmail.com> | 2024-11-26 15:48:16 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-11-26 15:48:21 +0300 |
commit | 94782312a45edad08d6544be5a6aba402f461da1 (patch) | |
tree | 0c8149d70f3785493a5ac8ee8182c89854c0d811 /plugins/SpellChecker/src/dictionary.h | |
parent | f200ec71df622d7a94fc171363ff67732ffb440a (diff) |
code cleaning
Diffstat (limited to 'plugins/SpellChecker/src/dictionary.h')
-rw-r--r-- | plugins/SpellChecker/src/dictionary.h | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/plugins/SpellChecker/src/dictionary.h b/plugins/SpellChecker/src/dictionary.h index da70a6a4c2..35f94dc4f8 100644 --- a/plugins/SpellChecker/src/dictionary.h +++ b/plugins/SpellChecker/src/dictionary.h @@ -21,48 +21,45 @@ Boston, MA 02111-1307, USA. #ifndef __DICTIONARY_H__
# define __DICTIONARY_H__
-
-struct Suggestions {
- wchar_t ** words;
- size_t count;
-};
-
+typedef std::vector<std::wstring> Suggestions;
// A Dictionary interface
// All dictionaries use a lazy interface
-class Dictionary {
-public:
+struct Dictionary
+{
wchar_t language[128];
wchar_t localized_name[128];
wchar_t english_name[128];
wchar_t full_name[256];
wchar_t source[128];
- AutoReplaceMap *autoReplace;
+ AutoReplaceMap *autoReplace = 0;
HANDLE hIcolib;
virtual ~Dictionary();
+ void GetInfo();
+
// Return TRUE if the word is correct
- virtual BOOL spell(const wchar_t *) = 0;
+ virtual BOOL spell(const wchar_t *word) = 0;
// Return a list of suggestions to a word
- virtual Suggestions suggest(const wchar_t * word) = 0;
+ virtual Suggestions suggest(const wchar_t *word) = 0;
// Return a list of auto suggestions to a word
- virtual Suggestions autoSuggest(const wchar_t * word) = 0;
+ virtual Suggestions autoSuggest(const wchar_t *word) = 0;
// Return a auto suggestions to a word
// You have to free the item
- virtual wchar_t * autoSuggestOne(const wchar_t * word) = 0;
+ virtual wchar_t* autoSuggestOne(const wchar_t *word) = 0;
// Return TRUE if the char is a word char
virtual BOOL isWordChar(wchar_t c) = 0;
// Add a word to the user custom dict
- virtual void addWord(const wchar_t * word) = 0;
+ virtual void addWord(const wchar_t *word) = 0;
// Add a word to the list of ignored words
- virtual void ignoreWord(const wchar_t * word) = 0;
+ virtual void ignoreWord(const wchar_t *word) = 0;
// Assert that all needed data is loaded
virtual void load() = 0;
@@ -71,17 +68,7 @@ public: virtual BOOL isLoaded() = 0;
};
-
-
// Return a list of avaible languages
-void GetAvaibleDictionaries(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *user_path);
-
-// Free the list returned by GetAvaibleDictionaries
-void FreeDictionaries(LIST<Dictionary> &dicts);
-
-// Free the list returned by GetAvaibleDictionaries
-void FreeSuggestions(Suggestions &suggestions);
-
-
+void GetAvaibleDictionaries(OBJLIST<Dictionary> &dicts, wchar_t *path, wchar_t *user_path);
#endif // __DICTIONARY_H__
|