TelnetTerminal.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Utils_Termlib_TelnetTerminal_
18 #define HH_SENF_Utils_Termlib_TelnetTerminal_ 1
19 
20 // Custom includes
21 #include "Telnet.hh"
22 #include "AbstractTerminal.hh"
23 #include <senf/Utils/Logger/Log.hh>
24 
25 //#include "TelnetTerminal.mpp"
26 //-/////////////////////////////////////////////////////////////////////////////////////////////////
27 
28 namespace senf {
29 namespace term {
30 
45  public telnethandler::NAWS,
46  public AbstractTerminal
47  {
49  public:
51 
53  //\{
54  virtual void setCallbacks(AbstractTerminal::Callbacks & cb);
55  virtual std::string terminalType();
56  virtual unsigned width() const;
57  virtual unsigned height() const;
58  virtual void write(char ch);
59  //\}
60 
61  protected:
62 
63 # ifndef DOXYGEN
64  private:
65 # endif
66  virtual void v_setupFailed() = 0;
67 
68  private:
69  virtual void v_setupComplete();
70  virtual void v_charReceived(char ch);
71  virtual void v_windowSizeChanged();
72 
73  AbstractTerminal::Callbacks * callbacks_;
74  bool setupFailed_;
75  };
76 
77 }}
78 
79 //-/////////////////////////////////////////////////////////////////////////////////////////////////
80 //#include "TelnetTerminal.cci"
81 //#include "TelnetTerminal.ct"
82 //#include "TelnetTerminal.cti"
83 #endif
84 
85 
86 // Local Variables:
87 // mode: c++
88 // fill-column: 100
89 // comment-column: 40
90 // c-file-style: "senf"
91 // indent-tabs-mode: nil
92 // ispell-local-dictionary: "american"
93 // compile-command: "scons -u test"
94 // End:
AbstractTerminal interface implementation based on telnet.
#define SENF_LOG_CLASS_AREA()
virtual std::string terminalType()
Get the terminal type.
virtual void setCallbacks(AbstractTerminal::Callbacks &cb)
Register terminal callbacks.
virtual unsigned width() const
Get current terminal window width.
Implement NAWS (Negotiation About Window Size) option.
Definition: Telnet.hh:404
virtual void v_setupFailed()=0
Called when the telnet setup has failed.
Terminal public header.
virtual unsigned height() const
Get current terminal window height.
virtual void write(char ch)
Write character to terminal.
Implement TERMINAL_TYPE option.
Definition: Telnet.hh:373
Telnet public header.
Abstract terminal interface.