2 * Copyright (c) 2012 - 2014 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 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 void CSCLConnection::send_imengine_event(sclint ic, const sclchar *ic_uuid, const sclint command, const sclu32 value)
130 m_impl->send_imengine_event(ic, ic_uuid, command, value);
134 void CSCLConnection::reset_keyboard_ise()
137 m_impl->reset_keyboard_ise();
141 void CSCLConnection::send_key_event(sclint ic, const sclchar *ic_uuid, sclu32 keycode, sclu16 keymask)
144 m_impl->send_key_event(ic, ic_uuid, keycode, keymask);
148 void CSCLConnection::forward_key_event(sclint ic, const sclchar *ic_uuid, sclu32 keycode, sclu16 keymask)
151 m_impl->forward_key_event(ic, ic_uuid, keycode, keymask);
155 void CSCLConnection::commit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str)
158 m_impl->commit_string(ic, ic_uuid, str);
162 void CSCLConnection::select_candidate(int index)
165 m_impl->select_candidate(index);
169 void CSCLConnection::show_preedit_string(sclint ic, const sclchar *ic_uuid)
172 m_impl->show_preedit_string(ic, ic_uuid);
176 void CSCLConnection::show_aux_string(void)
179 m_impl->show_aux_string();
183 void CSCLConnection::show_candidate_string(void)
186 m_impl->show_candidate_string();
190 void CSCLConnection::show_associate_string(void)
193 m_impl->show_associate_string();
197 void CSCLConnection::hide_preedit_string(sclint ic, const sclchar *ic_uuid)
200 m_impl->hide_preedit_string(ic, ic_uuid);
204 void CSCLConnection::hide_aux_string(void)
207 m_impl->hide_aux_string();
211 void CSCLConnection::hide_candidate_string(void)
214 m_impl->hide_candidate_string();
218 void CSCLConnection::hide_associate_string(void)
221 m_impl->hide_associate_string();
225 void CSCLConnection::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str)
228 m_impl->update_preedit_string(ic, ic_uuid, str);
232 void CSCLConnection::update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs)
235 m_impl->update_preedit_string(ic, ic_uuid, str, attrs);
239 void CSCLConnection::update_aux_string(const sclchar *str)
242 m_impl->update_aux_string(str);
246 void CSCLConnection::update_input_context(sclu32 type, sclu32 value)
249 m_impl->update_input_context(type, value);
253 void CSCLConnection::get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_before, sclint maxlen_after) const
256 m_impl->get_surrounding_text(ic_uuid, maxlen_before, maxlen_after);
260 void CSCLConnection::delete_surrounding_text(sclint offset, sclint len) const
263 m_impl->delete_surrounding_text(offset, len);
267 void CSCLConnection::set_candidate_position(sclint left, sclint top)
270 m_impl->set_candidate_position(left, top);
274 void CSCLConnection::candidate_hide(void)
277 m_impl->candidate_hide();
281 void CSCLConnection::set_keyboard_ise_by_uuid(const sclchar *uuid)
284 m_impl->set_keyboard_ise_by_uuid(uuid);
288 void CSCLConnection::get_keyboard_ise(const sclchar *uuid)
291 m_impl->get_keyboard_ise(uuid);