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_PUNCT_EDITOR_
23 #define __PY_PUNCT_EDITOR_
27 #include "PYLookupTable.h"
32 class PunctEditor : public Editor {
34 PunctEditor (PinyinProperties &props, Config & config);
36 virtual gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
37 virtual void pageUp (void);
38 virtual void pageDown (void);
39 virtual void cursorUp (void);
40 virtual void cursorDown (void);
41 virtual void update (void);
42 virtual void reset (void);
43 virtual void candidateClicked (guint index, guint button, guint state);
45 virtual gboolean processPunct (guint keyval, guint keycode, guint modifiers);
46 virtual gboolean processSpace (guint keyval, guint keycode, guint modifiers);
47 virtual gboolean insert (gchar ch);
48 virtual void updateLookupTable (void);
49 virtual void updateAuxiliaryText (void);
50 virtual void updatePreeditText (void);
51 virtual gboolean selectCandidate (guint i);
52 virtual gboolean selectCandidateInPage (guint i);
53 virtual void commit (const gchar *str);
54 virtual void commit (void);
55 virtual gboolean removeCharBefore (void);
56 virtual gboolean removeCharAfter (void);
57 virtual gboolean moveCursorLeft (void);
58 virtual gboolean moveCursorRight (void);
59 virtual gboolean moveCursorToBegin (void);
60 virtual gboolean moveCursorToEnd (void);
62 void fillLookupTable (void);
63 void updatePunctCandidates (gchar ch);
70 LookupTable m_lookup_table;
72 std::vector<const gchar *> m_selected_puncts;
73 std::vector<const gchar *> m_punct_candidates;