~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/plugins/contrib/SpellChecker/wxspellchecker/include/SpellCheckEngineOption.h

  • Committer: damienlmoore at gmail
  • Date: 2016-02-02 02:43:22 UTC
  • Revision ID: damienlmoore@gmail.com-20160202024322-yql5qmtbwdyamdwd
Code::BlocksĀ 16.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __SPELL_CHECK_ENGINE_OPTION__
 
2
#define __SPELL_CHECK_ENGINE_OPTION__
 
3
 
 
4
// For compilers that support precompilation, includes "wx/wx.h".
 
5
#include "wx/wxprec.h"
 
6
 
 
7
#ifdef __BORLANDC__
 
8
    #pragma hdrstop
 
9
#endif
 
10
 
 
11
// for all others, include the necessary headers (this file is usually all you
 
12
// need because it includes almost all "standard" wxWindows headers)
 
13
#ifndef WX_PRECOMP
 
14
    #include "wx/wx.h"
 
15
#endif
 
16
 
 
17
#include <wx/dynarray.h>
 
18
#include <wx/variant.h>
 
19
 
 
20
WX_DECLARE_OBJARRAY(wxVariant, VariantArray);
 
21
 
 
22
class SpellCheckEngineOption
 
23
{
 
24
public:
 
25
  enum
 
26
  {
 
27
    UNDEFINED = 0,
 
28
    STRING = 1,
 
29
    LONG = 2,
 
30
    DOUBLE = 3,
 
31
    BOOLEAN = 4,
 
32
    DIR = 5,
 
33
    FILE = 6
 
34
  };
 
35
  
 
36
  SpellCheckEngineOption();
 
37
  SpellCheckEngineOption(wxString strName);
 
38
  SpellCheckEngineOption(wxString strName, wxString strText);
 
39
  SpellCheckEngineOption(wxString strName, wxString strText, wxString strValue, int nType = SpellCheckEngineOption::STRING);
 
40
  SpellCheckEngineOption(wxString strName, wxString strText, long nValue);
 
41
  SpellCheckEngineOption(wxString strName, wxString strText, double dblValue);
 
42
  SpellCheckEngineOption(wxString strName, wxString strText, bool bValue);
 
43
  
 
44
  void SetName(wxString strName) { m_strOptionName = strName; if (m_strDialogText.IsEmpty()) m_strDialogText = strName; }
 
45
  wxString GetName() { return m_strOptionName; }
 
46
  void SetText(wxString strText) { m_strDialogText = strText; if (m_strOptionName.IsEmpty()) m_strOptionName = strText; }
 
47
  wxString GetText() { return m_strDialogText; }
 
48
  void AddPossibleValue(wxString strValue);
 
49
  void AddPossibleValue(long nValue);
 
50
  void AddPossibleValue(double dblValue);
 
51
  void AddPossibleValue(bool bValue);
 
52
  VariantArray* GetPossibleValuesArray() { return &m_PossibleValuesArray; }
 
53
  void SetOptionType(int nType);
 
54
  int GetOptionType() { return m_nOptionType; }
 
55
  wxString GetStringValue();
 
56
  long GetLongValue();
 
57
  double GetDoubleValue();
 
58
  bool GetBoolValue();
 
59
  void SetShowOption(bool bShow) { m_bShowOption = bShow; }
 
60
  bool GetShowOption() { return m_bShowOption; }
 
61
  wxString GetValueAsString() { return m_OptionValue.MakeString(); }
 
62
  void SetValue(wxString strValue, int nType = SpellCheckEngineOption::STRING);
 
63
  void SetValue(long nValue);
 
64
  void SetValue(double dblValue);
 
65
  void SetValue(bool bValue);
 
66
  void SetDependency(wxString strOptionName) { m_strDependency = strOptionName; }
 
67
  wxString GetDependency() { return m_strDependency; }
 
68
  
 
69
private:
 
70
  wxString m_strOptionName; // Option name as the spell check engine knows it
 
71
  wxString m_strDialogText; // Option name suitable for the options dialog
 
72
  VariantArray m_PossibleValuesArray; // This can be used to populate choice boxes on the options dialog
 
73
  wxString m_strDependency; // This is the name of the option on which this option depends
 
74
  wxVariant m_OptionValue;
 
75
  int m_nOptionType;  // Since we want to keep track of where this is a file or directory, we can't always use wxVariant.GetType()
 
76
  bool m_bShowOption; // When presenting the options to the user, show this option on the dialog
 
77
};
 
78
 
 
79
#endif // __SPELL_CHECK_ENGINE_OPTION__