1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PhpSchool\CliMenu\Terminal; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class WindowsTerminal |
7
|
|
|
* |
8
|
|
|
* @author Michael Woodward <[email protected]> |
9
|
|
|
*/ |
10
|
|
|
class WindowsTerminal implements TerminalInterface |
11
|
|
|
{ |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Get terminal details |
15
|
|
|
* |
16
|
|
|
* @return string |
17
|
|
|
*/ |
18
|
|
|
public function getDetails() |
19
|
|
|
{ |
20
|
|
|
// TODO: Implement getDetails() method. |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Kill the application |
25
|
|
|
* |
26
|
|
|
* @return void |
27
|
|
|
*/ |
28
|
|
|
public function killProcess() |
29
|
|
|
{ |
30
|
|
|
// TODO: Implement killProcess() method. |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Get the available width of the width |
35
|
|
|
* |
36
|
|
|
* @return int |
37
|
|
|
*/ |
38
|
|
|
public function getWidth() |
39
|
|
|
{ |
40
|
|
|
// TODO: Implement getWidth() method. |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Toggle raw mode on TTY |
45
|
|
|
* |
46
|
|
|
* @param bool $useRaw |
47
|
|
|
*/ |
48
|
|
|
public function setRawMode($useRaw = true) |
|
|
|
|
49
|
|
|
{ |
50
|
|
|
// TODO: Implement setRawMode() method. |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Check if TTY is in raw mode |
55
|
|
|
* |
56
|
|
|
* @return bool |
57
|
|
|
*/ |
58
|
|
|
public function isRaw() |
59
|
|
|
{ |
60
|
|
|
// TODO: Implement isRaw() method. |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Test whether terminal is valid TTY |
65
|
|
|
* |
66
|
|
|
* @return bool |
67
|
|
|
*/ |
68
|
|
|
public function isTTY() |
69
|
|
|
{ |
70
|
|
|
// TODO: Implement isTTY() method. |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Clear the terminal window |
75
|
|
|
*/ |
76
|
|
|
public function clear() |
77
|
|
|
{ |
78
|
|
|
// TODO: Implement clear() method. |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* Toggle cursor display |
83
|
|
|
* |
84
|
|
|
* @param bool $enableCursor |
85
|
|
|
*/ |
86
|
|
|
public function enableCursor($enableCursor = true) |
87
|
|
|
{ |
88
|
|
|
// TODO: Implement enableCursor() method. |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* @return string |
93
|
|
|
*/ |
94
|
|
|
public function getKeyedInput() |
95
|
|
|
{ |
96
|
|
|
// TODO: Implement getKeyedInput() method. |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Get the available height of the terminal |
101
|
|
|
* |
102
|
|
|
* @return int |
103
|
|
|
*/ |
104
|
|
|
public function getHeight() |
105
|
|
|
{ |
106
|
|
|
// TODO: Implement getHeight() method. |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* Toggle canonical mode on TTY |
111
|
|
|
* |
112
|
|
|
* @param bool $useCanonicalMode |
113
|
|
|
*/ |
114
|
|
|
public function setCanonicalMode($useCanonicalMode = true) |
115
|
|
|
{ |
116
|
|
|
// TODO: Implement setCanonicalMode() method. |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* Check if TTY is in canonical mode |
121
|
|
|
* |
122
|
|
|
* @return bool |
123
|
|
|
*/ |
124
|
|
|
public function isCanonical() |
125
|
|
|
{ |
126
|
|
|
// TODO: Implement isCanonical() method. |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* Test whether terminal supports colour output |
131
|
|
|
* |
132
|
|
|
* @return bool |
133
|
|
|
*/ |
134
|
|
|
public function supportsColour() |
135
|
|
|
{ |
136
|
|
|
// TODO: Implement supportsColour() method. |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* Clear the current cursors line |
141
|
|
|
* |
142
|
|
|
* @return void |
143
|
|
|
*/ |
144
|
|
|
public function clearLine() |
145
|
|
|
{ |
146
|
|
|
// TODO: Implement clearLine() method. |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* Move the cursor to the top left of the window |
151
|
|
|
* |
152
|
|
|
* @return void |
153
|
|
|
*/ |
154
|
|
|
public function moveCursorToTop() |
155
|
|
|
{ |
156
|
|
|
// TODO: Implement moveCursorToTop() method. |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* Move the cursor to the start of a specific row |
161
|
|
|
* |
162
|
|
|
* @param int $rowNumber |
163
|
|
|
*/ |
164
|
|
|
public function moveCursorToRow($rowNumber) |
165
|
|
|
{ |
166
|
|
|
// TODO: Implement moveCursorToRow() method. |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* Clean the whole console without jumping the window |
171
|
|
|
* |
172
|
|
|
* @return void |
173
|
|
|
*/ |
174
|
|
|
public function clean() |
175
|
|
|
{ |
176
|
|
|
// TODO: Implement clean() method. |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* Disable cursor display |
181
|
|
|
*/ |
182
|
|
|
public function disableCursor() |
183
|
|
|
{ |
184
|
|
|
// TODO: Implement disableCursor() method. |
185
|
|
|
} |
186
|
|
|
} |
187
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.