1use crate::{FontManager, ZplResult};
2
3#[allow(clippy::too_many_arguments)]
8pub trait ZplForgeBackend {
9 fn setup_page(&mut self, width: f64, height: f64, resolution: f32);
11
12 fn setup_font_manager(&mut self, font_manager: &FontManager);
14
15 fn draw_text(
17 &mut self,
18 x: u32,
19 y: u32,
20 font: char,
21 height: Option<u32>,
22 width: Option<u32>,
23 text: String,
24 reverse_print: bool,
25 color: Option<String>,
26 ) -> ZplResult<()>;
27
28 fn draw_graphic_box(
30 &mut self,
31 x: u32,
32 y: u32,
33 width: u32,
34 height: u32,
35 thickness: u32,
36 color: char,
37 custom_color: Option<String>,
38 rounding: u32,
39 reverse_print: bool,
40 ) -> ZplResult<()>;
41
42 fn draw_graphic_circle(
44 &mut self,
45 x: u32,
46 y: u32,
47 radius: u32,
48 thickness: u32,
49 color: char,
50 custom_color: Option<String>,
51 reverse_print: bool,
52 ) -> ZplResult<()>;
53
54 fn draw_graphic_ellipse(
56 &mut self,
57 x: u32,
58 y: u32,
59 width: u32,
60 height: u32,
61 thickness: u32,
62 color: char,
63 custom_color: Option<String>,
64 reverse_print: bool,
65 ) -> ZplResult<()>;
66
67 fn draw_graphic_field(
69 &mut self,
70 x: u32,
71 y: u32,
72 width: u32,
73 height: u32,
74 data: Vec<u8>,
75 reverse_print: bool,
76 ) -> ZplResult<()>;
77
78 fn draw_graphic_image_custom(
83 &mut self,
84 x: u32,
85 y: u32,
86 width: u32,
87 height: u32,
88 data: String,
89 ) -> ZplResult<()>;
90
91 fn draw_code128(
93 &mut self,
94 x: u32,
95 y: u32,
96 orientation: char,
97 height: u32,
98 module_width: u32,
99 interpretation_line: char,
100 interpretation_line_above: char,
101 check_digit: char,
102 mode: char,
103 data: String,
104 reverse_print: bool,
105 ) -> ZplResult<()>;
106
107 fn draw_qr_code(
109 &mut self,
110 x: u32,
111 y: u32,
112 orientation: char,
113 model: u32,
114 magnification: u32,
115 error_correction: char,
116 mask: u32,
117 data: String,
118 reverse_print: bool,
119 ) -> ZplResult<()>;
120
121 fn draw_code39(
123 &mut self,
124 x: u32,
125 y: u32,
126 orientation: char,
127 check_digit: char,
128 height: u32,
129 module_width: u32,
130 interpretation_line: char,
131 interpretation_line_above: char,
132 data: String,
133 reverse_print: bool,
134 ) -> ZplResult<()>;
135
136 fn finalize(&mut self) -> ZplResult<Vec<u8>>;
138}