home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Comms Spectacular / MacTCP / TurboTCP / MiniTelnet.source / CTelnetTerminal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-10  |  2.8 KB  |  123 lines  |  [TEXT/KAHL]

  1. /*
  2. ** CTelnetTerminal.h
  3. **
  4. **    MiniTelnet application
  5. **    Telnet session document
  6. **
  7. **    Copyright © 1993, FrostByte Design / Eric Scouten
  8. **
  9. */
  10.  
  11.  
  12. #pragma once
  13.  
  14. #include "CTelnetInterpreter.h"
  15. #include "MiniTelnet.const.h"
  16.  
  17. CLASS CTerminalPane;
  18.  
  19.  
  20. // important resource numbers
  21.  
  22. #define MENUTelnet            21
  23. #define WINDTelnet            1026
  24. #define SCPNTelnet            1026
  25. #define DLOGSettings        2800
  26. #define STR_SettingsPrompt    2800
  27.  
  28.  
  29. // command numbers
  30.  
  31. #define cmdOpenSettings        2000L                // File menu
  32.  
  33. #define cmdSendSynch        2100L                // Telnet menu
  34. #define cmdSendBreak        2101L
  35. #define cmdSendAO            2102L
  36. #define cmdSendIP            2103L
  37. #define cmdSendAYT            2104L
  38. #define cmdSendGA            2105L
  39. #define cmdSendEC            2110L
  40. #define cmdSendEL            2111L
  41. #define cmdSendIPAddr        2120L
  42. #define cmdShowDebug        2199L
  43.  
  44. #define cmdSaveSettings        2800L                // Settings dialog
  45.  
  46.  
  47. /*______________________________________________________________________
  48. **
  49. ** CTelnetTerminal
  50. **
  51. **    This class implements the behavior of a terminal connected to Telnet. It uses the
  52. **    CTerminalPane class to draw the terminal screen. It handles all user events (such as
  53. **    key-downs) and interacts with CTCPStream to process them.
  54. **
  55. **    Some debugging methods are included so that the “behind-the-scenes” negotiation of
  56. **    Telnet can be viewed on-screen.
  57. **
  58. */
  59.  
  60. class CTelnetTerminal : public CTelnetInterpreter {
  61.  
  62. public:
  63.     CTerminalPane        *itsTerminal;                // terminal who displays our I/O
  64.  
  65. protected:
  66.     TelnetSettingsRec    r;                        // settings record
  67.     short            itsTermMode;                // which terminal emulation?
  68.  
  69.  
  70.     // initialization
  71.  
  72. public:
  73.     void ITelnetTerminal (CApplication *aSupervisor, Boolean printable, long recBufferSize,
  74.                         b_16 theDefaultPort, short autoReceiveSize, short autoReceiveNum);
  75.  
  76.  
  77.     // creating new sessions
  78.  
  79.     virtual void NewSession (TelnetSettingsRec *theSettings);
  80.     virtual void BuildWindow (void);
  81.     virtual void AutoTitle (void);
  82.  
  83.  
  84.     // command/event handling
  85.  
  86.     virtual void DoCommand (long theCommand);
  87.     virtual void DoKeyDown (char theChar, Byte keyCode, EventRecord *macEvent);
  88.     virtual void DoAutoKey (char theChar, Byte keyCode, EventRecord *macEvent);
  89.     virtual void DoPaste (void);
  90.     virtual void UpdateMenus (void);
  91.  
  92.  
  93.     // data handling methods
  94.  
  95.     virtual void HandleNVTChar (char theChar);
  96.     virtual void HandleNVTLine (char *theLine);
  97.  
  98.  
  99.     // Telnet command handling
  100.  
  101.     virtual void ReceivedDo (uchar theOption);
  102.     virtual void ReceivedAYT (void);
  103.     virtual void ReceivedEC (void);
  104.     virtual void ReceivedEL (void);
  105.     virtual void ReceivedSE (void);
  106.  
  107.  
  108.     // Telnet option handling
  109.  
  110.     virtual void OptionTerminalType (void);
  111.  
  112.  
  113.     // terminal emulation handling
  114.  
  115.     virtual void GetTerminalName (short termIndex, uchar *termStr);
  116.  
  117.  
  118.     // debugging methods
  119.  
  120.     virtual void PrintDebugStr (char *theDebugStr);
  121.     virtual void PrintDebugCharNum (char theChar, char leftBracket, char rightBracket);
  122.  
  123. };