PTLib  Version 2.14.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
conchan.h
Go to the documentation of this file.
1 /*
2  * conchan.h
3  *
4  * Console I/O channel class.
5  *
6  * Portable Windows Library
7  *
8  * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Portable Windows Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
25  * All Rights Reserved.
26  *
27  * Contributor(s): ______________________________________.
28  *
29  * $Revision: 31101 $
30  * $Author: rjongbloed $
31  * $Date: 2013-12-18 12:36:42 +1100 (Wed, 18 Dec 2013) $
32  */
33 
34 #ifndef PTLIB_CONSOLECHANNEL_H
35 #define PTLIB_CONSOLECHANNEL_H
36 
37 #ifdef P_USE_PRAGMA
38 #pragma interface
39 #endif
40 
42 
43 
44 // Console Channel
45 
46 
48 class PConsoleChannel : public PChannel
49 {
50  PCLASSINFO(PConsoleChannel, PChannel);
51 
52  public:
53  enum ConsoleType {
56  StandardError
57  };
58 
60  enum {
61  KeyLeft = 0x10000, // Larger than possible Unicode character return
72 
73  KeyFuncBase = 0x10100,
74  KeyF1 = KeyFuncBase+1,
86  // Additional function keys have codes from here
87 
88  MouseEvent = 0x40000000,
89  MouseButton1 = 1,
90  MouseButton2 = 2,
91  MouseButton3 = 4,
92  MouseButton4 = 8,
93  MouseClickShift = 4,
94  MouseDoubleClick = 0x80,
95  MouseShiftKey = 0x100,
96  MouseCtrlKey = 0x100,
97  MouseAltKey = 0x200,
98  MouseRowShift = 20,
99  MouseColShift = 12,
100  };
101 
104 
105  PConsoleChannel();
106 
109  ConsoleType type
110  );
112 
120  virtual PString GetName() const;
121 
126  virtual PBoolean Close();
127 
135  virtual int ReadChar();
136 
144  virtual bool SetLocalEcho(
145  bool localEcho
146  );
147 
154  virtual bool SetLineBuffered(
155  bool lineBuffered
156  );
158 
165  virtual PBoolean Open(
166  ConsoleType type
167  );
169 
170 
171 // Include platform dependent part of class
172 #ifdef _WIN32
173 #include "msos/ptlib/conchan.h"
174 #else
175 #include "unix/ptlib/conchan.h"
176 #endif
177 
178 };
179 
180 
181 #endif // PTLIB_CONSOLECHANNEL_H
182 
183 
184 // End Of File ///////////////////////////////////////////////////////////////