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_READING_H__
21 #define __SCIM_ANTHY_READING_H__
23 #define Uses_SCIM_ICONV
24 #define Uses_SCIM_EVENT
26 #include "scim_anthy_key2kana.h"
27 #include "scim_anthy_kana.h"
28 #include "scim_anthy_nicola.h"
34 namespace scim_anthy {
37 SCIM_ANTHY_STRING_LATIN,
38 SCIM_ANTHY_STRING_WIDE_LATIN,
39 SCIM_ANTHY_STRING_HIRAGANA,
40 SCIM_ANTHY_STRING_KATAKANA,
41 SCIM_ANTHY_STRING_HALF_KATAKANA,
46 typedef std::vector<ReadingSegment> ReadingSegments;
53 ReadingSegment (void);
54 virtual ~ReadingSegment ();
56 const WideString & get (void) { return kana; }
57 const String & get_raw (void) { return raw; }
59 void split (ReadingSegments &segments);
69 Reading (AnthyInstance &anthy);
72 bool can_process_key_event (const KeyEvent & key);
73 bool process_key_event (const KeyEvent & key);
77 WideString get (unsigned int start = 0,
80 = SCIM_ANTHY_STRING_HIRAGANA);
81 String get_raw (unsigned int start = 0,
83 bool append (const KeyEvent & key,
84 const String & string);
85 void erase (unsigned int start = 0,
87 bool allow_split = false);
89 unsigned int get_length (void);
90 unsigned int get_caret_pos (void);
91 void set_caret_pos (unsigned int pos);
92 void move_caret (int step,
93 bool allow_split = false);
95 void set_typing_method (TypingMethod method);
96 TypingMethod get_typing_method (void);
97 void set_period_style (PeriodStyle style);
98 PeriodStyle get_period_style (void);
99 void set_comma_style (CommaStyle style);
100 CommaStyle get_comma_style (void);
101 void set_bracket_style (BracketStyle style);
102 BracketStyle get_bracket_style (void);
103 void set_slash_style (SlashStyle style);
104 SlashStyle get_slash_style (void);
105 void set_symbol_width (bool half);
106 bool get_symbol_width (void);
107 void set_number_width (bool half);
108 bool get_number_width (void);
109 void set_pseudo_ascii_mode (int mode);
110 bool is_pseudo_ascii_mode (void);
111 void reset_pseudo_ascii_mode (void);
114 void reset_pending (void);
115 void split_segment (unsigned int seg_id);
118 AnthyInstance &m_anthy;
121 Key2KanaTableSet m_key2kana_tables;
122 Key2KanaTableSet m_nicola_tables;
125 Key2KanaConvertor m_key2kana_normal;
126 KanaConvertor m_kana;
127 NicolaConvertor m_nicola;
128 Key2KanaConvertorBase *m_key2kana;
131 ReadingSegments m_segments;
132 unsigned int m_segment_pos;
133 unsigned int m_caret_offset;
138 #endif /* __SCIM_ANTHY_READING_H__ */
140 vi:ts=4:nowrap:ai:expandtab