si->set_autocapital_type(auto_capital_type) should be invoked refer to origin isf code.
I have plan to implement auto capital and auto period feature in scim_helper,
this code is necessary for it.
Change-Id: Ic7e094efe1a31ede48dda9f8a95babf016006502
}
+ void set_autocapital_type(int client, uint32 context, String uuid, int mode) {
+ LOGD ("client id:%d\n", client);
+
+ m_send_trans.clear();
+ m_send_trans.put_command(SCIM_TRANS_CMD_REPLY);
+
+ m_send_trans.put_data(context);
+ m_send_trans.put_data(uuid);
+ m_send_trans.put_command(SCIM_TRANS_CMD_SET_AUTOCAPITAL_TYPE);
+ m_send_trans.put_data((uint32) mode);
+
+ Socket client_socket(client);
+ m_send_trans.write_to_socket(client_socket);
+ }
private:
static void send_fail_reply (int client_id)
if (context_scim->impl->imdata)
context_scim->impl->si->set_imdata ((const char*)context_scim->impl->imdata, context_scim->impl->imdata_size);
#endif
+ LOGD ("set autocapital type : %d\n", context_scim->impl->autocapital_type);
+ g_info_manager->set_autocapital_type ((int)context_scim->impl->autocapital_type);
} else {
g_info_manager->socket_turn_off ();
}
isf_wsc_context_autocapital_type_set (WSCContextISF* wsc_ctx, Ecore_IMF_Autocapital_Type autocapital_type)
{
SCIM_DEBUG_FRONTEND (1) << __FUNCTION__ << " = " << autocapital_type << "...\n";
- LOGD ("");
+ LOGD ("autocapital_type: %d", autocapital_type);
WSCContextISF* context_scim = wsc_ctx;
if (context_scim && context_scim->impl && context_scim->impl->autocapital_type != autocapital_type) {
context_scim->impl->autocapital_type = autocapital_type;
+ LOGD ("ctx : %p. set autocapital type : %d\n", wsc_ctx, autocapital_type);
if (context_scim == _focused_ic) {
LOGD ("ctx : %p. set autocapital type : %d\n", wsc_ctx, autocapital_type);
- //FIXME:add this interface
- //_info_manager->set_autocapital_type (autocapital_type);
+ g_info_manager->set_autocapital_type ((int)autocapital_type);
}
}
}
}
}
+ bool set_autocapital_type (int mode) {
+ SCIM_DEBUG_MAIN (4) << __func__ << "\n";
+
+ if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
+ HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
+
+ if (it != m_helper_client_index.end ()) {
+ int client;
+ uint32 context;
+ uint32 ctx;
+ get_focused_context (client, context);
+ ctx = get_helper_ic (client, context);
+ m_panel_agent_manager.set_autocapital_type (it->second.id, ctx, m_current_helper_uuid, mode);
+ return true;
+ }
+ }
+
+ std::cerr << __func__ << " is failed!!!\n";
+ return false;
+
+ }
+
const String& get_focused_context (int& client, uint32& context, bool force_last_context = false) const {
if (m_current_socket_client >= 0) {
client = m_current_socket_client;
m_impl->del_client (client_id);
}
+bool InfoManager::set_autocapital_type (int mode)
+{
+ return m_impl->set_autocapital_type (mode);
+}
+
+
//////////////////////////////////Message function end/////////////////////////////////////////
Connection
void add_client (int client_id, uint32 key, ClientType type);
-
void del_client (int client_id);
+ bool set_autocapital_type (int mode);
+
//////////////////////////////////Message function end/////////////////////////////////////////
LOGW("not implemented for %s", m_name.c_str());
}
+void PanelAgentBase::set_autocapital_type(int client, uint32 context, String uuid, int mode)
+{
+ LOGW("not implemented for %s", m_name.c_str());
+}
+
} /* namespace scim */
* @return none.
*/
virtual void process_key_event_done(int client, uint32 context, KeyEvent &key, uint32 ret, uint32 serial);
+
+ /**
+ * @brief set_autocapital_type.
+ *
+ * @param
+ *
+ * @return none.
+ */
+ virtual void set_autocapital_type(int client, uint32 context, String uuid, int mode);
};
/** @} */
_p->process_key_event_done (id, context_id, key, ret, serial);
}
+void PanelAgentManager::set_autocapital_type(int id, uint32 context_id, String uuid, int mode)
+{
+ PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
+
+ if (!_p.null ())
+ _p->set_autocapital_type (id, context_id, uuid, mode);
+}
} /* namespace scim */
void hide_helper_ise (int id, uint32 context);
bool process_input_device_event(int client, uint32 context, const String& uuid, uint32 type, const char *data, size_t len, _OUT_ uint32& result);
void process_key_event_done(int client, uint32 context, KeyEvent &key, uint32 ret, uint32 serial);
+ void set_autocapital_type(int id, uint32 context_id, String uuid, int mode);
};
/** @} */
m_impl->send.write_to_socket(m_impl->socket);
break;
}
+ case SCIM_TRANS_CMD_SET_AUTOCAPITAL_TYPE:
+ {
+ uint32 auto_capital_type;
+
+ if (m_impl->recv.get_data (auto_capital_type)) {
+ if (!m_impl->si.null ()) m_impl->si->set_autocapital_type(auto_capital_type);
+ }
+ else
+ LOGW ("wrong format of transaction\n");
+ break;
+ }
default:
break;
}