1 /*
2 * This file is part of SpellChecker plugin for Code::Blocks Studio
3 * Copyright (C) 2009 Daniel Anselmi
4 *
5 * SpellChecker plugin is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * SpellChecker plugin is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with SpellChecker. If not, see <http://www.gnu.org/licenses/>.
17 *
18 */
19 #ifndef __MY_SPELL_CHECK_DIALOG__
20 #define __MY_SPELL_CHECK_DIALOG__
21 
22 // For compilers that support precompilation, includes "wx/wx.h".
23 #include "wx/wxprec.h"
24 
25 #ifndef WX_PRECOMP
26 #include "wx/wx.h"
27 #endif
28 
29 #include "SpellCheckDialogInterface.h"
30 
31 // modelless SpellChecker dialog
32 class MySpellingDialog : public wxSpellCheckDialogInterface
33 {
34 public:
35     MySpellingDialog(wxWindow *parent, wxSpellCheckEngineInterface* SpellChecker = NULL);
36     ~MySpellingDialog();
37 
38     // Code handling the interface
39     void OnRecheckPage(wxCommandEvent& event);
40     void OnCheckWord(wxCommandEvent& event);
41     void OnReplaceWord(wxCommandEvent& event);
42     void OnIgnoreWord(wxCommandEvent& event);
43     void OnReplaceAll(wxCommandEvent& event);
44     void OnIgnoreAll(wxCommandEvent& event);
45     void OnAddWordToCustomDictionary(wxCommandEvent& event);
46     void OnEditCustomDictionary(wxCommandEvent& event);
47     void OnInit(wxInitDialogEvent& event);
48     void PopulateLanguageCombo();
49     void OnChangeLanguage(wxCommandEvent& event);
50     void OnChangeSuggestionSelection(wxCommandEvent& event);
51     void OnDblClkSuggestionSelection(wxCommandEvent& event);
52     void OnClose(wxCommandEvent& event);
53 
54     virtual void SetMisspelledWord(const wxString& strMisspelling);
55     void CreateDialog();
56 
57 private:
58     DECLARE_EVENT_TABLE()
59 };
60 
61 class MyPersonalDictionaryDialog : public wxDialog
62 {
63 public:
64     MyPersonalDictionaryDialog(wxWindow* parent, wxSpellCheckEngineInterface* pEngine);
65     ~MyPersonalDictionaryDialog();
66 
67     void CreateDialog();
68     void PopulatePersonalWordListBox();
69     void AddWordToPersonalDictionary(wxCommandEvent& event);
70     void ReplaceInPersonalDictionary(wxCommandEvent& event);
71     void RemoveFromPersonalDictionary(wxCommandEvent& event);
72     void OnClose(wxCommandEvent& event);
73 
74 protected:
75     wxSpellCheckEngineInterface* m_pSpellCheckEngine;
76 
77 private:
78     DECLARE_EVENT_TABLE()
79 };
80 
81 #endif  // __MY_SPELL_CHECK_DIALOG__
82