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>
6 * Copyright (c) 2010 BYVoid <byvoid1@gmail.com>
7 * Copyright (c) 2011 Peng Wu <alexepico@gmail.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef __PY_LIB_PINYIN_BOPOMOFO_ENGINE_H_
24 #define __PY_LIB_PINYIN_BOPOMOFO_ENGINE_H_
27 #include "PYPinyinProperties.h"
31 class LibPinyinBopomofoEngine : public Engine {
33 LibPinyinBopomofoEngine (IBusEngine *engine);
34 ~LibPinyinBopomofoEngine (void);
37 gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
46 void cursorDown (void);
47 gboolean propertyActivate (const gchar *prop_name, guint prop_state);
48 void candidateClicked (guint index, guint button, guint state);
51 gboolean processPunct (guint keyval, guint keycode, guint modifiers);
54 void showSetupDialog (void);
55 void connectEditorSignals (EditorPtr editor);
58 void commitText (Text & text);
61 PinyinProperties m_props;
63 guint m_prev_pressed_key;
66 MODE_INIT = 0, // init mode
67 MODE_PUNCT, // punct mode
70 MODE_ENGLISH, // press v into English input mode
71 MODE_STROKE, // press u into stroke input mode
72 MODE_EXTENSION, // press i into extension input mode
77 EditorPtr m_editors[MODE_LAST];
78 EditorPtr m_fallback_editor;