SCIMBridge 0.4.x

agent/scim-bridge-agent-client-listener.h

Go to the documentation of this file.
00001 /*
00002  * SCIM Bridge
00003  *
00004  * Copyright (c) 2006 Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
00005  *
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation and 
00010  * appearing in the file LICENSE.LGPL included in the package of this file.
00011  * You can also redistribute it and/or modify it under the terms of 
00012  * the GNU General Public License as published by the Free Software Foundation and 
00013  * appearing in the file LICENSE.GPL included in the package of this file.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00018  */
00019 
00026 #ifndef SCIMBRIDGEAGENTCLIENTLISTENER_H_
00027 #define SCIMBRIDGEAGENTCLIENTLISTENER_H_
00028 
00029 #define Uses_SCIM_ATTRIBUTE
00030 #define Uses_SCIM_EVENT
00031 #include <scim.h>
00032 
00033 #include "scim-bridge.h"
00034 #include "scim-bridge-imcontext.h"
00035 
00036 #include "scim-bridge-agent-socket-client.h"
00037 
00038 class ScimBridgeAgentProtected;
00039 
00043 class ScimBridgeAgentClientListener: public ScimBridgeAgentSocketClient
00044 {
00045 
00046     public:
00047 
00055         static ScimBridgeAgentClientListener *alloc (int socket_fd, ScimBridgeAgentProtected *agent);
00056         
00060         virtual ~ScimBridgeAgentClientListener () {}
00061 
00069         virtual retval_t imengine_status_changed (scim_bridge_imcontext_id_t imcontext_id, bool enabled) = 0;
00070 
00078         virtual retval_t set_preedit_shown (scim_bridge_imcontext_id_t imcontext_id, bool shown) = 0;
00079 
00087         virtual retval_t set_preedit_cursor_position (scim_bridge_imcontext_id_t imcontext_id, int cursor_position) = 0;
00088 
00096         virtual retval_t set_preedit_string (scim_bridge_imcontext_id_t imcontext_id, const scim::WideString &wstring) = 0;
00097 
00105         virtual retval_t set_preedit_attributes (scim_bridge_imcontext_id_t imcontext_id, const scim::AttributeList &attributes) = 0;
00106 
00113         virtual retval_t update_preedit (scim_bridge_imcontext_id_t imcontext_id) = 0;
00114 
00122         virtual retval_t commit_string (scim_bridge_imcontext_id_t imcontext_id, const scim::WideString &wstring) = 0;
00123 
00130         virtual retval_t beep (scim_bridge_imcontext_id_t imcontext_id) = 0;
00131 
00139         virtual retval_t forward_key_event (scim_bridge_imcontext_id_t imcontext_id, const scim::KeyEvent &key_event) = 0;
00140 
00151         virtual retval_t get_surrounding_string (scim_bridge_imcontext_id_t imcontext_id, int before_max, int after_max, scim::WideString &wstring, int &cursor_position) = 0;
00152 
00161         virtual retval_t delete_surrounding_string (scim_bridge_imcontext_id_t imcontext_id, int offset, int length) = 0;
00162 
00171         virtual retval_t replace_surrounding_string (scim_bridge_imcontext_id_t imcontext_id, const scim::WideString &wstring, int cursor_position) = 0;
00172 
00173     protected:
00174 
00178         ScimBridgeAgentClientListener () {}
00179 
00180 };
00181 #endif                                            /*SCIMBRIDGEAGENTCLIENTLISTENER_H_*/