tizen 2.4 release
[framework/api/inputmethod-manager.git] / include / inputmethod_manager.h
1 /*
2  * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __TIZEN_UIX_INPUTMETHOD_MANAGER_H__
18 #define __TIZEN_UIX_INPUTMETHOD_MANAGER_H__
19
20 /**
21  * @file inputmethod_manager.h
22  * @brief This file contains input method manager APIs for input method editor (IME) list and selector settings.
23  */
24
25 #include <tizen.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /**
32  * @addtogroup CAPI_UIX_INPUTMETHOD_MANAGER_MODULE
33  * @{
34  */
35
36 /**
37  * @brief Enumeration for input method manager function error
38  *
39  * @since_tizen 2.4
40  */
41 typedef enum
42 {
43     IME_MANAGER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
44     IME_MANAGER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
45     IME_MANAGER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
46     IME_MANAGER_ERROR_OPERATION_FAILED = TIZEN_ERROR_IME | 0x0010, /**< Operation failed */
47 } ime_manager_error_e;
48
49 /**
50  * @brief Requests to open the installed IME list menu.
51  *
52  * @details This function provides the installed IME list menu for the IME developers who might want to open it to enable their IME.
53  *
54  * @since_tizen 2.4
55  *
56  * @privlevel public
57  *
58  * @privilege %http://tizen.org/privilege/imemanager
59  *
60  * @return 0 on success, otherwise a negative error value
61  * @retval #IME_MANAGER_ERROR_NONE No error
62  * @retval #IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
63  * @retval #IME_MANAGER_ERROR_OPERATION_FAILED Operation failed
64  *
65  * @see ime_manager_show_ime_selector
66  */
67 EXPORT_API int ime_manager_show_ime_list(void);
68
69 /**
70  * @brief Requests to open the IME selector menu.
71  *
72  * @details This function provides the IME selector menu for the IME or other application developers who might want to change the default IME.
73  *
74  * @since_tizen 2.4
75  *
76  * @privlevel public
77  *
78  * @privilege %http://tizen.org/privilege/imemanager
79  *
80  * @return 0 on success, otherwise a negative error value
81  * @retval #IME_MANAGER_ERROR_NONE No error
82  * @retval #IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
83  * @retval #IME_MANAGER_ERROR_OPERATION_FAILED Operation failed
84  *
85  * @see ime_manager_show_ime_list
86  */
87 EXPORT_API int ime_manager_show_ime_selector(void);
88
89 /**
90  * @brief Checks if the specific IME is enabled or disabled in the system keyboard setting.
91  *
92  * @details The IME developers can use this function to check their IME is enabled or not.
93  *
94  * @since_tizen 2.4
95  *
96  * @privlevel public
97  *
98  * @privilege %http://tizen.org/privilege/imemanager
99  *
100  * @param[in] app_id The application ID of the IME
101  * @param[out] enabled The On (enabled) and Off (disabled) state of the IME
102  *
103  * @return 0 on success, otherwise a negative error value
104  * @retval #IME_MANAGER_ERROR_NONE No error
105  * @retval #IME_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
106  * @retval #IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
107  * @retval #IME_MANAGER_ERROR_OPERATION_FAILED Operation failed
108  *
109  * @see ime_manager_show_ime_list
110  */
111 EXPORT_API int ime_manager_is_ime_enabled(const char *app_id, bool *enabled);
112
113 /**
114  * @brief Checks which IME is the current activated (selected) IME.
115  *
116  * @remarks @a app_id must be released using free().
117  *
118  * @since_tizen 2.4
119  *
120  * @privlevel public
121  *
122  * @privilege %http://tizen.org/privilege/imemanager
123  *
124  * @param[out] app_id The application ID of the active IME
125  *
126  * @return 0 on success, otherwise a negative error value
127  * @retval #IME_MANAGER_ERROR_NONE No error
128  * @retval #IME_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
129  * @retval #IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
130  * @retval #IME_MANAGER_ERROR_OPERATION_FAILED Operation failed
131  *
132  * @see ime_manager_show_ime_selector
133  */
134 EXPORT_API int ime_manager_get_active_ime(char **app_id);
135
136 /**
137  * @}
138  */
139
140 #ifdef __cplusplus
141 }
142 #endif
143
144 #endif // __TIZEN_UIX_INPUTMETHOD_MANAGER_H__
145