2 * ISF(Input Service Framework)
4 * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable.
5 * Copyright (c) 2012-2014 Samsung Electronics Co., Ltd.
7 * Contact: Haifeng Deng <haifeng.deng@samsung.com>, Hengliang Luo <hl.luo@samsung.com>
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)
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.
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
25 #ifndef __ISF_CONTROL_H
26 #define __ISF_CONTROL_H
28 #include <scim_visibility.h>
32 #endif /* __cplusplus */
34 /////////////////////////////////////////////////////////////////////////////
35 // Declaration of global data types.
36 /////////////////////////////////////////////////////////////////////////////
39 HARDWARE_KEYBOARD_ISE = 0, /* Hardware keyboard ISE */
40 SOFTWARE_KEYBOARD_ISE /* Software keyboard ISE */
44 * @brief The structure type to contain IME's information.
48 * @see isf_control_get_all_ime_info
55 int has_option; // 0: no keyboard option, 1: keyboard option is available, -1: unknown yet
58 /////////////////////////////////////////////////////////////////////////////
59 // Declaration of global functions.
60 /////////////////////////////////////////////////////////////////////////////
62 * @brief Set active ISE by UUID.
64 * @param uuid The active ISE's UUID.
66 * @return 0 if successfully, otherwise return -1;
68 EAPI int isf_control_set_active_ise_by_uuid (const char *uuid);
71 * @brief Get active ISE's UUID.
73 * @param uuid The parameter is used to store active ISE's UUID.
74 * Application needs free *uuid if it is not used.
76 * @return the length of UUID if successfully, otherwise return -1
78 EAPI int isf_control_get_active_ise (char **uuid);
81 * @brief Get the list of all ISEs' UUID.
83 * @param uuid_list The list is used to store all ISEs' UUID.
84 * Application needs free **uuid_list if it is not used.
86 * @return the count of UUID list if successfully, otherwise return -1;
88 EAPI int isf_control_get_ise_list (char ***uuid_list);
91 * @brief Get ISE's information according to ISE's UUID.
93 * @param uuid The ISE's UUID.
94 * @param name The parameter is used to store ISE's name. Application needs free *name if it is not used.
95 * @param language The parameter is used to store ISE's language. Application needs free *language if it is not used.
96 * @param type The parameter is used to store ISE's type.
97 * @param option The parameter is used to store ISE's option.
99 * @return 0 if successfully, otherwise return -1
101 EAPI int isf_control_get_ise_info (const char *uuid, char **name, char **language, ISE_TYPE_T *type, int *option);
104 * @brief Get ISE's information according to ISE's UUID.
106 * @param uuid The ISE's UUID.
107 * @param name The parameter is used to store ISE's name. Application needs free *name if it is not used.
108 * @param language The parameter is used to store ISE's language. Application needs free *language if it is not used.
109 * @param type The parameter is used to store ISE's type.
110 * @param option The parameter is used to store ISE's option.
111 * @param module_name The parameter is used to store ISE's module file name.
113 * @return 0 if successfully, otherwise return -1
115 EAPI int isf_control_get_ise_info_and_module_name (const char *uuid, char **name, char **language, ISE_TYPE_T *type, int *option, char **module_name);
118 * @brief Set active ISE to default ISE.
120 * @return 0 if successfully, otherwise return -1
122 EAPI int isf_control_set_active_ise_to_default (void);
125 * @brief Reset all ISEs' options.
127 * @return 0 if successfully, otherwise return -1;
129 EAPI int isf_control_reset_ise_option (void);
132 * @brief Set initial ISE by UUID.
134 * @param uuid The initial ISE's UUID.
136 * @return 0 if successfully, otherwise return -1
138 EAPI int isf_control_set_initial_ise_by_uuid (const char *uuid);
141 * @brief Get initial ISE UUID.
143 * @param uuid The parameter is used to store initial ISE's UUID.
144 * Application needs free *uuid if it is not used.
146 * @return the length of UUID if successfully, otherwise return -1;
148 EAPI int isf_control_get_initial_ise (char **uuid);
151 * @brief Show ISE selector.
153 * @return 0 if successfully, otherwise return -1;
155 EAPI int isf_control_show_ise_selector ();
158 * @brief Get the number of S/W or H/W keyboard ISEs
160 * @param type ISE's type.
162 * @return the count of ISEs if successfully, otherwise return -1;
164 EAPI int isf_control_get_ise_count (ISE_TYPE_T type);
167 * @brief Show ISE's option window.
169 * @return 0 if successfully, otherwise return -1
171 EAPI int isf_control_show_ise_option_window ();
174 * @brief Gets the information of all Software (on-screen) IME.
176 * @remarks This API should not be used by IME process.
180 * @param[out] info The parameter is used to store all IME information. Application needs to free @a *info variable
182 * @return The count of IME on success, otherwise -1
184 * @post The current active IME's has_option variable will have 0 or 1 value. Other IME's has_option variable might be -1 (unknown).
187 ime_info_s *ime_info = NULL;
188 int i, cnt = isf_control_get_all_ime_info(&ime_info);
190 for (i = 0; i < cnt; i++) {
191 LOGD("%s %s %d %d %d", ime_info[i].appid, ime_info[i].label, ime_info[i].is_enabled, ime_info[i].is_preinstalled, ime_info[i].has_option);
197 EAPI int isf_control_get_all_ime_info (ime_info_s **info);
200 * @brief Gets active IME's Application ID.
204 * @param[out] appid This is used to store active IME's Application ID. The allocated @a appid needs to be released using free()
206 * @return The length of @a appid on success, otherwise -1
208 EAPI int isf_control_get_active_ime (char **appid);
211 * @brief Sets active IME by Application ID.
215 * @param[in] appid Application ID of IME to set as active one
217 * @return 0 on success, otherwise return -1
219 EAPI int isf_control_set_active_ime (const char *appid);
222 * @brief Sets On/Off of installed IME by Application ID.
226 * @param[in] appid Application ID of IME to enable or disable
227 * @param[in] is_enabled @c true to enable the IME, otherwise @c false
229 * @return 0 on success, otherwise return -1
231 EAPI int isf_control_set_enable_ime (const char *appid, bool is_enabled);
234 * @brief Requests to open the installed IME list application.
236 * @remarks This API should not be used by inputmethod-setting application.
240 * @return 0 on success, otherwise return -1
242 EAPI int isf_control_show_ime_list (void);
245 * @brief Requests to open the IME selector application.
247 * @remarks This API should not be used by inputmethod-setting application.
251 * @return 0 on success, otherwise return -1
253 EAPI int isf_control_show_ime_selector (void);
256 * @brief Checks if the specific IME is enabled or disabled in the system keyboard setting.
260 * @param[in] appid The application ID of the IME
261 * @param[out] enabled The On (enabled) and Off (disabled) state of the IME
263 * @return 0 on success, otherwise return -1
265 EAPI int isf_control_is_ime_enabled (const char *appid, bool *enabled);
268 * @brief Get the recent geometry of S/W keyboard
272 * @param[out] x Pointer to an integer in which to store the X coordinate of the IME that appeared recently. -1 indicates unknown.
273 * @param[out] y Pointer to an integer in which to store the Y coordinate of the IME that appeared recently. -1 indicates unknown.
274 * @param[out] w Pointer to an integer in which to store the width of the IME that appeared recently. -1 indicates unknown.
275 * @param[out] h Pointer to an integer in which to store the height of the IME that appeared recently. -1 indicates unknown.
277 * @return 0 if successfully, otherwise return -1;
279 EAPI int isf_control_get_recent_ime_geometry (int *x, int *y, int *w, int *h);
283 #endif /* __cplusplus */
285 #endif /* __ISF_CONTROL_H */
288 vi:ts=4:nowrap:ai:expandtab