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