Git init
[framework/uifw/isf.git] / ism / src / isf_query_utility.h
1 /*
2  * ISF(Input Service Framework)
3  *
4  * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable.
5  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6  *
7  * Contact: Haifeng Deng <haifeng.deng@samsung.com>, Hengliang Luo <hl.luo@samsung.com>
8  *
9  * This library is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU Lesser General Public License as published by the
11  * Free Software Foundation; either version 2.1 of the License, or (at your option)
12  * any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
15  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  * License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this library; if not, write to the Free Software Foundation, Inc., 51
21  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  */
24
25 #ifndef __ISF_QUERY_UTILITY_H
26 #define __ISF_QUERY_UTILITY_H
27
28 using namespace scim;
29
30
31 /////////////////////////////////////////////////////////////////////////////
32 // Declaration of macro.
33 /////////////////////////////////////////////////////////////////////////////
34 #define MAXLINE                         4096
35 #define USER_ENGINE_LIST_PATH           "/opt/home/root/.scim"
36
37 #ifndef SCIM_SYSCONFDIR
38   #define SCIM_SYSCONFDIR               "/usr/etc"
39 #endif
40
41 #define USER_ENGINE_FILE_NAME           (USER_ENGINE_LIST_PATH "/engines_list")
42 #define SYS_ENGINE_FILE_NAME            (SCIM_SYSCONFDIR "/scim/engines_list")
43
44
45 typedef struct {
46     String name;
47     String uuid;
48     String module;
49     String language;
50     String icon;
51     TOOLBAR_MODE_T mode;
52     uint32 option;
53     String locales;
54 } ISEINFO;
55
56 String isf_get_normalized_language (String src_str);
57 String isf_combine_ise_info_string (String name, String uuid, String module, String language,
58                                     String icon, String mode, String option, String locales);
59 void isf_get_ise_info_from_string (const char *str, ISEINFO &info);
60 bool isf_read_ise_info_list (const char *filename, std::vector<ISEINFO> &info_list);
61 bool isf_write_ise_info_list (const char *filename, std::vector<ISEINFO> &info_list);
62 bool isf_add_keyboard_info_to_file (const char *filename, const char *module_name, const ConfigPointer &config);
63 bool isf_add_helper_info_to_file (const char *filename, const char *module_name);
64 void isf_remove_ise_info_from_file (const char *filename, const char *module_name);
65 void isf_update_ise_info_to_file (const char *filename, const ConfigPointer &config);
66
67 #endif /* __ISF_QUERY_UTILITY_H */
68
69 /*
70 vi:ts=4:ai:nowrap:expandtab
71 */