SCIMBridge 0.4.x

agent/scim-bridge-agent-socket-client.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 SCIMBRIDGEAGENTSOCKETCLIENT_H_
00027 #define SCIMBRIDGEAGENTSOCKETCLIENT_H_
00028 
00029 #include "scim-bridge.h"
00030 
00034 typedef int scim_bridge_agent_event_client_id_t;
00035 
00039 typedef unsigned int scim_bridge_agent_event_type_t;
00040 
00044 static const scim_bridge_agent_event_type_t SCIM_BRIDGE_AGENT_EVENT_NONE = 0;
00045 
00049 static const scim_bridge_agent_event_type_t SCIM_BRIDGE_AGENT_EVENT_READ = 1 << 0;
00050 
00054 static const scim_bridge_agent_event_type_t SCIM_BRIDGE_AGENT_EVENT_WRITE = 1 << 1;
00055 
00059 static const scim_bridge_agent_event_type_t SCIM_BRIDGE_AGENT_EVENT_ERROR = 1 << 2;
00060 
00064 static const scim_bridge_agent_event_type_t SCIM_BRIDGE_AGENT_EVENT_INTERRUPT = 1 << 3;
00065 
00069 class ScimBridgeAgentSocketClient
00070 {
00071 
00072     public:
00073 
00078         virtual ~ScimBridgeAgentSocketClient () {}
00079 
00086         virtual int get_socket_fd () const = 0;
00087 
00095         virtual scim_bridge_agent_event_type_t get_trigger_events () const = 0;
00096 
00104         virtual bool handle_event (scim_bridge_agent_event_type_t event_type) = 0;
00105 
00106     protected:
00107 
00111         ScimBridgeAgentSocketClient () {}
00112 
00113 };
00114 #endif                                            /*SCIMBRIDGEAGENTSOCKETCLIENT_H_*/