1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * Copyright (C) 2005 Takuro Ashie
5 * This program 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 2, or (at your option)
10 * This program 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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __SCIM_ANTHY_KEY2KANA_TABLE_H__
21 #define __SCIM_ANTHY_KEY2KANA_TABLE_H__
23 #define Uses_SCIM_TYPES
25 #include "scim_anthy_default_tables.h"
29 namespace scim_anthy {
32 SCIM_ANTHY_PERIOD_JAPANESE,
33 SCIM_ANTHY_PERIOD_WIDE,
34 SCIM_ANTHY_PERIOD_HALF,
38 SCIM_ANTHY_COMMA_JAPANESE,
39 SCIM_ANTHY_COMMA_WIDE,
40 SCIM_ANTHY_COMMA_HALF,
44 SCIM_ANTHY_BRACKET_JAPANESE,
45 SCIM_ANTHY_BRACKET_WIDE,
49 SCIM_ANTHY_SLASH_JAPANESE,
50 SCIM_ANTHY_SLASH_WIDE,
54 SCIM_ANTHY_TYPING_METHOD_ROMAJI,
55 SCIM_ANTHY_TYPING_METHOD_KANA,
56 SCIM_ANTHY_TYPING_METHOD_NICOLA,
57 SCIM_ANTHY_TYPING_METHOD_CUSTOM,
63 class Key2KanaTableSet;
65 typedef std::vector<Key2KanaRule> Key2KanaRules;
72 Key2KanaRule (String sequence,
73 const std::vector<String> &result);
74 virtual ~Key2KanaRule ();
76 String get_sequence (void);
77 String get_result (unsigned int idx);
85 std::vector<String> m_result;
92 Key2KanaTable (WideString name);
93 Key2KanaTable (WideString name,
95 Key2KanaTable (WideString name,
97 virtual ~Key2KanaTable ();
99 Key2KanaRules & get_table (void) { return m_rules; }
101 void append_rule (String sequence,
102 const std::vector<String> &result);
103 void append_rule (String sequence,
106 void append_rule (String sequence,
114 Key2KanaRules m_rules;
118 class Key2KanaTableSet
122 virtual ~Key2KanaTableSet ();
124 std::vector<Key2KanaTable*> &
125 get_tables (void) { return m_all_tables; };
127 void set_typing_method (TypingMethod method,
128 Key2KanaTable *fundamental_table = NULL);
129 void set_symbol_width (bool half);
130 void set_number_width (bool half);
131 void set_period_style (PeriodStyle style);
132 void set_comma_style (CommaStyle style);
133 void set_bracket_style (BracketStyle style);
134 void set_slash_style (SlashStyle style);
137 get_typing_method (void) { return m_typing_method; }
138 bool symbol_is_half (void) { return m_use_half_symbol; }
139 bool number_is_half (void) { return m_use_half_number;}
141 get_period_style (void) { return m_period_style; }
143 get_comma_style (void) { return m_comma_style; }
145 get_bracket_style (void) { return m_bracket_style; }
147 get_slash_style (void) { return m_slash_style; }
150 void set_use_consonant_table (bool use);
151 void set_use_symbol_table (bool use);
152 void set_use_number_table (bool use);
153 void set_use_period_table (bool use);
154 void set_use_comma_table (bool use);
156 bool get_use_consonant_table (void);
157 bool get_use_symbol_table (void);
158 bool get_use_number_table (void);
159 bool get_use_period_table (void);
160 bool get_use_comma_table (void);
164 void reset_tables (void);
170 Key2KanaTable *m_fundamental_table;
171 Key2KanaTable m_voiced_consonant_table;
172 std::vector<Key2KanaTable*> *m_additional_table;
173 std::vector<Key2KanaTable*> m_all_tables;
176 TypingMethod m_typing_method;
177 PeriodStyle m_period_style;
178 CommaStyle m_comma_style;
179 BracketStyle m_bracket_style;
180 SlashStyle m_slash_style;
181 bool m_use_half_symbol;
182 bool m_use_half_number;
187 #endif /* __SCIM_ANTHY_KEY2KANA_TABLE_H__ */
189 vi:ts=4:nowrap:ai:expandtab