1 /* vim:set et ts=4 sts=4:
3 * ibus-libpinyin - Intelligent Pinyin engine based on libpinyin 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 std::string dictionaries (void) const { return m_dictionaries; }
44 guint option (void) const { return m_option & m_option_mask; }
45 guint orientation (void) const { return m_orientation; }
46 guint pageSize (void) const { return m_page_size; }
47 gboolean ctrlSwitch(void) const { return m_ctrl_switch; }
48 gboolean shiftSelectCandidate (void) const { return m_shift_select_candidate; }
49 gboolean minusEqualPage (void) const { return m_minus_equal_page; }
50 gboolean commaPeriodPage (void) const { return m_comma_period_page; }
51 gboolean autoCommit (void) const { return m_auto_commit; }
52 gboolean doublePinyin (void) const { return m_double_pinyin; }
53 gint doublePinyinSchema (void) const { return m_double_pinyin_schema; }
54 gboolean doublePinyinShowRaw (void) const { return m_double_pinyin_show_raw; }
55 gboolean initChinese (void) const { return m_init_chinese; }
56 gboolean initFull (void) const { return m_init_full; }
57 gboolean initFullPunct (void) const { return m_init_full_punct; }
58 gboolean initSimpChinese (void) const { return m_init_simp_chinese; }
59 gboolean specialPhrases (void) const { return m_special_phrases; }
60 gint bopomofoKeyboardMapping (void) const { return m_bopomofo_keyboard_mapping; }
61 gint selectKeys (void) const { return m_select_keys; }
62 gboolean guideKey (void) const { return m_guide_key; }
63 gboolean auxiliarySelectKeyF (void) const { return m_auxiliary_select_key_f; }
64 gboolean auxiliarySelectKeyKP (void) const { return m_auxiliary_select_key_kp; }
65 gboolean enterKey (void) const { return m_enter_key; }
68 bool read (const gchar * name, bool defval);
69 gint read (const gchar * name, gint defval);
70 std::string read (const gchar * name, const gchar * defval);
71 void initDefaultValues (void);
73 virtual void readDefaultValues (void);
74 virtual gboolean valueChanged (const std::string §ion,
75 const std::string &name,
78 static void valueChangedCallback (IBusConfig *config,
85 std::string m_section;
86 std::string m_dictionaries;
92 gboolean m_ctrl_switch;
93 gboolean m_shift_select_candidate;
94 gboolean m_minus_equal_page;
95 gboolean m_comma_period_page;
96 gboolean m_auto_commit;
98 gboolean m_double_pinyin;
99 gint m_double_pinyin_schema;
100 gboolean m_double_pinyin_show_raw;
102 gboolean m_init_chinese;
103 gboolean m_init_full;
104 gboolean m_init_full_punct;
105 gboolean m_init_simp_chinese;
106 gboolean m_special_phrases;
108 gint m_bopomofo_keyboard_mapping;
110 gboolean m_guide_key;
111 gboolean m_auxiliary_select_key_f;
112 gboolean m_auxiliary_select_key_kp;
114 gboolean m_enter_key;