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>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __PY_CONFIG_H_
22 #define __PY_CONFIG_H_
37 class Config : public Object {
39 Config (Bus & bus, const std::string & name);
40 virtual ~Config (void);
43 guint option (void) const { return m_option & m_option_mask; }
44 guint orientation (void) const { return m_orientation; }
45 guint pageSize (void) const { return m_page_size; }
46 gboolean shiftSelectCandidate (void) const { return m_shift_select_candidate; }
47 gboolean minusEqualPage (void) const { return m_minus_equal_page; }
48 gboolean commaPeriodPage (void) const { return m_comma_period_page; }
49 gboolean autoCommit (void) const { return m_auto_commit; }
50 gboolean doublePinyin (void) const { return m_double_pinyin; }
51 gint doublePinyinSchema (void) const { return m_double_pinyin_schema; }
52 gboolean doublePinyinShowRaw (void) const { return m_double_pinyin_show_raw; }
53 gboolean initChinese (void) const { return m_init_chinese; }
54 gboolean initFull (void) const { return m_init_full; }
55 gboolean initFullPunct (void) const { return m_init_full_punct; }
56 gboolean initSimpChinese (void) const { return m_init_simp_chinese; }
57 gboolean specialPhrases (void) const { return m_special_phrases; }
58 gint bopomofoKeyboardMapping (void) const { return m_bopomofo_keyboard_mapping; }
59 gint selectKeys (void) const { return m_select_keys; }
60 gboolean guideKey (void) const { return m_guide_key; }
61 gboolean auxiliarySelectKeyF (void) const { return m_auxiliary_select_key_f; }
62 gboolean auxiliarySelectKeyKP (void) const { return m_auxiliary_select_key_kp; }
63 gboolean enterKey (void) const { return m_enter_key; }
66 bool read (const gchar * name, bool defval);
67 gint read (const gchar * name, gint defval);
68 std::string read (const gchar * name, const gchar * defval);
69 void initDefaultValues (void);
71 virtual void readDefaultValues (void);
72 virtual gboolean valueChanged (const std::string §ion,
73 const std::string &name,
76 static void valueChangedCallback (IBusConfig *config,
83 std::string m_section;
89 gboolean m_shift_select_candidate;
90 gboolean m_minus_equal_page;
91 gboolean m_comma_period_page;
92 gboolean m_auto_commit;
94 gboolean m_double_pinyin;
95 gint m_double_pinyin_schema;
96 gboolean m_double_pinyin_show_raw;
98 gboolean m_init_chinese;
100 gboolean m_init_full_punct;
101 gboolean m_init_simp_chinese;
102 gboolean m_special_phrases;
104 gint m_bopomofo_keyboard_mapping;
106 gboolean m_guide_key;
107 gboolean m_auxiliary_select_key_f;
108 gboolean m_auxiliary_select_key_kp;
110 gboolean m_enter_key;