00001 /* 00002 * synergy -- mouse and keyboard sharing utility 00003 * Copyright (C) 2004 Chris Schoeneman 00004 * 00005 * This package is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * found in the file COPYING that should have accompanied this file. 00008 * 00009 * This package is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 */ 00014 00015 #ifndef ISTREAM_H 00016 #define ISTREAM_H 00017 00018 #include "IInterface.h" 00019 #include "CEvent.h" 00020 00022 00025 class IStream : public IInterface { 00026 public: 00028 00029 00031 00038 virtual void close() = 0; 00039 00041 00046 virtual UInt32 read(void* buffer, UInt32 n) = 0; 00047 00049 00055 virtual void write(const void* buffer, UInt32 n) = 0; 00056 00058 00061 virtual void flush() = 0; 00062 00064 00068 virtual void shutdownInput() = 0; 00069 00071 00076 virtual void shutdownOutput() = 0; 00077 00079 00080 00081 00083 00087 virtual void* getEventTarget() const = 0; 00088 00090 00095 virtual bool isReady() const = 0; 00096 00098 00104 virtual UInt32 getSize() const = 0; 00105 00107 00111 static CEvent::Type getInputReadyEvent(); 00112 00114 00121 static CEvent::Type getOutputFlushedEvent(); 00122 00124 00128 static CEvent::Type getOutputErrorEvent(); 00129 00131 00136 static CEvent::Type getInputShutdownEvent(); 00137 00139 00145 static CEvent::Type getOutputShutdownEvent(); 00146 00148 00149 private: 00150 static CEvent::Type s_inputReadyEvent; 00151 static CEvent::Type s_outputFlushedEvent; 00152 static CEvent::Type s_outputErrorEvent; 00153 static CEvent::Type s_inputShutdownEvent; 00154 static CEvent::Type s_outputShutdownEvent; 00155 }; 00156 00157 #endif