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_KEY2KANA_H__
22 #define __SCIM_ANTHY_KEY2KANA_H__
24 #define Uses_SCIM_EVENT
27 #include "scim_anthy_key2kana_base.h"
28 #include "scim_anthy_default_tables.h"
29 #include "scim_anthy_key2kana_table.h"
35 namespace scim_anthy {
37 class Key2KanaConvertor : public Key2KanaConvertorBase
40 Key2KanaConvertor (AnthyInstance & anthy,
41 Key2KanaTableSet & tables);
42 virtual ~Key2KanaConvertor ();
44 bool can_append (const KeyEvent & key,
45 bool ignore_space = false);
46 bool append (const KeyEvent & key,
52 bool is_pending (void);
53 WideString get_pending (void);
54 WideString flush_pending (void);
55 void reset_pending (const WideString & result,
57 void set_pseudo_ascii_mode (int mode)
58 { m_pseudo_ascii_mode = mode; }
59 bool is_pseudo_ascii_mode (void)
60 { return m_is_in_pseudo_ascii_mode; }
61 bool process_pseudo_ascii_mode (const WideString & wstr);
62 void reset_pseudo_ascii_mode (void);
65 bool append (const String & str,
67 WideString & pending);
70 AnthyInstance &m_anthy;
71 Key2KanaTableSet &m_tables;
76 Key2KanaRule m_exact_match;
77 int m_pseudo_ascii_mode;
78 bool m_is_in_pseudo_ascii_mode;
79 bool m_reset_pseudo_ascii_mode;
83 #endif /* __SCIM_ANTHY_KEY2KANA_H__ */
85 vi:ts=4:nowrap:ai:expandtab