static void slot_stop_default_ise (bool is_exist);
static void slot_run_helper (const String &uuid, const String &config, const String &display);
static bool slot_launch_option_application (String ime_appid);
+static bool slot_get_ise_setting_appid (String ime_appid, String &ime_setting_appid);
#if ENABLE_REMOTE_INPUT
static void slot_send_remote_input_message (const String &msg, bool len);
_info_manager->signal_connect_run_helper (slot (slot_run_helper));
_info_manager->signal_connect_launch_option_application (slot (slot_launch_option_application));
+ _info_manager->signal_connect_get_ise_setting_appid (slot (slot_get_ise_setting_appid));
LOGD ("initializing panel agent succeeded");
app_control_destroy (app_control);
if (ret != APP_CONTROL_ERROR_NONE) {
- LOGW ("Failed to launch IME (%s)", app_id);
+ LOGW ("Failed to launch IME. appid(%s). reason(%s)", app_id, get_error_message(ret));
} else {
- LOGD ("Succeeded to launch IME (%s)", app_id);
+ LOGD ("Succeeded to launch IME. appid(%s)", app_id);
}
return (ret == APP_CONTROL_ERROR_NONE);
return false;
}
+static bool slot_get_ise_setting_appid (String ime_appid, String &ime_setting_appid)
+{
+ ime_setting_appid = isf_pkg_get_setting_app (ime_appid);
+
+ LOGD ("IME appid : %s, IME setting app ID : %s", ime_appid.c_str(), ime_setting_appid.c_str());
+ return ime_setting_appid.length () > 0 ? true : false;
+}
+
//////////////////////////////////////////////////////////////////////
// End of PanelAgent-Functions
//////////////////////////////////////////////////////////////////////
LOGW ("Access denied to check helper ise enabled");
send_fail_reply (client_id);
}
+ } else if (cmd == ISM_TRANS_CMD_GET_ISE_SETTING_APPID) {
+ if (m_info_manager->check_privilege_by_sockfd(client_id, IMEMANAGER_PRIVILEGE)) {
+ String ime_setting_appid;
+ m_info_manager->get_ise_setting_appid(client_id, ime_setting_appid);
+
+ Transaction trans;
+ Socket client_socket(client_id);
+ trans.clear();
+ trans.put_command(SCIM_TRANS_CMD_REPLY);
+ trans.put_command(SCIM_TRANS_CMD_OK);
+ trans.put_data(ime_setting_appid);
+ trans.write_to_socket(client_socket);
+ }
+ else {
+ LOGW ("Access denied to get ise setting appid");
+ send_fail_reply (client_id);
+ }
} else if (cmd == ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY) {
uint32 angle;
lib@ISF_CONTROL@_la_CXXFLAGS = @EINA_CFLAGS@ \
@DLOG_CFLAGS@ \
- @VCONF_CFLAGS@
+ @VCONF_CFLAGS@ \
+ @APP_CONTROL_CFLAGS@
lib@ISF_CONTROL@_la_LDFLAGS = -version-info $(SCIM_CURRENT):$(SCIM_REVISION):$(SCIM_AGE) \
-export-dynamic \
@EINA_LIBS@ \
@DLOG_LIBS@ \
@VCONF_LIBS@ \
+ @APP_CONTROL_LIBS@ \
-lstdc++
lib@ISF_CONTROL@_la_LIBADD = libltdlc.la libprofile.la
#define Uses_SCIM_COMPOSE_KEY
#define Uses_SCIM_PANEL_AGENT
+#include <app_control.h>
#include <string.h>
#include "scim.h"
#include "isf_control.h"
using namespace scim;
+static bool app_control_launch (const char *app_id, app_control_launch_mode_e mode)
+{
+ app_control_h app_control;
+ int ret;
+
+ ret = app_control_create (&app_control);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ LOGW ("app_control_create returned %08x", ret);
+ return false;
+ }
+
+ ret = app_control_set_operation (app_control, APP_CONTROL_OPERATION_DEFAULT);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ LOGW ("app_control_set_operation returned %08x", ret);
+ app_control_destroy (app_control);
+ return false;
+ }
+
+ ret = app_control_set_app_id (app_control, app_id);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ LOGW ("app_control_set_app_id returned %08x", ret);
+ app_control_destroy (app_control);
+ return false;
+ }
+
+ LOGD("launch mode : %d", mode);
+
+ ret = app_control_set_launch_mode (app_control, mode);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ LOGW ("app_control_set_launch_mode returned %08x", ret);
+ app_control_destroy (app_control);
+ return false;
+ }
+
+ ret = app_control_send_launch_request(app_control, NULL, NULL);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ LOGW ("Failed to launch application (%s). reason : %s", app_id, get_error_message(ret));
+ } else {
+ LOGI ("Succeeded to launch application (%s)", app_id);
+ }
+
+ app_control_destroy (app_control);
+
+ return (ret == APP_CONTROL_ERROR_NONE);
+}
EXAPI int isf_control_set_active_ise_by_uuid (const char *uuid)
{
{
IMControlClient imcontrol_client;
int ret = 0;
+ String ime_setting_appid;
+
if (!imcontrol_client.open_connection ())
return -1;
imcontrol_client.prepare ();
- imcontrol_client.show_ise_option_window ();
+ if (imcontrol_client.get_ise_setting_appid (ime_setting_appid)) {
+ if (app_control_launch (ime_setting_appid.c_str(), APP_CONTROL_LAUNCH_MODE_GROUP)) {
+ LOGI("Succeeded to launch IME setting app : %s", ime_setting_appid.c_str());
+ }
+ else {
+ LOGE("Failed to launch IME setting app : %s", ime_setting_appid.c_str());
+ ret = -1;
+ }
+ }
+ else {
+ LOGD("No setting app ID");
+ imcontrol_client.show_ise_option_window ();
+ }
+
if (!imcontrol_client.send ())
ret = -1;
*
* @since_tizen 2.4
*
+ * @privlevel public
+ *
+ * @privilege %http://tizen.org/privilege/appmanager.launch
+ *
* @return 0 on success, otherwise return -1
*
- * @pre The availibility of IME option can be found using isf_control_get_all_ime_info() and isf_control_get_active_ime() functions.
+ * @pre The availability of IME option can be found using isf_control_get_all_ime_info() and isf_control_get_active_ime() functions.
*/
int isf_control_open_ime_option_window (void);
*
* @return 0 on success, otherwise return -1
*
- * @pre The availibility of IME option can be found using isf_control_get_all_ime_info() and isf_control_get_active_ime() functions.
+ * @pre The availability of IME option can be found using isf_control_get_all_ime_info() and isf_control_get_active_ime() functions.
*/
int isf_control_resume_ime_option_window (void);
m_trans.put_command (ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW);
}
+ bool get_ise_setting_appid (String &ime_setting_appid) {
+ int cmd;
+ String strTemp;
+
+ m_trans.put_command (ISM_TRANS_CMD_GET_ISE_SETTING_APPID);
+ m_trans.write_to_socket (m_socket_imclient2panel);
+ if (!m_trans.read_from_socket (m_socket_imclient2panel, m_socket_timeout)) {
+ std::cerr << __func__ << " read_from_socket() may be timeout \n";
+ return false;
+ }
+
+ if (m_trans.get_command (cmd) && cmd == SCIM_TRANS_CMD_REPLY &&
+ m_trans.get_command (cmd) && cmd == SCIM_TRANS_CMD_OK &&
+ m_trans.get_data (strTemp)) {
+ ime_setting_appid = strTemp;
+ } else {
+ std::cerr << __func__ << " get_command() or get_data() may fail!!!\n";
+ return false;
+ }
+
+ return true;
+ }
+
void resume_ise_option_window (void) {
m_trans.put_command (ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW);
}
m_impl->show_ise_option_window ();
}
+bool IMControlClient::get_ise_setting_appid (String &ime_setting_appid)
+{
+ return m_impl->get_ise_setting_appid (ime_setting_appid);
+}
+
void IMControlClient::resume_ise_option_window (void)
{
m_impl->resume_ise_option_window ();
bool set_initial_ise_by_uuid (const char* uuid);
void show_ise_selector ();
void show_ise_option_window ();
+ bool get_ise_setting_appid (String &ime_setting_appid);
void resume_ise_option_window ();
bool get_all_helper_ise_info (HELPER_ISE_INFO &info);
typedef Signal1<bool, String>
InfoManagerSignalBoolString;
+typedef Signal2<bool, String, String&>
+InfoManagerSignalBoolString2;
+
typedef Signal1<void, bool>
InfoManagerSignalBool;
InfoManagerSignalIntString2 m_signal_check_privilege_by_sockfd;
InfoManagerSignalBoolString m_signal_launch_option_application;
+ InfoManagerSignalBoolString2 m_signal_get_ise_setting_appid;
PanelAgentManager m_panel_agent_manager;
}
}
+ //ISM_TRANS_CMD_GET_ISE_SETTING_APPID
+ void get_ise_setting_appid (int client_id, _OUT_ String &ime_setting_appid) {
+ SCIM_DEBUG_MAIN (4) << __func__ << "\n";
+ m_signal_get_ise_setting_appid (m_current_helper_uuid, ime_setting_appid);
+ }
+
//ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
void resume_ise_option_window (int client_id) {
SCIM_DEBUG_MAIN (4) << "InfoManager::resume_ise_option_window ()\n";
return m_signal_launch_option_application.connect (slot);
}
+ Connection signal_connect_get_ise_setting_appid (InfoManagerSlotBoolString2* slot)
+ {
+ return m_signal_get_ise_setting_appid.connect (slot);
+ }
+
Connection signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot) {
return m_signal_get_recent_ise_geometry.connect (slot);
}
m_impl->get_ise_list (client_id, strlist);
}
-
//ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
void InfoManager::get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info)
{
m_impl->show_helper_ise_list (client_id);
}
-
//ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
//reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
void InfoManager::show_helper_ise_selector (int client_id)
m_impl->show_ise_option_window (client_id);
}
+//ISM_TRANS_CMD_GET_ISE_SETTING_APPID
+void InfoManager::get_ise_setting_appid (int client_id, String &ime_setting_appid)
+{
+ m_impl->get_ise_setting_appid (client_id, ime_setting_appid);
+}
+
//ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
void InfoManager::resume_ise_option_window (int client_id)
{
}
Connection
+InfoManager::signal_connect_get_ise_setting_appid (InfoManagerSlotBoolString2* slot)
+{
+ return m_impl->signal_connect_get_ise_setting_appid (slot);
+}
+
+Connection
InfoManager::signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot)
{
return m_impl->signal_connect_get_recent_ise_geometry (slot);
typedef Slot1<bool, String>
InfoManagerSlotBoolString;
+typedef Slot2<bool, String, String&>
+InfoManagerSlotBoolString2;
+
typedef Slot1<void, bool>
InfoManagerSlotBool;
//ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
void get_active_helper_option (int client_id, _OUT_ uint32& option);
+ //ISM_TRANS_CMD_GET_ISE_SETTING_APPID
+ void get_ise_setting_appid (int client_id, String &ime_setting_appid);
+
//ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
void show_ise_option_window (int client_id);
Connection signal_connect_launch_option_application (InfoManagerSlotBoolString* slot);
+ Connection signal_connect_get_ise_setting_appid (InfoManagerSlotBoolString2* slot);
+
/**
* @brief Signal: Get the recent input panel geometry information.
*
const int ISM_TRANS_CMD_FINALIZE_CONTENT = 1131;
const int ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA = 1132;
const int ISM_TRANS_CMD_SET_OPTIMIZATION_HINT = 1133;
+const int ISM_TRANS_CMD_GET_ISE_SETTING_APPID = 1134;
/* ISE/Panel to IMControl */
const int ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT = 1151;