Fix build.
[reactos.git] / base / applications / network / telnet / src / tkeydef.h
1 /////////////////////////////////////////////////////////
2 // TkeyDef - Key Definitions class //
3 // - keeped in an array container //
4 /////////////////////////////////////////////////////////
5
6 #ifndef __TKEYDEF_H
7 #define __TKEYDEF_H
8
9 #include <windows.h>
10
11 #ifndef __BORLANDC__ // Ioannou Dec. 8, 1998
12 // We need these for MSVC6 (Sam Robertson Oct. 8, 1998)
13 class TKeyDef;
14 bool operator==(const TKeyDef &t1, const TKeyDef &t2);
15 bool operator<(const TKeyDef &t1, const TKeyDef &t2);
16 ////
17 #endif
18
19 // Paul Brannan Feb. 5, 1999
20 enum tn_ops {TN_ESCAPE, TN_SCROLLBACK, TN_DIAL, TN_PASTE, TN_NULL, TN_CR, TN_CRLF};
21
22 typedef struct {
23 char sendstr;
24 tn_ops the_op;
25 } optype;
26
27 union KeyDefType {
28 char *szKeyDef;
29 optype *op;
30 };
31
32 union KeyDefType_const {
33 const char *szKeyDef;
34 const optype *op;
35 };
36
37 class TKeyDef {
38 private:
39 KeyDefType uKeyDef;
40 DWORD vk_code;
41 DWORD dwState;
42
43 public:
44 TKeyDef();
45 TKeyDef(char *def, DWORD state, DWORD code);
46 TKeyDef(optype op, DWORD state, DWORD code);
47 TKeyDef(const TKeyDef &t);
48
49 char *operator=(char *def);
50 DWORD operator=(DWORD code);
51 TKeyDef& operator=(const TKeyDef &t);
52 const optype& operator=(optype op);
53
54 ~TKeyDef();
55
56 #ifdef __BORLANDC__
57 int operator==(TKeyDef &t);
58 #else
59 // made these into friends for compatibility with stl
60 // (Paul Brannan 5/7/98)
61 friend bool operator==(const TKeyDef &t1, const TKeyDef &t2);
62 friend bool operator<(const TKeyDef &t1, const TKeyDef &t2);
63 #endif
64
65 const char *GetszKey() { return uKeyDef.szKeyDef; }
66 const KeyDefType GetKeyDef() { return uKeyDef; }
67 DWORD GetCodeKey() { return vk_code; }
68
69 };
70
71 #endif