1 | <?php |
||
5 | class Printer |
||
6 | { |
||
7 | const ALIGN_LEFT = 0; |
||
8 | const ALIGN_CENTER = 1; |
||
9 | const ALIGN_RIGHT = 2; |
||
10 | |||
11 | const STYLE_BOLD = 1; |
||
12 | const STYLE_ITALIC = 2; |
||
13 | const STYLE_UNDERLINE = 4; |
||
14 | const STYLE_CONDENSED = 8; |
||
15 | const STYLE_DOUBLE_WIDTH = 16; |
||
16 | const STYLE_DOUBLE_HEIGHT = 32; |
||
17 | |||
18 | const CUT_FULL = 0; |
||
19 | const CUT_PARTIAL = 1; |
||
20 | |||
21 | const DRAWER_1 = 0; |
||
22 | const DRAWER_2 = 1; |
||
23 | |||
24 | private $model; |
||
25 | private $connection; |
||
26 | |||
27 | 11 | public function __construct($model, $connection) |
|
35 | |||
36 | 1 | public function setCodePage($codepage) |
|
41 | |||
42 | 1 | public function buzzer() |
|
47 | |||
48 | 1 | public function cutter($mode = self::CUT_PARTIAL) |
|
53 | |||
54 | /** |
||
55 | * @param int $number drawer id |
||
56 | * @param int $on_time time in milliseconds that activate the drawer |
||
57 | * @param int $off_time time in milliseconds that deactivate the drawer |
||
58 | */ |
||
59 | 2 | public function drawer($number = self::DRAWER_1, $on_time = 120, $off_time = 240) |
|
64 | |||
65 | 1 | public function draw($image, $align = self::ALIGN_LEFT) |
|
70 | |||
71 | 2 | public function write($text, $styles = 0, $align = self::ALIGN_LEFT) |
|
76 | |||
77 | 1 | public function writeln($text, $styles = 0, $align = self::ALIGN_LEFT) |
|
85 | |||
86 | 2 | public function feed($lines = 1) |
|
91 | |||
92 | 4 | public function getColumns() |
|
96 | |||
97 | /** |
||
98 | * Set columns aproximated to informed |
||
99 | * @param int $columns aproximated number of columns |
||
100 | */ |
||
101 | 4 | public function setColumns($columns) |
|
106 | |||
107 | 1 | public function close() |
|
112 | } |
||
113 |