~ubuntu-branches/ubuntu/saucy/ibus-pinyin/saucy-proposed

« back to all changes in this revision

Viewing changes to src/PYBopomofoEditor.h

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing, Asias He
  • Date: 2010-09-08 21:38:54 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100908213854-q4wlx8zlcyqxvelz
Tags: 1.3.11-1
[ Asias He ]
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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) 2010 BYVoid <byvoid1@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_BOPOMOFO_EDITOR_H_
 
23
#define __PY_BOPOMOFO_EDITOR_H_
 
24
 
 
25
#include "PYPhoneticEditor.h"
 
26
 
 
27
namespace PY {
 
28
 
 
29
class Config;
 
30
 
 
31
#define MAX_PINYIN_LEN 64
 
32
 
 
33
class BopomofoEditor : public PhoneticEditor {
 
34
 
 
35
public:
 
36
    BopomofoEditor (PinyinProperties & props, Config & config);
 
37
    ~BopomofoEditor (void);
 
38
 
 
39
protected:
 
40
    std::wstring bopomofo;
 
41
    gboolean m_select_mode;
 
42
 
 
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);
 
48
 
 
49
    void updateAuxiliaryText ();
 
50
    void updateLookupTable ();
 
51
    void updateLookupTableFast ();
 
52
    void updateLookupTableLabel ();
 
53
    void updatePinyin ();
 
54
    void updatePreeditText ();
 
55
 
 
56
    void commit ();
 
57
    void reset ();
 
58
 
 
59
    gboolean insert (gint ch);
 
60
    gint keyvalToBopomofo(gint ch);
 
61
 
 
62
    gboolean removeCharBefore (void);
 
63
    gboolean removeCharAfter (void);
 
64
    gboolean removeWordBefore (void);
 
65
    gboolean removeWordAfter (void);
 
66
 
 
67
    gboolean moveCursorLeft (void);
 
68
    gboolean moveCursorRight (void);
 
69
    gboolean moveCursorLeftByWord (void);
 
70
    gboolean moveCursorRightByWord (void);
 
71
    gboolean moveCursorToBegin (void);
 
72
    gboolean moveCursorToEnd (void);
 
73
 
 
74
};
 
75
 
 
76
};
 
77
 
 
78
#endif