1 /** @file scim_config_module.h
2 * @brief Define scim::ConfigModule class for manipulating the config modules.
4 * Class scim::ConfigModule is a wrapper of class scim::Module,
5 * which is for manipulating the configuration modules.
8 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
11 * Smart Common Input Method
13 * Copyright (c) 2002-2005 James Su <suzhe@tsinghua.org.cn>
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2 of the License, or (at your option) any later version.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this program; if not, write to the
28 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
29 * Boston, MA 02111-1307 USA
31 * $Id: scim_config_module.h,v 1.15 2005/04/09 15:38:39 suzhe Exp $
34 #ifndef __SCIM_CONFIG_MODULE_H
35 #define __SCIM_CONFIG_MODULE_H
40 * @ingroup InputServiceFramework
45 * @brief The prototype of initialization function in config modules.
47 * There must be a function called "scim_config_module_init"
48 * which complies with this prototype.
49 * This function name can have a prefix like simple_LTX_,
50 * in which "simple" is the module's name.
52 typedef void (*ConfigModuleInitFunc) (void);
55 * @brief The prototype of configure object creation function in config modules.
57 * There must be a function called "scim_config_module_create_config"
58 * which complies with this prototype.
59 * This function name can have a prefix like simple_LTX_,
60 * in which "simple" is the module's name.
62 typedef ConfigPointer (*ConfigModuleCreateConfigFunc) ();
65 * @brief The class to manipulate the config modules.
67 * This is a wrapper of scim::Module class, which is specially
68 * for manipulating the config modules.
74 ConfigModuleInitFunc m_config_init;
75 ConfigModuleCreateConfigFunc m_config_create_config;
77 ConfigModule (const ConfigModule &);
78 ConfigModule & operator= (const ConfigModule &);
82 * @brief Default constructor.
88 * @param name - the module's name, eg. "simple".
90 ConfigModule (const String &name);
93 * @brief Load a module by its name.
95 * Load a module into memory.
96 * If another module has been loaded into this object,
97 * then the old module will be unloaded first.
98 * If the old module is resident, false will be returned,
99 * and the old module will be untouched.
101 * @param name - the module's name, eg. "simple".
102 * @return true if success.
104 bool load (const String &name);
107 * @brief Check if a module is loaded and initialized successfully.
108 * @return true if a module is already loaded and initialized successfully.
113 * @brief Create a configuration object from this module.
115 * The type of newly created configuration object
116 * must be a derived class of scim::ConfigBase.
118 * @return a smart pointer points to the configuration object.
120 ConfigPointer create_config () const;
124 * @brief Get a name list of currently available configuration modules.
125 * @param mod_list - the result list will be stored here.
126 * @return the number of the modules, equal to mod_list.size ().
128 int scim_get_config_module_list (std::vector <String>& mod_list);
134 #endif //__SCIM_CONFIG_MODULE_H
137 vi:ts=4:ai:nowrap:expandtab