1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * Copyright (C) 2004 Hiroyuki Ikezoe
4 * Copyright (C) 2004 Takuro Ashie
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #ifndef __SCIM_ANTHY_NICOLA_H__
22 #define __SCIM_ANTHY_NICOLA_H__
24 #define Uses_SCIM_ICONV
25 #define Uses_SCIM_EVENT
29 #include "scim_anthy_key2kana_base.h"
30 #include "scim_anthy_key2kana_table.h"
36 namespace scim_anthy {
39 SCIM_ANTHY_NICOLA_SHIFT_NONE,
40 SCIM_ANTHY_NICOLA_SHIFT_LEFT,
41 SCIM_ANTHY_NICOLA_SHIFT_RIGHT,
44 class NicolaConvertor : public Key2KanaConvertorBase
47 NicolaConvertor (AnthyInstance & anthy,
48 Key2KanaTableSet & tables);
49 virtual ~NicolaConvertor ();
51 bool can_append (const KeyEvent & key,
52 bool ignore_space = false);
53 bool append (const KeyEvent & key,
57 bool append (const String & raw,
59 WideString & pending);
62 bool is_pending (void);
63 WideString get_pending (void);
64 WideString flush_pending (void);
65 void reset_pending (const WideString & result,
69 void process_timeout (void);
72 void search (const KeyEvent key,
73 NicolaShiftType shift_type,
76 bool handle_voiced_consonant (WideString & result,
77 WideString & pending);
78 bool is_char_key (const KeyEvent key);
79 bool is_thumb_key (const KeyEvent key);
80 bool is_left_thumb_key (const KeyEvent key);
81 bool is_right_thumb_key (const KeyEvent key);
83 get_thumb_key_type (const KeyEvent key);
85 void on_key_repeat (const KeyEvent key,
88 void on_both_key_pressed (const KeyEvent key,
91 void on_thumb_key_pressed (const KeyEvent key,
94 void on_char_key_pressed (const KeyEvent key,
97 void on_no_key_pressed (const KeyEvent key);
99 bool is_repeating (void);
100 void emit_key_event (const KeyEvent & key);
101 void set_alarm (int time_msec);
104 Key2KanaTableSet &m_tables;
106 AnthyInstance &m_anthy;
109 KeyEvent m_prev_char_key;
110 KeyEvent m_prev_thumb_key;
112 KeyEvent m_repeat_char_key;
113 KeyEvent m_repeat_thumb_key;
116 struct timeval m_time_char;
117 struct timeval m_time_thumb;
119 KeyEvent m_through_key_event;
122 bool m_processing_timeout;
124 WideString m_pending;
128 #endif /* __SCIM_ANTHY_NICOLA_H__ */
130 vi:ts=4:nowrap:ai:expandtab