1 /* vim:set et ts=4 sts=4:
3 * ibus-libpinyin - Intelligent Pinyin engine based on libpinyin for IBus
5 * Copyright (c) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef __PY_FALLBACK_EDITOR_
22 #define __PY_FALLBACK_EDITOR_
29 class FallbackEditor : public Editor {
31 FallbackEditor (PinyinProperties &props, Config & config)
32 : Editor (props, config),
34 m_double_quote (TRUE),
35 m_prev_committed_char (0) { }
37 gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
40 void setPrevCommittedChar (gunichar ch)
42 m_prev_committed_char = ch;
46 void commit (gchar ch)
48 gchar str[2] = {ch, 0};
49 StaticText text (str);
53 void commit (gunichar ch)
59 void commit (const gchar *str)
61 StaticText text (str);
65 void commit (const String &str)
67 commit ((const gchar *)str);
70 gboolean processPunct (guint keyval, guint keycode, guint modifiers);
71 gboolean processPunctForSimplifiedChinese (guint keyval, guint keycode, guint modifiers);
72 gboolean processPunctForTraditionalChinese (guint keyval, guint keycode, guint modifiers);
76 gboolean m_double_quote;
77 gunichar m_prev_committed_char;