2 * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "sclconnection.h"
20 #include "sclconnection-isf.h"
24 CSCLConnection::CSCLConnection()
26 m_backend_identifier = "undefined";
30 CSCLConnection::~CSCLConnection()
34 std::string CSCLConnection::get_backend_identifier()
36 return m_backend_identifier;
39 sclboolean CSCLConnection::init()
41 sclboolean ret = FALSE;
43 /* There could be other backend implementations.. */
44 m_impl = new CSCLConnectionISF;
52 void CSCLConnection::fini()
61 void CSCLConnection::open_connection(const sclchar *display)
64 m_impl->open_connection(display);
68 void CSCLConnection::close_connection()
71 m_impl->close_connection();
75 void CSCLConnection::config_reload()
78 m_impl->config_reload();
82 sclboolean CSCLConnection::config_read_int(const sclchar *name, sclint &value)
84 sclboolean ret = FALSE;
86 ret = m_impl->config_read_int(name, value);
91 sclboolean CSCLConnection::config_read_string(const sclchar *name, std::string &value)
93 sclboolean ret = FALSE;
95 ret = m_impl->config_read_string(name, value);
100 sclboolean CSCLConnection::config_write_int(const sclchar *name, sclint value)
102 sclboolean ret = FALSE;
104 ret = m_impl->config_write_int(name, value);
109 sclboolean CSCLConnection::config_write_string(const sclchar *name, const std::string value)
111 sclboolean ret = FALSE;
113 ret = m_impl->config_write_string(name, value);
118 sclboolean CSCLConnection::config_erase(const sclchar *name)
120 sclboolean ret = FALSE;
122 ret = m_impl->config_erase(name);
127 sclboolean CSCLConnection::config_flush(void)
129 sclboolean ret = FALSE;
131 ret = m_impl->config_flush();
136 void CSCLConnection::send_imengine_event(sclint ic, const sclchar *ic_uuid, const sclint command, const sclu32 value)
139 m_impl->send_imengine_event(ic, ic_uuid, command, value);
143 void CSCLConnection::reset_keyboard_ise()
146 m_impl->reset_keyboard_ise();
150 void CSCLConnection::flush_keyboard_ise()
153 m_impl->flush_keyboard_ise();
157 void CSCLConnection::send_key_event(sclint ic, const sclchar *ic_uuid, sclu32 keycode, sclu16 keymask)
160 m_impl->send_key_event(ic, ic_uuid, keycode, keymask);
164 void CSCLConnection::forward_key_event(sclint ic, const sclchar *ic_uuid, sclu32 keycode, sclu16 keymask)
167 m_impl->forward_key_event(ic, ic_uuid, keycode, keymask);
171 void CSCLConnection::commit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str)
174 m_impl->commit_string(ic, ic_uuid, str);
178 void CSCLConnection::select_candidate(int index)
181 m_impl->select_candidate(index);
185 void CSCLConnection::show_preedit_string(sclint ic, const sclchar *ic_uuid)
188 m_impl->show_preedit_string(ic, ic_uuid);
192 void CSCLConnection::show_aux_string(void)
195 m_impl->show_aux_string();
199 void CSCLConnection::show_candidate_string(void)
202 m_impl->show_candidate_string();
206 void CSCLConnection::show_associate_string(void)
209 m_impl->show_associate_string();
213 void CSCLConnection::hide_preedit_string(sclint ic, const sclchar *ic_uuid)
216 m_impl->hide_preedit_string(ic, ic_uuid);
220 void CSCLConnection::hide_aux_string(void)
223 m_impl->hide_aux_string();
227 void CSCLConnection::hide_candidate_string(void)
230 m_impl->hide_candidate_string();
234 void CSCLConnection::hide_associate_string(void)
237 m_impl->hide_associate_string();
241 void CSCLConnection::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str)
244 m_impl->update_preedit_string(ic, ic_uuid, str);
248 void CSCLConnection::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs)
251 m_impl->update_preedit_string(ic, ic_uuid, str, attrs);
255 void CSCLConnection::update_preedit_caret(sclint caret)
258 m_impl->update_preedit_caret(caret);
262 void CSCLConnection::update_aux_string(const sclchar *str)
265 m_impl->update_aux_string(str);
269 void CSCLConnection::update_input_context(sclu32 type, sclu32 value)
272 m_impl->update_input_context(type, value);
276 void CSCLConnection::update_geometry(sclint x, sclint y, sclint width, sclint height)
279 m_impl->update_geometry(x, y, width, height);
283 void CSCLConnection::get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const
286 m_impl->get_surrounding_text(ic_uuid, maxlen_before, maxlen_after);
290 sclint CSCLConnection::get_surrounding_text(sclint maxlen_before, sclint maxlen_after, sclchar **text, int &cursor)
294 ret = m_impl->get_surrounding_text(maxlen_before, maxlen_after, text, cursor);
299 void CSCLConnection::delete_surrounding_text(sclint offset, sclint len) const
302 m_impl->delete_surrounding_text(offset, len);
306 void CSCLConnection::set_candidate_position(sclint left, sclint top)
309 m_impl->set_candidate_position(left, top);
313 void CSCLConnection::enable_soft_candidate(sclboolean enable)
316 m_impl->enable_soft_candidate(enable);
320 void CSCLConnection::candidate_hide(void)
323 m_impl->candidate_hide();
327 void CSCLConnection::set_keyboard_ise_by_uuid(const sclchar *uuid)
330 m_impl->set_keyboard_ise_by_uuid(uuid);
334 void CSCLConnection::get_keyboard_ise(const sclchar *uuid)
337 m_impl->get_keyboard_ise(uuid);
341 void CSCLConnection::set_selection(sclint start, sclint end)
344 m_impl->set_selection(start, end);
348 void CSCLConnection::send_private_command(const sclchar *command)
351 m_impl->send_private_command(command);
355 void CSCLConnection::get_selection_text(sclchar **text)
358 m_impl->get_selection_text(text);
362 void CSCLConnection::request_ise_hide()
365 m_impl->request_ise_hide();
369 void CSCLConnection::commit_content(const sclchar *content, const sclchar *description, const sclchar *mime_types)
372 m_impl->commit_content(content, description, mime_types);
376 void CSCLConnection::update_preedit_string_with_commit(const sclchar *preedit, const sclchar *commit, const scim::AttributeList &attrs, sclint caret)
379 m_impl->update_preedit_string_with_commit(preedit, commit, attrs, caret);
383 void CSCLConnection::recapture_string(sclint offset, sclint len, const sclchar *preedit, const sclchar *commit, const scim::AttributeList &attrs)
386 m_impl->recapture_string(offset, len, preedit, commit, attrs);
390 void CSCLConnection::update_lookup_table(const scim::LookupTable &table)
393 m_impl->update_lookup_table(table);
397 void CSCLConnection::register_properties(const scim::PropertyList &properties)
400 m_impl->register_properties(properties);
404 void CSCLConnection::update_property(const scim::Property &property)
407 m_impl->update_property(property);
411 void CSCLConnection::expand_candidate(void)
414 m_impl->expand_candidate();
418 void CSCLConnection::contract_candidate(void)
421 m_impl->contract_candidate();
425 void CSCLConnection::set_candidate_style(scim::ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line, scim::ISF_CANDIDATE_MODE_T mode)
428 m_impl->set_candidate_style(portrait_line, mode);
432 void CSCLConnection::set_engine_loader_flag(sclboolean flag)
435 m_impl->set_engine_loader_flag(flag);
439 void CSCLConnection::send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success)
442 m_impl->send_key_event_processing_result(key, serial, is_success);
446 void CSCLConnection::set_floating_mode(sclboolean floating_mode)
449 m_impl->set_floating_mode(floating_mode);
453 void CSCLConnection::set_floating_drag_enabled(sclboolean enabled)
456 m_impl->set_floating_drag_enabled(enabled);