1 /*
2  *  This file is part of Poedit (http://poedit.net)
3  *
4  *  Copyright (C) 2014-2015 Vaclav Slavik
5  *
6  *  Permission is hereby granted, free of charge, to any person obtaining a
7  *  copy of this software and associated documentation files (the "Software"),
8  *  to deal in the Software without restriction, including without limitation
9  *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  *  and/or sell copies of the Software, and to permit persons to whom the
11  *  Software is furnished to do so, subject to the following conditions:
12  *
13  *  The above copyright notice and this permission notice shall be included in
14  *  all copies or substantial portions of the Software.
15  *
16  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  *  DEALINGS IN THE SOFTWARE.
23  *
24  */
25 
26 #ifndef Poedit_spellchecking_h
27 #define Poedit_spellchecking_h
28 
29 #include <wx/defs.h>
30 
31 #ifdef __WXMSW__
32     #include <wx/platinfo.h>
33 #endif
34 
35 #include <wx/textctrl.h>
36 
37 #include "language.h"
38 
IsSpellcheckingAvailable()39 inline bool IsSpellcheckingAvailable()
40 {
41 #ifdef __WXMSW__
42     return wxPlatformInfo::Get().CheckOSVersion(6,2);
43 #else
44     return true;
45 #endif
46 }
47 
48 #ifdef __WXOSX__
49 // Set the global spellchecking language
50 bool SetSpellcheckerLang(const wxString& lang);
51 #endif
52 
53 // Does any initialization needed to be able to use spellchecker with the control later.
54 #ifdef __WXMSW__
55 void PrepareTextCtrlForSpellchecker(wxTextCtrl *text);
56 #endif
57 
58 // Init given text control to do (or not) spellchecking for given language
59 bool InitTextCtrlSpellchecker(wxTextCtrl *text, bool enable, const Language& lang);
60 
61 #ifndef __WXMSW__
62 // Show help about how to add more dictionaries for spellchecking.
63 void ShowSpellcheckerHelp();
64 #endif
65 
66 #endif // Poedit_spellchecking_h
67