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; either 00010 * version 2 of the License, or (at your option) any later version.* 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 00014 * GNU Lesser General Public License for more details.* 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this program; if not, write to the 00017 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 00018 * Boston, MA 02111-1307 USA 00019 */ 00020 00027 #ifndef SCIMBRIDGEAGENTSOCKETCLIENT_H_ 00028 #define SCIMBRIDGEAGENTSOCKETCLIENT_H_ 00029 00030 #include "scim-bridge.h" 00031 00035 typedef int scim_bridge_agent_event_client_id_t; 00036 00040 typedef unsigned int scim_bridge_agent_event_type_t; 00041 00045 static const scim_bridge_agent_event_type_t SCIM_BRIDGE_AGENT_EVENT_NONE = 0; 00046 00050 static const scim_bridge_agent_event_type_t SCIM_BRIDGE_AGENT_EVENT_READ = 1 << 0; 00051 00055 static const scim_bridge_agent_event_type_t SCIM_BRIDGE_AGENT_EVENT_WRITE = 1 << 1; 00056 00060 static const scim_bridge_agent_event_type_t SCIM_BRIDGE_AGENT_EVENT_ERROR = 1 << 2; 00061 00065 static const scim_bridge_agent_event_type_t SCIM_BRIDGE_AGENT_EVENT_INTERRUPT = 1 << 3; 00066 00070 class ScimBridgeAgentSocketClient 00071 { 00072 00073 public: 00074 00079 virtual ~ScimBridgeAgentSocketClient () {} 00080 00087 virtual int get_socket_fd () const = 0; 00088 00096 virtual scim_bridge_agent_event_type_t get_trigger_events () const = 0; 00097 00105 virtual bool handle_event (scim_bridge_agent_event_type_t event_type) = 0; 00106 00107 protected: 00108 00112 ScimBridgeAgentSocketClient () {} 00113 00114 }; 00115 #endif /*SCIMBRIDGEAGENTSOCKETCLIENT_H_*/