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_indentifier()
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 sclboolean CSCLConnection::open_connection(const sclchar *display)
63 sclboolean ret = FALSE;
65 ret = m_impl->open_connection(display);
70 sclboolean CSCLConnection::close_connection()
72 sclboolean ret = FALSE;
74 ret = m_impl->close_connection();
79 sclboolean CSCLConnection::is_connected()
81 sclboolean ret = FALSE;
83 ret = m_impl->is_connected();
88 void CSCLConnection::config_reload()
91 m_impl->config_reload();
95 sclboolean CSCLConnection::config_read_int(const sclchar *name, sclint &value)
97 sclboolean ret = FALSE;
99 ret = m_impl->config_read_int(name, value);
104 sclboolean CSCLConnection::config_read_string(const sclchar *name, std::string &value)
106 sclboolean ret = FALSE;
108 ret = m_impl->config_read_string(name, value);
113 sclboolean CSCLConnection::config_write_int(const sclchar *name, sclint value)
115 sclboolean ret = FALSE;
117 ret = m_impl->config_write_int(name, value);
122 sclboolean CSCLConnection::config_write_string(const sclchar *name, const std::string value)
124 sclboolean ret = FALSE;
126 ret = m_impl->config_write_string(name, value);
131 sclboolean CSCLConnection::config_erase(const sclchar *name)
133 sclboolean ret = FALSE;
135 ret = m_impl->config_erase(name);
140 sclboolean CSCLConnection::config_flush(void)
142 sclboolean ret = FALSE;
144 ret = m_impl->config_flush();
149 void CSCLConnection::send_imengine_event(sclint ic, const sclchar *ic_uuid, const sclint command, const sclu32 value)
152 m_impl->send_imengine_event(ic, ic_uuid, command, value);
156 void CSCLConnection::reset_keyboard_ise()
159 m_impl->reset_keyboard_ise();
163 void CSCLConnection::flush_keyboard_ise()
166 m_impl->flush_keyboard_ise();
170 void CSCLConnection::send_key_event(sclint ic, const sclchar *ic_uuid, sclu32 keycode, sclu16 keymask)
173 m_impl->send_key_event(ic, ic_uuid, keycode, keymask);
177 void CSCLConnection::forward_key_event(sclint ic, const sclchar *ic_uuid, sclu32 keycode, sclu16 keymask)
180 m_impl->forward_key_event(ic, ic_uuid, keycode, keymask);
184 void CSCLConnection::commit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str)
187 m_impl->commit_string(ic, ic_uuid, str);
191 void CSCLConnection::select_candidate(int index)
194 m_impl->select_candidate(index);
198 void CSCLConnection::show_preedit_string(sclint ic, const sclchar *ic_uuid)
201 m_impl->show_preedit_string(ic, ic_uuid);
205 void CSCLConnection::show_aux_string(void)
208 m_impl->show_aux_string();
212 void CSCLConnection::show_candidate_string(void)
215 m_impl->show_candidate_string();
219 void CSCLConnection::show_associate_string(void)
222 m_impl->show_associate_string();
226 void CSCLConnection::hide_preedit_string(sclint ic, const sclchar *ic_uuid)
229 m_impl->hide_preedit_string(ic, ic_uuid);
233 void CSCLConnection::hide_aux_string(void)
236 m_impl->hide_aux_string();
240 void CSCLConnection::hide_candidate_string(void)
243 m_impl->hide_candidate_string();
247 void CSCLConnection::hide_associate_string(void)
250 m_impl->hide_associate_string();
254 void CSCLConnection::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str)
257 m_impl->update_preedit_string(ic, ic_uuid, str);
261 void CSCLConnection::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs)
264 m_impl->update_preedit_string(ic, ic_uuid, str, attrs);
268 void CSCLConnection::update_aux_string(const sclchar *str)
271 m_impl->update_aux_string(str);
275 void CSCLConnection::update_input_context(sclu32 type, sclu32 value)
278 m_impl->update_input_context(type, value);
282 void CSCLConnection::update_geometry(sclint x, sclint y, sclint width, sclint height)
285 m_impl->update_geometry(x, y, width, height);
289 void CSCLConnection::get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const
292 m_impl->get_surrounding_text(ic_uuid, maxlen_before, maxlen_after);
296 sclint CSCLConnection::get_surrounding_text(sclint maxlen_before, sclint maxlen_after, sclchar **text, int &cursor)
300 ret = m_impl->get_surrounding_text(maxlen_before, maxlen_after, text, cursor);
305 void CSCLConnection::delete_surrounding_text(sclint offset, sclint len) const
308 m_impl->delete_surrounding_text(offset, len);
312 void CSCLConnection::set_candidate_position(sclint left, sclint top)
315 m_impl->set_candidate_position(left, top);
319 void CSCLConnection::enable_soft_candidate(sclboolean enable)
322 m_impl->enable_soft_candidate(enable);
326 void CSCLConnection::candidate_hide(void)
329 m_impl->candidate_hide();
333 void CSCLConnection::set_keyboard_ise_by_uuid(const sclchar *uuid)
336 m_impl->set_keyboard_ise_by_uuid(uuid);
340 void CSCLConnection::get_keyboard_ise(const sclchar *uuid)
343 m_impl->get_keyboard_ise(uuid);
347 void CSCLConnection::set_selection(sclint start, sclint end)
350 m_impl->set_selection(start, end);
354 void CSCLConnection::send_private_command(const sclchar *command)
357 m_impl->send_private_command(command);
361 void CSCLConnection::get_selection_text(sclchar **text)
364 m_impl->get_selection_text(text);
368 void CSCLConnection::request_ise_hide()
371 m_impl->request_ise_hide();
375 void CSCLConnection::commit_content(const sclchar *content, const sclchar *description, const sclchar *mime_types)
378 m_impl->commit_content(content, description, mime_types);