1 | <?php |
||
18 | class Terminal implements TerminalInterface |
||
19 | { |
||
20 | /** @var CursorInterface */ |
||
21 | protected $cursor; |
||
22 | /** @var int */ |
||
23 | private $width = self::DEFAULT_WIDTH; |
||
24 | /** @var int */ |
||
25 | private $height = self::DEFAULT_HEIGHT; |
||
26 | |||
27 | /** |
||
28 | * Terminal will provide cursor and dimension information to the outputter |
||
29 | * |
||
30 | * @param CursorInterface|null $cursor |
||
31 | * @param SymfonyTerminal $terminal |
||
32 | */ |
||
33 | public function __construct(CursorInterface $cursor = null, SymfonyTerminal $terminal = null) |
||
40 | |||
41 | /** |
||
42 | * @return int |
||
43 | */ |
||
44 | public function getWidth() |
||
48 | |||
49 | /** |
||
50 | * @return int |
||
51 | */ |
||
52 | public function getHeight() |
||
56 | |||
57 | /** |
||
58 | * Move the cursor to y,x |
||
59 | * |
||
60 | * @param int $line |
||
61 | * @param int $column |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | public function move($line, $column) |
||
69 | |||
70 | /** |
||
71 | * Move up n Lines |
||
72 | * |
||
73 | * @param int $lines |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | public function moveUp($lines) |
||
81 | |||
82 | /** |
||
83 | * Move down n Lines |
||
84 | * |
||
85 | * @param int $lines |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | public function moveDown($lines) |
||
93 | |||
94 | /** |
||
95 | * Move left n Columns |
||
96 | * |
||
97 | * @param int $columns |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | public function moveLeft($columns) |
||
105 | |||
106 | /** |
||
107 | * Move right n Columns |
||
108 | * |
||
109 | * @param int $columns |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | public function moveRight($columns) |
||
117 | |||
118 | /** |
||
119 | * Erase to the end of the line |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | public function eraseToEnd() |
||
127 | |||
128 | /** |
||
129 | * Erase to the start of the line |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | public function eraseToStart() |
||
137 | |||
138 | /** |
||
139 | * Erase Down |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | public function eraseDown() |
||
147 | |||
148 | /** |
||
149 | * Erase Up |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | public function eraseUp() |
||
157 | |||
158 | /** |
||
159 | * Erase entire screen |
||
160 | * |
||
161 | * @return string |
||
162 | */ |
||
163 | public function eraseScreen() |
||
167 | } |
||
168 |