* @retval #IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
* @retval #IME_MANAGER_ERROR_OPERATION_FAILED Operation failed
*
- * @see ime_manager_show_ime_selector
+ * @see ime_manager_show_ime_selector()
*/
EXPORT_API int ime_manager_show_ime_list(void);
* @retval #IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
* @retval #IME_MANAGER_ERROR_OPERATION_FAILED Operation failed
*
- * @see ime_manager_show_ime_list
+ * @see ime_manager_show_ime_list()
*/
EXPORT_API int ime_manager_show_ime_selector(void);
* @retval #IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
* @retval #IME_MANAGER_ERROR_OPERATION_FAILED Operation failed
*
- * @see ime_manager_show_ime_list
+ * @see ime_manager_show_ime_list()
*/
EXPORT_API int ime_manager_is_ime_enabled(const char *app_id, bool *enabled);
* @retval #IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
* @retval #IME_MANAGER_ERROR_OPERATION_FAILED Operation failed
*
- * @see ime_manager_show_ime_selector
+ * @see ime_manager_show_ime_selector()
*/
EXPORT_API int ime_manager_get_active_ime(char **app_id);
+/**
+ * @brief Gets the number of IMEs which are enabled (usable).
+ *
+ * @since_tizen 3.0
+ *
+ * @remarks The specific error code can be obtained using the get_last_result() method.
+ * Error codes are described in Exception section.
+ *
+ * @privlevel public
+ *
+ * @privilege %http://tizen.org/privilege/imemanager
+ *
+ * @return The @a number of enabled IMEs on success, otherwise @c 0.
+ *
+ * @exception IME_MANAGER_ERROR_NONE Successful
+ * @exception IME_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @exception IME_MANAGER_ERROR_OPERATION_FAILED Operation failed
+ *
+ * @see ime_manager_is_ime_enabled()
+ * @see ime_manager_show_ime_selector()
+ */
+EXPORT_API int ime_manager_get_enabled_ime_count(void);
+
/**
* @}
*/
return IME_MANAGER_ERROR_NONE;
}
+int ime_manager_get_enabled_ime_count(void)
+{
+ ime_manager_error_e retVal = IME_MANAGER_ERROR_NONE;
+ ime_info_s *ime_info = NULL;
+ int i, enable_ime_count = 0, total_ime_count;
+
+ retVal = _check_privilege();
+ if (retVal != IME_MANAGER_ERROR_NONE) {
+ set_last_result(IME_MANAGER_ERROR_PERMISSION_DENIED);
+ LOGE("_check_privilege returned %d.", retVal);
+ return enable_ime_count;
+ }
+
+ total_ime_count = isf_control_get_all_ime_info(&ime_info);
+ if (ime_info) {
+ for (i = 0; i < total_ime_count; i++) {
+ if (ime_info[i].is_enabled)
+ enable_ime_count++;
+ }
+ free(ime_info);
+ }
+
+ if (enable_ime_count == 0)
+ set_last_result(IME_MANAGER_ERROR_OPERATION_FAILED);
+ else
+ set_last_result(IME_MANAGER_ERROR_NONE);
+
+ return enable_ime_count;
+}