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) 2010 BYVoid <byvoid1@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_BOPOMOFO_EDITOR_H_
23
#define __PY_BOPOMOFO_EDITOR_H_
25
#include "PYPhoneticEditor.h"
31
#define MAX_PINYIN_LEN 64
33
class BopomofoEditor : public PhoneticEditor {
36
BopomofoEditor (PinyinProperties & props, Config & config);
37
~BopomofoEditor (void);
40
std::wstring bopomofo;
41
gboolean m_select_mode;
43
gboolean processGuideKey (guint keyval, guint keycode, guint modifiers);
44
gboolean processAuxiliarySelectKey (guint keyval, guint keycode, guint modifiers);
45
gboolean processSelectKey (guint keyval, guint keycode, guint modifiers);
46
gboolean processBopomofo (guint keyval, guint keycode, guint modifiers);
47
gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
49
void updateAuxiliaryText ();
50
void updateLookupTable ();
51
void updateLookupTableFast ();
52
void updateLookupTableLabel ();
54
void updatePreeditText ();
59
gboolean insert (gint ch);
60
gint keyvalToBopomofo(gint ch);
62
gboolean removeCharBefore (void);
63
gboolean removeCharAfter (void);
64
gboolean removeWordBefore (void);
65
gboolean removeWordAfter (void);
67
gboolean moveCursorLeft (void);
68
gboolean moveCursorRight (void);
69
gboolean moveCursorLeftByWord (void);
70
gboolean moveCursorRightByWord (void);
71
gboolean moveCursorToBegin (void);
72
gboolean moveCursorToEnd (void);