1 /* vim:set et ts=4 sts=4:
3 * ibus-pinyin - The Chinese PinYin engine for IBus
5 * Copyright (c) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
6 * Copyright (c) 2011 Peng Wu <alexepico@gmail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef __PY_LIB_PINYIN_PINYIN_ENGINE_H_
23 #define __PY_LIB_PINYIN_PINYIN_ENGINE_H_
26 #include "PYPinyinProperties.h"
29 class LibPinyinPinyinEngine : public Engine {
31 LibPinyinPinyinEngine (IBusEngine *engine);
32 ~LibPinyinPinyinEngine (void);
35 gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
44 void cursorDown (void);
45 gboolean propertyActivate (const gchar *prop_name, guint prop_state);
46 void candidateClicked (guint index, guint button, guint state);
49 gboolean processPunct (guint keyval, guint keycode, guint modifiers);
51 void showSetupDialog (void);
52 void connectEditorSignals (EditorPtr editor);
54 void commitText (Text & text);
57 PinyinProperties m_props;
59 guint m_prev_pressed_key;
62 MODE_INIT = 0, // init mode
63 MODE_PUNCT, // punct mode
65 MODE_ENGLISH, // press v into English input mode
67 MODE_STROKE, // press u into stroke input mode
69 MODE_EXTENSION, // press i into extension input mode
73 gboolean m_double_pinyin;
75 EditorPtr m_editors[MODE_LAST];
76 EditorPtr m_fallback_editor;