| 1 |
/* AbiSuite |
| 2 |
* Copyright (C) 2003 Dom Lachowicz |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU General Public License |
| 6 |
* as published by the Free Software Foundation; either version 2 |
| 7 |
* of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 17 |
* 02110-1301 USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#ifndef ENCHANT_CHECKER_H |
| 21 |
#define ENCHANT_CHECKER_H |
| 22 |
|
| 23 |
#include "spell_manager.h" |
| 24 |
#ifdef _MSC_VER |
| 25 |
typedef long ssize_t; |
| 26 |
#endif |
| 27 |
#include <enchant.h> |
| 28 |
|
| 29 |
class ABI_EXPORT EnchantChecker : public SpellChecker |
| 30 |
{ |
| 31 |
friend class SpellManager; |
| 32 |
|
| 33 |
public: |
| 34 |
|
| 35 |
virtual ~EnchantChecker(); |
| 36 |
|
| 37 |
virtual bool addToCustomDict (const UT_UCSChar *word, size_t len); |
| 38 |
virtual void correctWord (const UT_UCSChar *toCorrect, size_t toCorrectLen, |
| 39 |
const UT_UCSChar *correct, size_t correctLen); |
| 40 |
|
| 41 |
virtual void ignoreWord (const UT_UCSChar *toCorrect, size_t toCorrectLen); |
| 42 |
virtual bool isIgnored (const UT_UCSChar * pWord, size_t len) const; |
| 43 |
|
| 44 |
protected: |
| 45 |
|
| 46 |
EnchantChecker(); |
| 47 |
|
| 48 |
private: |
| 49 |
|
| 50 |
bool _requestDictionary (const char * szLang); |
| 51 |
SpellChecker::SpellCheckResult _checkWord (const UT_UCSChar * word, size_t len); |
| 52 |
UT_GenericVector<UT_UCSChar*> * _suggestWord (const UT_UCSChar * word, size_t len); |
| 53 |
|
| 54 |
EnchantDict *m_dict; |
| 55 |
}; |
| 56 |
|
| 57 |
#endif |