1 #ifndef __TNCLASS_H_ 2 #define __TNCLASS_H_ 3 4 #include <windows.h> 5 #include "tnconfig.h" 6 #include "ttelhndl.h" 7 #include "tncon.h" 8 #include "tnerror.h" 9 #include "tparams.h" 10 #include "keytrans.h" 11 #include "ansiprsr.h" 12 #include "tcharmap.h" 13 #include "tnclip.h" 14 #include "tmouse.h" 15 #include "tmapldr.h" 16 17 class Telnet { 18 public: 19 // create a telnet instance 20 Telnet(); 21 // open a connection return on break/quit 22 Telnet(const char * szHost1, const char *strPort1); 23 ~Telnet(); 24 25 // open a connection return on break/quit 26 int Open(const char *szHost, const char *strPort = "23"); 27 int Close(); // close current connection 28 int Resume(); // resume current session 29 30 // changes to the keymap profile in the file 31 int LoadKeyMap( const char * file, const char * name); 32 void DisplayKeyMap(); // display available keymaps 33 int SwitchKeyMap(int); // switch to selected keymap 34 private: 35 SOCKET Connect(); 36 void telSetConsoleTitle(const char * szHost); 37 void DoInit(); 38 39 SOCKET Socket; 40 char strPort[32]; // int iPort; 41 char szHost[127]; 42 volatile int bConnected; 43 volatile int bWinsockUp; 44 volatile int bNetPaused; 45 volatile int bNetFinished; 46 volatile int bNetFinish; 47 48 // The order of member classes in the class definition MUST come in 49 // this order! (Paul Brannan 12/4/98) 50 TNetwork Network; 51 TCharmap Charmap; 52 KeyTranslator KeyTrans; 53 TMapLoader MapLoader; 54 TConsole Console; 55 TTelnetHandler TelHandler; 56 TelThreadParams ThreadParams; 57 Tnclip Clipboard; 58 TMouse Mouse; 59 TScroller Scroller; 60 TANSIParser Parser; 61 62 HWND hConsoleWindow; // Paul Brannan 8/10/98 63 LPARAM oldBIcon, oldSIcon; // Paul Brannan 8/10/98 64 bool iconChange; 65 66 HANDLE hThread; // Paul Brannan 8/11/98 67 HANDLE hProcess; // Paul Brannan 7/15/99 68 69 void NewProcess(); // Paul Brannan 9/13/98 70 void SetLocalAddress(SOCKET s); 71 }; 72 73 #endif 74 75