2 // Open Service Platform
\r
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
\r
5 // Licensed under the Apache License, Version 2.0 (the License);
\r
6 // you may not use this file except in compliance with the License.
\r
7 // You may obtain a copy of the License at
\r
9 // http://www.apache.org/licenses/LICENSE-2.0
\r
11 // Unless required by applicable law or agreed to in writing, software
\r
12 // distributed under the License is distributed on an "AS IS" BASIS,
\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 // See the License for the specific language governing permissions and
\r
15 // limitations under the License.
\r
19 * @file FUiImeInputMethodManager.cpp
\r
20 * @brief This is the implementation file for the %InputMethodManager class.
\r
22 * This implementation file contains definition of the %InputMethodManager class.
\r
27 #include <FBaseSysLog.h>
\r
28 #include <FUiImeInputMethodManager.h>
\r
30 #include <FSec_AccessController.h>
\r
31 #include "FUiIme_InputMethodManagerImpl.h"
\r
33 using namespace Tizen::Security;
\r
35 namespace Tizen { namespace Ui { namespace Ime {
\r
37 static InputMethodManager* __pInputMethodManager = null;
\r
39 InputMethodManager::InputMethodManager(void)
\r
40 :__pInputMethodManagerImpl(null)
\r
44 InputMethodManager::~InputMethodManager(void)
\r
46 __pInputMethodManager = null;
\r
47 __pInputMethodManagerImpl = null;
\r
51 InputMethodManager::GetInstance(void)
\r
53 result r = E_SUCCESS;
\r
55 r = _AccessController::CheckUserPrivilege(_PRV_IMEMANAGER);
\r
56 SysTryReturn(NID_UI_IME, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
\r
58 if (__pInputMethodManager == null)
\r
60 __pInputMethodManager = new(std::nothrow) InputMethodManager();
\r
61 SysTryReturn(NID_UI_IME, __pInputMethodManager, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
\r
63 __pInputMethodManager->__pInputMethodManagerImpl = _InputMethodManagerImpl::GetInstance(*__pInputMethodManager);
\r
64 r = GetLastResult();
\r
65 SysTryCatch(NID_UI_IME, __pInputMethodManager->__pInputMethodManagerImpl, , r, "[%s] Propagating.", GetErrorMessage(r));
\r
68 return __pInputMethodManager;
\r
71 delete __pInputMethodManager;
\r
72 __pInputMethodManager = null;
\r
74 __pInputMethodManager->__pInputMethodManagerImpl = null;
\r
79 Tizen::Base::Collection::IList*
\r
80 InputMethodManager::GetInputMethodInfoListN(void) const
\r
82 result r = E_SUCCESS;
\r
84 r = _AccessController::CheckUserPrivilege(_PRV_IMEMANAGER);
\r
85 SysTryReturn(NID_UI_IME, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
\r
87 return __pInputMethodManagerImpl->GetInputMethodInfoListN();
\r
91 InputMethodManager::SetInputMethod(Tizen::App::AppId id)
\r
93 result r = E_SUCCESS;
\r
95 r = _AccessController::CheckUserPrivilege(_PRV_IMEMANAGER);
\r
96 SysTryReturnResult(NID_UI_IME, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
\r
98 return __pInputMethodManagerImpl->SetInputMethod(id);
\r
101 }}} // Tizen::Ui::Ime
\r