00001 // $Id: TelnetTerminal.hh 1742 2010-11-04 14:51:56Z g0dil $ 00002 // 00003 // Copyright (C) 2009 00004 // Fraunhofer (FOKUS) 00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY 00006 // Stefan Bund <g0dil@berlios.de> 00007 // 00008 // This program is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation; either version 2 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with this program; if not, write to the 00020 // Free Software Foundation, Inc., 00021 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 00026 #ifndef HH_SENF_Utils_Termlib_TelnetTerminal_ 00027 #define HH_SENF_Utils_Termlib_TelnetTerminal_ 1 00028 00029 // Custom includes 00030 #include "Telnet.hh" 00031 #include "AbstractTerminal.hh" 00032 #include <senf/Utils/Logger.hh> 00033 00034 //#include "TelnetTerminal.mpp" 00035 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00036 00037 namespace senf { 00038 namespace term { 00039 00052 class TelnetTerminal 00053 : public telnethandler::TerminalType, 00054 public telnethandler::NAWS, 00055 public AbstractTerminal 00056 { 00057 SENF_LOG_CLASS_AREA(); 00058 public: 00059 TelnetTerminal(); 00060 00062 //\{ 00063 virtual void setCallbacks(AbstractTerminal::Callbacks & cb); 00064 virtual std::string terminalType(); 00065 virtual unsigned width() const; 00066 virtual unsigned height() const; 00067 virtual void write(char ch); 00068 //\} 00069 00070 protected: 00071 00072 # ifndef DOXYGEN 00073 private: 00074 # endif 00075 virtual void v_setupFailed() = 0; 00076 00077 private: 00078 virtual void v_setupComplete(); 00079 virtual void v_charReceived(char ch); 00080 virtual void v_windowSizeChanged(); 00081 00082 AbstractTerminal::Callbacks * callbacks_; 00083 bool setupFailed_; 00084 }; 00085 00086 }} 00087 00088 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00089 //#include "TelnetTerminal.cci" 00090 //#include "TelnetTerminal.ct" 00091 //#include "TelnetTerminal.cti" 00092 #endif 00093 00094 00095 // Local Variables: 00096 // mode: c++ 00097 // fill-column: 100 00098 // comment-column: 40 00099 // c-file-style: "senf" 00100 // indent-tabs-mode: nil 00101 // ispell-local-dictionary: "american" 00102 // compile-command: "scons -u test" 00103 // End: