From 3208e52e5e3ee9d55bf7aa1b5816df308a5590f8 Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Mon, 13 Apr 2015 19:11:03 +0900 Subject: [PATCH] Add isf_control interfaces to work Change-Id: Icda20ee19b048047c873a3a067a81d01ec956269 --- CMakeLists.txt | 2 +- packaging/capi-ui-inputmethod-manager.spec | 2 +- src/inputmethod_manager.cpp | 24 +++++++++++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f77c636..3dc207b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ SET(maintainer "Sungmin Kwak ") SET(description "Input Method Manager APIs") SET(service "ui") SET(submodule "inputmethod-manager") -SET(dependents "dlog isf") +SET(dependents "capi-base-common isf") SET(Services "application" diff --git a/packaging/capi-ui-inputmethod-manager.spec b/packaging/capi-ui-inputmethod-manager.spec index 0286967..81dbef0 100644 --- a/packaging/capi-ui-inputmethod-manager.spec +++ b/packaging/capi-ui-inputmethod-manager.spec @@ -6,7 +6,7 @@ Group: Graphics & UI Framework/Input License: Apache-2.0 Source0: %{name}-%{version}.tar.gz BuildRequires: cmake -BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(isf) Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig diff --git a/src/inputmethod_manager.cpp b/src/inputmethod_manager.cpp index 38a46ee..96f9029 100644 --- a/src/inputmethod_manager.cpp +++ b/src/inputmethod_manager.cpp @@ -14,34 +14,44 @@ * limitations under the License. */ -#include #include #include -#include +#include "isf_control.h" #include -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "INPUTMETHOD_MANAGER" - int ime_manager_show_ime_list(void) { + isf_control_show_ime_list(); return IME_MANAGER_ERROR_NONE; } int ime_manager_show_ime_selector(void) { + isf_control_show_ime_selector(); return IME_MANAGER_ERROR_NONE; } int ime_manager_is_ime_enabled(const char *app_id, bool *enabled) { + if (!app_id || !enabled) + return IME_MANAGER_ERROR_INVALID_PARAMETER; + + int ret = isf_control_is_ime_enabled(app_id, enabled); + if (ret < 0) + return IME_MANAGER_ERROR_OPERATION_FAILED; + return IME_MANAGER_ERROR_NONE; } int ime_manager_get_active_ime(char **app_id) { + if (!app_id) + return IME_MANAGER_ERROR_INVALID_PARAMETER; + + int ret = isf_control_get_active_ime(app_id); + if (ret < 0) + return IME_MANAGER_ERROR_OPERATION_FAILED; + return IME_MANAGER_ERROR_NONE; } -- 2.34.1