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_LIBPINYIN_CONFIG_H_
22 #define __PY_LIBPINYIN_CONFIG_H_
39 class LibPinyinConfig : public Config {
41 LibPinyinConfig (Bus & bus, const std::string & name);
42 virtual ~LibPinyinConfig (void);
47 void initDefaultValues (void);
49 virtual void readDefaultValues (void);
50 virtual gboolean valueChanged (const std::string §ion,
51 const std::string &name,
54 static void valueChangedCallback (IBusConfig *config,
58 LibPinyinConfig *self);
64 class LibPinyinPinyinConfig : public LibPinyinConfig {
66 static void init (Bus & bus);
67 static LibPinyinPinyinConfig & instance (void) { return *m_instance; }
70 LibPinyinPinyinConfig (Bus & bus);
71 virtual void readDefaultValues (void);
73 virtual gboolean valueChanged (const std::string §ion,
74 const std::string &name,
78 static std::unique_ptr<LibPinyinPinyinConfig> m_instance;
82 class LibPinyinBopomofoConfig : public LibPinyinConfig {
84 static void init (Bus & bus);
85 static LibPinyinBopomofoConfig & instance (void) { return *m_instance; }
88 LibPinyinBopomofoConfig (Bus & bus);
89 virtual void readDefaultValues (void);
91 virtual gboolean valueChanged (const std::string §ion,
92 const std::string &name,
96 static std::unique_ptr<LibPinyinBopomofoConfig> m_instance;