Tizen 2.1 base
[external/enchant.git] / src / applespell / applespell_checker.h
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* enchant
3  * Copyright (C) 2004 Remi Payette
4  * Copyright (C) 2004 Francis James Franklin
5  * 
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
19  * 02110-1301, USA.
20  */
21
22 #import <Cocoa/Cocoa.h>
23
24 #include "enchant-provider.h"
25
26 ENCHANT_PLUGIN_DECLARE("AppleSpell")
27
28 class AppleSpellChecker
29 {
30  public:
31         AppleSpellChecker();
32
33         ~AppleSpellChecker();
34
35         void            parseConfigFile (const char * configFile);
36
37         bool            checkWord (const char * word, size_t len, NSString * lang);
38         char **         suggestWord (const char * const word, size_t len, size_t * nsug, NSString * lang);
39
40         NSString *      requestDictionary (const char * const code);
41  private:
42         NSString *      dictionaryForCode (NSString * code);
43
44         NSSpellChecker *        m_checker;
45         NSMutableDictionary *   m_languages;
46 };
47
48 typedef struct
49 {
50         AppleSpellChecker *     AppleSpell;
51         NSString *              DictionaryName;
52 } AppleSpellDictionary;