1 /** @file scim_global_config.h
2 * @brief functions to read the global configurations.
4 * The global configuration file (normally /etc/scim/global) is used to store
5 * the configurations for libscim itself and the system wide configurations which
6 * will be read before any Config module is loaded.
9 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
12 * Smart Common Input Method
14 * Copyright (c) 2004-2005 James Su <suzhe@tsinghua.org.cn>
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License as published by the Free Software Foundation; either
20 * version 2 of the License, or (at your option) any later version.
22 * This library is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU Lesser General Public License for more details.
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with this program; if not, write to the
29 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
30 * Boston, MA 02111-1307 USA
32 * $Id: scim_global_config.h,v 1.4 2005/01/10 08:30:54 suzhe Exp $
35 #ifndef __SCIM_GLOBAL_CONFIG_H
36 #define __SCIM_GLOBAL_CONFIG_H
40 * @addtogroup Accessories
41 * @ingroup InputServiceFramework
46 * @brief Read a string value from the global configuration file.
48 * @param key The key to be read, like /PanelProgram etc.
49 * @param defVal The default value to be returned if there is no such key in the configuration file.
51 * @return the value string of the key.
53 String scim_global_config_read (const String &key, const String &defVal = String ());
56 * @brief Read an int value from the global configuration file.
58 * @param key The key to be read, like /SocketTimeout etc.
59 * @param defVal The default value to be returned if there is no such key in the configuration file.
61 * @return the value of the key.
63 int scim_global_config_read (const String &key, int defVal);
66 * @brief Read a bool value from the global configuration file.
68 * @param key The key to be read.
69 * @param defVal The default value to be returned if there is no such key in the configuration file.
71 * @return the value of the key.
73 bool scim_global_config_read (const String &key, bool defVal);
76 * @brief Read a double value from the global configuration file.
78 * @param key The key to be read.
79 * @param defVal The default value to be returned if there is no such key in the configuration file.
81 * @return the value of the key.
83 double scim_global_config_read (const String &key, double defVal);
86 * @brief Read a string list from the global configuration file.
88 * @param key The key to be read.
89 * @param defVal The default value to be returned if there is no such key in the configuration file.
91 * @return the value of the key.
93 std::vector <String> scim_global_config_read (const String &key, const std::vector <String> &defVal);
96 * @brief Read an int list from the global configuration file.
98 * @param key The key to be read.
99 * @param defVal The default value to be returned if there is no such key in the configuration file.
101 * @return the value of the key.
103 std::vector <int> scim_global_config_read (const String &key, const std::vector <int> &defVal);
106 * @brief Write a string value into the user global config.
108 * @param key The key to be associated.
109 * @param val The string value to be written.
111 void scim_global_config_write (const String &key, const String &val);
114 * @brief Write an int value into the user global config.
116 * @param key The key to be associated.
117 * @param val The int value to be written.
119 void scim_global_config_write (const String &key, int val);
122 * @brief Write a bool value into the user global config.
124 * @param key The key to be associated.
125 * @param val The bool value to be written.
127 void scim_global_config_write (const String &key, bool val);
130 * @brief Write a double value into the user global config.
132 * @param key The key to be associated.
133 * @param val The double value to be written.
135 void scim_global_config_write (const String &key, double val);
138 * @brief Write a string list into the user global config.
140 * @param key The key to be associated.
141 * @param val The string list to be written.
143 void scim_global_config_write (const String &key, const std::vector <String> &val);
146 * @brief Write an int list into the user global config.
148 * @param key The key to be associated.
149 * @param val The int list to be written.
151 void scim_global_config_write (const String &key, const std::vector <int> &val);
154 * @brief Reset the value associated to the specified key to its default value.
156 * @param key The key to be reset.
158 void scim_global_config_reset (const String &key);
161 * @brief update the global config
163 void scim_global_config_update();
165 * @brief Flush the updated global config into user global config file.
166 * @return true if success.
168 bool scim_global_config_flush ();
173 #endif //__SCIM_GLOBAL_CONFIG_H
175 vi:ts=4:nowrap:ai:expandtab