clean up PYConfig.h/cc
[platform/upstream/ibus-libpinyin.git] / src / PYPPinyinEngine.h
1 /* vim:set et ts=4 sts=4:
2  *
3  * ibus-pinyin - The Chinese PinYin engine for IBus
4  *
5  * Copyright (c) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
6  * Copyright (c) 2011 Peng Wu <alexepico@gmail.com>
7  *
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)
11  * any later version.
12  *
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.
17  *
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.
21  */
22 #ifndef __PY_LIB_PINYIN_PINYIN_ENGINE_H_
23 #define __PY_LIB_PINYIN_PINYIN_ENGINE_H_
24
25 #include "PYEngine.h"
26 #include "PYPinyinProperties.h"
27
28 namespace PY {
29 class LibPinyinPinyinEngine : public Engine {
30 public:
31     LibPinyinPinyinEngine (IBusEngine *engine);
32     ~LibPinyinPinyinEngine (void);
33
34     //virtual functions
35     gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
36     void focusIn (void);
37     void focusOut (void);
38     void reset (void);
39     void enable (void);
40     void disable (void);
41     void pageUp (void);
42     void pageDown (void);
43     void cursorUp (void);
44     void cursorDown (void);
45     gboolean propertyActivate (const gchar *prop_name, guint prop_state);
46     void candidateClicked (guint index, guint button, guint state);
47
48 private:
49     gboolean processPunct (guint keyval, guint keycode, guint modifiers);
50
51     void showSetupDialog (void);
52     void connectEditorSignals (EditorPtr editor);
53
54     void commitText (Text & text);
55
56 private:
57     PinyinProperties m_props;
58
59     guint m_prev_pressed_key;
60
61     enum {
62         MODE_INIT = 0,          // init mode
63         MODE_PUNCT,             // punct mode
64         MODE_RAW,               // raw mode
65         MODE_ENGLISH,           // press v into English input mode
66     #if 0
67         MODE_STROKE,            // press u into stroke input mode
68     #endif
69         MODE_EXTENSION,         // press i into extension input mode
70         MODE_LAST,
71     } m_input_mode;
72
73     gboolean m_double_pinyin;
74
75     EditorPtr m_editors[MODE_LAST];
76     EditorPtr m_fallback_editor;
77
78 };
79
80 };
81
82 #endif