## SET LINKER FLAGS
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed")
-TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw")
TARGET_LINK_LIBRARIES(${this_target} "-losp-uifw")
+TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw")
TARGET_LINK_LIBRARIES(${this_target} "-ldlog")
TARGET_LINK_LIBRARIES(${this_target} "-ldl")
TARGET_LINK_LIBRARIES(${this_target} "-lecore")
#include <FUiImeInputMethod.h>\r
#include <FUiImeInputMethodInfo.h>\r
#include <FUiImeInputMethodManager.h>\r
+#include <FUiImeTypes.h>\r
\r
/**\r
* @namespace Tizen::Ui::Ime\r
: virtual public Tizen::Base::Runtime::IEventListener
{
public:
- /**
+ /**
* This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this
* interface is called.
*
*/
virtual ~IInputMethodListener(void) {}
- /**
+ /**
* Called when the position of the cursor in an associated text input UI control changes.
*
* @since 2.1
*/
virtual void OnCursorPositionChanged(int position) {}
- /**
+ /**
+ * Called when a client of the input method sends the opaque command.
+ *
+ * @since 2.1
+ * @privlevel partner
+ * @privilege http://tizen.org/privilege/ime
+ *
+ * @param[in] command The opaque command
+ * @remarks The opaque command is the engaged command between the certain input method and their clients which know opaque commands. It is for
+ * additional options that the input method does not provide. A string format of the opaque command can be described as like
+ * "org.tizen.MyApp.OpaqueCommand=True".
+ */
+ virtual void OnOpaqueCommandReceived(const Tizen::Base::String& command) {}
+
+ /**
* Called when an associated text input UI control responds to a request with the surrounding text.
*
* @since 2.1
// @since 2.1
//
virtual void IInputMethodListener_Reserved4(void) {}
-
- //
- // This method is for internal use only. Using this method can cause behavioral, security-related,
- // and consistency-related issues in the application.
- //
- // Following method is reserved and may change its name at any time without
- // prior notice.
- //
- // @since 2.1
- //
- virtual void IInputMethodListener_Reserved5(void) {}
};
}}} // Tizen::Ui::Ime
*
* @return The enter key action of the input panel
*/
- virtual Tizen::Ui::InputPanelAction GetEnterKeyAction(void) {return Tizen::Ui::INPUT_PANEL_ACTION_ENTER;}
+ virtual Tizen::Ui::InputPanelAction GetEnterKeyAction(void)
+ {
+ return Tizen::Ui::INPUT_PANEL_ACTION_ENTER;
+ }
/**
* Called when the associated text input UI control requests the position and size of the input panel.
*
* @return A style of the input panel
*/
- virtual Tizen::Ui::InputPanelStyle GetInputPanelStyle(void) {return Tizen::Ui::INPUT_PANEL_STYLE_NORMAL;}
+ virtual Tizen::Ui::InputPanelStyle GetInputPanelStyle(void)
+ {
+ return Tizen::Ui::INPUT_PANEL_STYLE_NORMAL;
+ }
- /*
+ /**
* Called when the associated text input UI control requests the language of the input method.
*
* @since 2.1
*
* @return A language of the input method
*/
- virtual Tizen::Locales::Locale GetLanguage(void) {return Tizen::Locales::Locale(Tizen::Locales::LANGUAGE_ENG,
- Tizen::Locales::COUNTRY_US);}
+ virtual Tizen::Locales::Locale GetLanguage(void)
+ {
+ return Tizen::Locales::Locale(Tizen::Locales::LANGUAGE_ENG, Tizen::Locales::COUNTRY_US);
+ }
/**
* Called when the associated text input UI control requests the input panel to enable or disable the caps mode.
*
* @return The state of the enter key action
*/
- virtual bool IsEnterKeyActionEnabled(void) {return false;}
+ virtual bool IsEnterKeyActionEnabled(void)
+ {
+ return false;
+ }
/**
* Called when the associated text input UI control requests the input panel to show itself.
// @since 2.1
//
virtual void IInputMethodProvider_Reserved4(void) {}
-
- //
- // This method is for internal use only. Using this method can cause behavioral, security-related,
- // and consistency-related issues in the application.
- //
- // Following method is reserved and may change its name at any time without
- // prior notice.
- //
- // @since 2.1
- //
- virtual void IInputMethodProvider_Reserved5(void) {}
};
}}} // Tizen::Ui::Ime
: public Tizen::Base::Object
{
public:
- /**
+ /**
* Gets an instance of the %InputMethod.
*
* @since 2.1
*/
result NotifyInputPanelState(Tizen::Ui::InputPanelShowState state);
- /*
+ /**
* Notifies a point of time when the language of the input method changes.
*
* @since 2.1
#include <FBaseObject.h>\r
#include <FBaseString.h>\r
#include <FOspConfig.h>\r
+#include <FUiImeTypes.h>\r
\r
namespace Tizen { namespace Ui { namespace Ime {\r
\r
*/\r
Tizen::Base::String GetName(void) const;\r
\r
+ /**\r
+ * Gets the type of an input method.\r
+ *\r
+ * @since 2.1\r
+ * @privlevel platform\r
+ * @privilege http://tizen.org/privilege/imemanager\r
+ *\r
+ * @return The type\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ */\r
+ InputMethodType GetType(void) const;\r
+\r
private:\r
//\r
// This Equals() is intentionally declared as private so that only the platform can compare the object received as an input parameter with this object.\r
*/\r
static InputMethodManager* GetInstance(void);\r
\r
- /*\r
+ /**\r
* Gets the %InputMethodInfo of the active input method.\r
*\r
* @since 2.1\r
* @return An instance of the InputMethodInfo\r
* @exception E_SUCCESS The method is successful.\r
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
- * @remarks The specific error code can be accessed using the GetLastResult() method.\r
+ * @remarks If an error occurs then this function returns @c null and the specific error code can be accessed using the GetLastResult() method.\r
*/\r
InputMethodInfo* GetActiveInputMethodInfoN(void) const;\r
\r
*/\r
result SetInputMethod(const Tizen::App::AppId& id);\r
\r
- /*\r
+ /**\r
* Checks whether an input method is active or not.\r
*\r
* @since 2.1\r
--- /dev/null
+//\r
+// Open Service Platform\r
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the License);\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+// http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+//\r
+\r
+/**\r
+ * @file FUiImeTypes.h\r
+ * @brief This is the header file for the data types.\r
+ *\r
+ * This header file contains the declarations of the data types.\r
+ */\r
+\r
+#ifndef _FUI_IME_TYPES_H_\r
+#define _FUI_IME_TYPES_H_\r
+\r
+namespace Tizen { namespace Ui { namespace Ime {\r
+\r
+/**\r
+ * @enum InputMethodType\r
+ *\r
+ * Defines the types of the input method.\r
+ *\r
+ * @since 2.1\r
+ * \r
+ */\r
+enum InputMethodType\r
+{\r
+ INPUT_METHOD_TYPE_SOFTWARE, /**< On-screen soft input panel */\r
+ INPUT_METHOD_TYPE_HARDWARE /**< Hardware input engine */\r
+};\r
+\r
+}}} // Tizen::Ui::Ime\r
+\r
+#endif // _FUI_IME_TYPES_H_\r
return __pInputMethodInfoImpl->GetName();\r
}\r
\r
+InputMethodType\r
+InputMethodInfo::GetType(void) const\r
+{\r
+ result r = E_SUCCESS;\r
+\r
+ r = _AccessController::CheckUserPrivilege(_PRV_IMEMANAGER);\r
+ SysTryReturn(NID_UI_IME, r == E_SUCCESS, INPUT_METHOD_TYPE_SOFTWARE, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");\r
+\r
+ return __pInputMethodInfoImpl->GetType();\r
+}\r
+\r
}}} // Tizen::Ui::Ime\r
__pHelperAgent->signal_connect_set_return_key_disable(scim::slot(_InputServiceSignalListener::SetEnterKeyActionEnabled));
__pHelperAgent->signal_connect_set_return_key_type(scim::slot(_InputServiceSignalListener::SetEnterKeyAction));
- __pHelperAgent->signal_connect_exit(scim::slot(_InputServiceSignalListener::OnTerminate));
__pHelperAgent->signal_connect_ise_hide(scim::slot(_InputServiceSignalListener::HideInputPanel));
__pHelperAgent->signal_connect_ise_show(scim::slot(_InputServiceSignalListener::ShowInputPanel));
+
__pHelperAgent->signal_connect_update_cursor_position(scim::slot(_InputServiceSignalListener::OnCursorPositionChanged));
+ __pHelperAgent->signal_connect_set_imdata(scim::slot(_InputServiceSignalListener::OnOpaqueCommandReceived));
__pHelperAgent->signal_connect_update_surrounding_text(scim::slot(_InputServiceSignalListener::OnSurroundingTextReceived));
+ __pHelperAgent->signal_connect_exit(scim::slot(_InputServiceSignalListener::OnTerminate));
+
SysLog(NID_UI_IME, "The signal callback functions of the input service have been set");
}
result r = E_SUCCESS;\r
\r
__appId = impl.__appId;\r
+ __uuid = impl.__uuid;\r
__name = impl.__name;\r
+ __type = impl.__type;\r
\r
std::unique_ptr<ArrayList> pLanguageList(new(std::nothrow) ArrayList(SingleObjectDeleter));\r
SysTryReturnVoidResult(NID_UI_IME, pLanguageList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");\r
if (&impl != this)\r
{\r
__appId = impl.__appId;\r
+ __uuid = impl.__uuid;\r
__name = impl.__name;\r
+ __type = impl.__type;\r
\r
r = SetLanguageList(*(impl.__pLanguageList));\r
SysTryReturn(NID_UI_IME, r == E_SUCCESS, *this, r, "[%s] Propagating.", GetErrorMessage(r));\r
return __name;\r
}\r
\r
+InputMethodType\r
+_InputMethodInfoImpl::GetType(void) const\r
+{\r
+ return __type;\r
+}\r
+\r
const char*\r
_InputMethodInfoImpl::GetUuid(void) const\r
{\r
_ScimDataConverter::ConvertString(name, __name);\r
}\r
\r
+void\r
+_InputMethodInfoImpl::SetType(Tizen::Ui::Ime::InputMethodType type)\r
+{\r
+ __type = type;\r
+}\r
+\r
result\r
_InputMethodInfoImpl::AddLanguage(const char* language)\r
{\r
#include <FBaseString.h>\r
#include <FLclLocale.h>\r
#include <FUiImeInputMethodInfo.h>\r
+#include <FUiImeTypes.h>\r
\r
namespace Tizen { namespace Ui { namespace Ime {\r
\r
Tizen::App::AppId GetAppId(void) const;\r
const Tizen::Base::Collection::IList* GetLanguageList(void) const;\r
Tizen::Base::String GetName(void) const;\r
+ Tizen::Ui::Ime::InputMethodType GetType(void) const;\r
const char* GetUuid(void) const;\r
\r
void SetAppId(Tizen::App::AppId id);\r
result SetLanguageList(const Tizen::Base::Collection::IList& list);\r
void SetName(const Tizen::Base::String& name);\r
void SetName(const scim::String& name);\r
+ void SetType(Tizen::Ui::Ime::InputMethodType type);\r
\r
result AddLanguage(const char* language);\r
\r
Tizen::App::AppId __appId;\r
Tizen::Base::String __uuid;\r
Tizen::Base::String __name;\r
+ Tizen::Ui::Ime::InputMethodType __type;\r
\r
Tizen::Base::Collection::ArrayList* __pLanguageList;\r
\r
\r
#include "FUiIme_InputMethodInfoImpl.h"\r
#include "FUiIme_InputMethodManagerImpl.h"\r
+#include "FUiIme_ScimDataConverter.h"\r
\r
using namespace Tizen::App;\r
using namespace Tizen::App::Package;\r
// declare variables\r
xmlDocPtr pXmlDoc = null;\r
xmlNodePtr pXmlRootElement = null;\r
+ _InputMethodInfoImpl* pInputMethodInfoImpl = null;\r
\r
// get the manifest file path\r
const char* _MANIFEST_FILE_PATH = "/info/manifest.xml";\r
r = ParseInputMethodInfo(pXmlRootElement, pInputMethodInfo.get());\r
SysTryCatch(NID_UI_IME, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));\r
\r
+ pInputMethodInfoImpl = _InputMethodInfoImpl::GetInstance(*(pInputMethodInfo.get()));\r
+ pInputMethodInfoImpl->SetType(INPUT_METHOD_TYPE_SOFTWARE);\r
+\r
if (pXmlDoc)\r
{\r
xmlFreeDoc(pXmlDoc);\r
pInputMethodInfoImpl->SetAppId(PRELOADED_IME_APPID);\r
pInputMethodInfoImpl->SetUuid(dpList[preloadedImeIndex]);\r
pInputMethodInfoImpl->SetName(String(pName));\r
+ pInputMethodInfoImpl->SetType(_ScimDataConverter::ConvertType(type));\r
pLanguageList.reset(GetInputMethodLanguageListN(pLanguage));\r
r = GetLastResult();\r
SysTryCatch(NID_UI_IME, pLanguageList, , r, "[%s] Propagating.", GetErrorMessage(r));\r
{\r
SysTryReturnVoidResult(NID_UI_IME, __pIInputMethodProvider, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The required instance does not exist.");\r
\r
- //Locale language = __pIInputMethodProvider->GetLanguage();\r
- //std::unique_ptr<char[]> pLanguage(_ScimDataConverter::ConvertLanguageN(language));\r
+ Locale language = __pIInputMethodProvider->GetLanguage();\r
+ std::unique_ptr<char[]> pLanguage(_ScimDataConverter::ConvertLanguageN(language));\r
\r
- //*pLocale = strdup(pLanguage.get());\r
+ *pLocale = strdup(pLanguage.get());\r
}\r
\r
void\r
}\r
\r
void\r
+_InputServiceSignalListener::OnOpaqueCommandReceived(const scim::HelperAgent* pHelperAgent, char* pBuffer, size_t& length)\r
+{\r
+ SysTryReturnVoidResult(NID_UI_IME, __pIInputMethodListener, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The required instance does not exist.");\r
+\r
+ __pIInputMethodListener->OnOpaqueCommandReceived(String(pBuffer));\r
+}\r
+\r
+void\r
_InputServiceSignalListener::OnSurroundingTextReceived(const scim::HelperAgent* pHelperAgent, int inputContext, const scim::String& text, int cursorPosition)\r
{\r
SysTryReturnVoidResult(NID_UI_IME, __pIInputMethodListener, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The required instance does not exist.");\r
\r
static void OnCursorPositionChanged(const scim::HelperAgent* pHelperAgent, int inputContext, const scim::String& uuid,\r
int position);\r
+ static void OnOpaqueCommandReceived(const scim::HelperAgent* pHelperAgent, char* pBuffer, size_t& length);\r
static void OnSurroundingTextReceived(const scim::HelperAgent* pHelperAgent, int inputContext,\r
const scim::String& text, int cursorPosition);\r
static void OnTerminate(const scim::HelperAgent* pHelperAgent, int inputContext, const scim::String& uuid);\r
\r
}\r
\r
+Tizen::Ui::Ime::InputMethodType\r
+_ScimDataConverter::ConvertType(ISE_TYPE_T type)\r
+{\r
+ InputMethodType inputMethodType = INPUT_METHOD_TYPE_SOFTWARE;\r
+\r
+ if (type == HARDWARE_KEYBOARD_ISE)\r
+ {\r
+ inputMethodType = INPUT_METHOD_TYPE_HARDWARE;\r
+ }\r
+ else if (type == SOFTWARE_KEYBOARD_ISE)\r
+ {\r
+ inputMethodType = INPUT_METHOD_TYPE_SOFTWARE;\r
+ }\r
+\r
+ return inputMethodType;\r
+}\r
+\r
result\r
_ScimDataConverter::ConvertKey(KeyCode code, KeyState state, scim::KeyEvent& event)\r
{\r
\r
#include <string> // basic_string in scim_types.h\r
\r
+#include <isf_control.h>\r
#define Uses_SCIM_EVENT\r
#define Uses_SCIM_TYPES\r
#undef null\r
#include <FGrpRectangle.h>\r
#include <FLclLocale.h>\r
#include <FUiIKeyEventListener.h>\r
+#include <FUiImeTypes.h>\r
\r
namespace Tizen { namespace Ui { namespace Ime {\r
\r
class _ScimDataConverter\r
{\r
public:\r
+ static Tizen::Ui::Ime::InputMethodType ConvertType(ISE_TYPE_T type);\r
+\r
static result ConvertKey(Tizen::Ui::KeyCode keyCode, Tizen::Ui::KeyState keyState, scim::KeyEvent& keyEvent);\r
\r
static char* ConvertLanguageN(const Tizen::Locales::Locale& language);\r