upgrade zend (#1559)
[openemr.git] / vendor / zendframework / zend-console / src / Adapter / AdapterInterface.php
blob60f631ee71580699e6728817f372feb30f054065
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Console\Adapter;
12 use Zend\Console\Charset\CharsetInterface;
14 interface AdapterInterface
16 const LINE_NONE = 1;
17 const LINE_SINGLE = 2;
18 const LINE_DOUBLE = 3;
19 const LINE_BLOCK = 4;
20 const FILL_NONE = 0;
21 const FILL_SHADE_LIGHT = 1;
22 const FILL_SHADE_MEDIUM = 2;
23 const FILL_SHADE_DARK = 3;
24 const FILL_BLOCK = 10;
26 /**
27 * Write a chunk of text to console.
29 * @param string $text
30 * @param null|int $color
31 * @param null|int $bgColor
32 * @return void
34 public function write($text, $color = null, $bgColor = null);
36 /**
37 * Alias for write()
39 * @param string $text
40 * @param null|int $color
41 * @param null|int $bgColor
42 * @return void
44 public function writeText($text, $color = null, $bgColor = null);
46 /**
47 * Write a single line of text to console and advance cursor to the next line.
48 * If the text is longer than console width it will be truncated.
50 * @param string $text
51 * @param null|int $color
52 * @param null|int $bgColor
53 * @return void
55 public function writeLine($text = "", $color = null, $bgColor = null);
57 /**
58 * Write a piece of text at the coordinates of $x and $y
60 * @param string $text Text to write
61 * @param int $x Console X coordinate (column)
62 * @param int $y Console Y coordinate (row)
63 * @param null|int $color
64 * @param null|int $bgColor
65 * @return void
67 public function writeAt($text, $x, $y, $color = null, $bgColor = null);
69 /**
70 * Write a box at the specified coordinates.
71 * If X or Y coordinate value is negative, it will be calculated as the distance from far right or bottom edge
72 * of the console (respectively).
74 * @param int $x1 Top-left corner X coordinate (column)
75 * @param int $y1 Top-left corner Y coordinate (row)
76 * @param int $x2 Bottom-right corner X coordinate (column)
77 * @param int $y2 Bottom-right corner Y coordinate (row)
78 * @param int $lineStyle (optional) Box border style.
79 * @param int $fillStyle (optional) Box fill style or a single character to fill it with.
80 * @param int $color (optional) Foreground color
81 * @param int $bgColor (optional) Background color
82 * @param null|int $fillColor (optional) Foreground color of box fill
83 * @param null|int $fillBgColor (optional) Background color of box fill
84 * @return void
86 public function writeBox(
87 $x1,
88 $y1,
89 $x2,
90 $y2,
91 $lineStyle = self::LINE_SINGLE,
92 $fillStyle = self::FILL_NONE,
93 $color = null,
94 $bgColor = null,
95 $fillColor = null,
96 $fillBgColor = null
99 /**
100 * Write a block of text at the given coordinates, matching the supplied width and height.
101 * In case a line of text does not fit desired width, it will be wrapped to the next line.
102 * In case the whole text does not fit in desired height, it will be truncated.
104 * @param string $text Text to write
105 * @param int $width Maximum block width. Negative value means distance from right edge.
106 * @param int|null $height Maximum block height. Negative value means distance from bottom edge.
107 * @param int $x Block X coordinate (column)
108 * @param int $y Block Y coordinate (row)
109 * @param null|int $color (optional) Text color
110 * @param null|int $bgColor (optional) Text background color
111 * @return void
113 public function writeTextBlock(
114 $text,
115 $width,
116 $height = null,
117 $x = 0,
118 $y = 0,
119 $color = null,
120 $bgColor = null
124 * Determine and return current console width.
126 * @return int
128 public function getWidth();
131 * Determine and return current console height.
133 * @return int
135 public function getHeight();
138 * Determine and return current console width and height.
140 * @return array array($width, $height)
142 public function getSize();
145 * Check if console is UTF-8 compatible
147 * @return bool
149 public function isUtf8();
152 * Set cursor position
154 * @param int $x
155 * @param int $y
156 * @return void
158 public function setPos($x, $y);
161 * Hide console cursor
162 * @return void
164 public function hideCursor();
167 * Show console cursor
168 * @return void
170 public function showCursor();
173 * Return current console window title.
175 * @return string
177 public function getTitle();
180 * Prepare a string that will be rendered in color.
182 * @param string $string
183 * @param null|int $color Foreground color
184 * @param null|int $bgColor Background color
185 * @return string
187 public function colorize($string, $color = null, $bgColor = null);
190 * Change current drawing color.
192 * @param int $color
193 * @return void
195 public function setColor($color);
198 * Change current drawing background color
200 * @param int $color
201 * @return void
203 public function setBgColor($color);
206 * Reset color to console default.
207 * @return void
209 public function resetColor();
212 * Set Console charset to use.
214 * @param CharsetInterface $charset
215 * @return void
217 public function setCharset(CharsetInterface $charset);
220 * Get charset currently in use by this adapter.
222 * @return CharsetInterface $charset
224 public function getCharset();
227 * @return CharsetInterface
229 public function getDefaultCharset();
232 * Clear console screen
233 * @return void
235 public function clear();
238 * Clear line at cursor position
239 * @return void
241 public function clearLine();
244 * Clear console screen
245 * @return void
247 public function clearScreen();
250 * Read a single line from the console input
252 * @param int $maxLength Maximum response length
253 * @return string
255 public function readLine($maxLength = 2048);
258 * Read a single character from the console input
260 * @param string|null $mask A list of allowed chars
261 * @return string
263 public function readChar($mask = null);