Skip to main content

browser_protocol/overlay/
mod.rs

1//! This domain provides various functionality related to drawing atop the inspected page.
2
3
4use serde::{Serialize, Deserialize};
5use serde_json::Value as JsonValue;
6use std::borrow::Cow;
7
8/// Configuration data for drawing the source order of an elements children.
9
10#[derive(Debug, Clone, Serialize, Deserialize, Default)]
11#[serde(rename_all = "camelCase")]
12pub struct SourceOrderConfig {
13    /// the color to outline the given element in.
14    #[serde(rename = "parentOutlineColor")]
15    parent_outline_color: crate::dom::RGBA,
16    /// the color to outline the child elements in.
17    #[serde(rename = "childOutlineColor")]
18    child_outline_color: crate::dom::RGBA,
19}
20
21impl SourceOrderConfig {
22    /// Creates a builder for this type with the required parameters:
23    /// * `parent_outline_color`: the color to outline the given element in.
24    /// * `child_outline_color`: the color to outline the child elements in.
25    pub fn builder(parent_outline_color: crate::dom::RGBA, child_outline_color: crate::dom::RGBA) -> SourceOrderConfigBuilder {
26        SourceOrderConfigBuilder {
27            parent_outline_color: parent_outline_color,
28            child_outline_color: child_outline_color,
29        }
30    }
31    /// the color to outline the given element in.
32    pub fn parent_outline_color(&self) -> &crate::dom::RGBA { &self.parent_outline_color }
33    /// the color to outline the child elements in.
34    pub fn child_outline_color(&self) -> &crate::dom::RGBA { &self.child_outline_color }
35}
36
37
38pub struct SourceOrderConfigBuilder {
39    parent_outline_color: crate::dom::RGBA,
40    child_outline_color: crate::dom::RGBA,
41}
42
43impl SourceOrderConfigBuilder {
44    pub fn build(self) -> SourceOrderConfig {
45        SourceOrderConfig {
46            parent_outline_color: self.parent_outline_color,
47            child_outline_color: self.child_outline_color,
48        }
49    }
50}
51
52/// Configuration data for the highlighting of Grid elements.
53
54#[derive(Debug, Clone, Serialize, Deserialize, Default)]
55#[serde(rename_all = "camelCase")]
56pub struct GridHighlightConfig {
57    /// Whether the extension lines from grid cells to the rulers should be shown (default: false).
58    #[serde(skip_serializing_if = "Option::is_none", rename = "showGridExtensionLines")]
59    show_grid_extension_lines: Option<bool>,
60    /// Show Positive line number labels (default: false).
61    #[serde(skip_serializing_if = "Option::is_none", rename = "showPositiveLineNumbers")]
62    show_positive_line_numbers: Option<bool>,
63    /// Show Negative line number labels (default: false).
64    #[serde(skip_serializing_if = "Option::is_none", rename = "showNegativeLineNumbers")]
65    show_negative_line_numbers: Option<bool>,
66    /// Show area name labels (default: false).
67    #[serde(skip_serializing_if = "Option::is_none", rename = "showAreaNames")]
68    show_area_names: Option<bool>,
69    /// Show line name labels (default: false).
70    #[serde(skip_serializing_if = "Option::is_none", rename = "showLineNames")]
71    show_line_names: Option<bool>,
72    /// Show track size labels (default: false).
73    #[serde(skip_serializing_if = "Option::is_none", rename = "showTrackSizes")]
74    show_track_sizes: Option<bool>,
75    /// The grid container border highlight color (default: transparent).
76    #[serde(skip_serializing_if = "Option::is_none", rename = "gridBorderColor")]
77    grid_border_color: Option<crate::dom::RGBA>,
78    /// The cell border color (default: transparent). Deprecated, please use rowLineColor and columnLineColor instead.
79    #[serde(skip_serializing_if = "Option::is_none", rename = "cellBorderColor")]
80    cell_border_color: Option<crate::dom::RGBA>,
81    /// The row line color (default: transparent).
82    #[serde(skip_serializing_if = "Option::is_none", rename = "rowLineColor")]
83    row_line_color: Option<crate::dom::RGBA>,
84    /// The column line color (default: transparent).
85    #[serde(skip_serializing_if = "Option::is_none", rename = "columnLineColor")]
86    column_line_color: Option<crate::dom::RGBA>,
87    /// Whether the grid border is dashed (default: false).
88    #[serde(skip_serializing_if = "Option::is_none", rename = "gridBorderDash")]
89    grid_border_dash: Option<bool>,
90    /// Whether the cell border is dashed (default: false). Deprecated, please us rowLineDash and columnLineDash instead.
91    #[serde(skip_serializing_if = "Option::is_none", rename = "cellBorderDash")]
92    cell_border_dash: Option<bool>,
93    /// Whether row lines are dashed (default: false).
94    #[serde(skip_serializing_if = "Option::is_none", rename = "rowLineDash")]
95    row_line_dash: Option<bool>,
96    /// Whether column lines are dashed (default: false).
97    #[serde(skip_serializing_if = "Option::is_none", rename = "columnLineDash")]
98    column_line_dash: Option<bool>,
99    /// The row gap highlight fill color (default: transparent).
100    #[serde(skip_serializing_if = "Option::is_none", rename = "rowGapColor")]
101    row_gap_color: Option<crate::dom::RGBA>,
102    /// The row gap hatching fill color (default: transparent).
103    #[serde(skip_serializing_if = "Option::is_none", rename = "rowHatchColor")]
104    row_hatch_color: Option<crate::dom::RGBA>,
105    /// The column gap highlight fill color (default: transparent).
106    #[serde(skip_serializing_if = "Option::is_none", rename = "columnGapColor")]
107    column_gap_color: Option<crate::dom::RGBA>,
108    /// The column gap hatching fill color (default: transparent).
109    #[serde(skip_serializing_if = "Option::is_none", rename = "columnHatchColor")]
110    column_hatch_color: Option<crate::dom::RGBA>,
111    /// The named grid areas border color (Default: transparent).
112    #[serde(skip_serializing_if = "Option::is_none", rename = "areaBorderColor")]
113    area_border_color: Option<crate::dom::RGBA>,
114    /// The grid container background color (Default: transparent).
115    #[serde(skip_serializing_if = "Option::is_none", rename = "gridBackgroundColor")]
116    grid_background_color: Option<crate::dom::RGBA>,
117}
118
119impl GridHighlightConfig {
120    /// Creates a builder for this type.
121    pub fn builder() -> GridHighlightConfigBuilder {
122        GridHighlightConfigBuilder {
123            show_grid_extension_lines: None,
124            show_positive_line_numbers: None,
125            show_negative_line_numbers: None,
126            show_area_names: None,
127            show_line_names: None,
128            show_track_sizes: None,
129            grid_border_color: None,
130            cell_border_color: None,
131            row_line_color: None,
132            column_line_color: None,
133            grid_border_dash: None,
134            cell_border_dash: None,
135            row_line_dash: None,
136            column_line_dash: None,
137            row_gap_color: None,
138            row_hatch_color: None,
139            column_gap_color: None,
140            column_hatch_color: None,
141            area_border_color: None,
142            grid_background_color: None,
143        }
144    }
145    /// Whether the extension lines from grid cells to the rulers should be shown (default: false).
146    pub fn show_grid_extension_lines(&self) -> Option<bool> { self.show_grid_extension_lines }
147    /// Show Positive line number labels (default: false).
148    pub fn show_positive_line_numbers(&self) -> Option<bool> { self.show_positive_line_numbers }
149    /// Show Negative line number labels (default: false).
150    pub fn show_negative_line_numbers(&self) -> Option<bool> { self.show_negative_line_numbers }
151    /// Show area name labels (default: false).
152    pub fn show_area_names(&self) -> Option<bool> { self.show_area_names }
153    /// Show line name labels (default: false).
154    pub fn show_line_names(&self) -> Option<bool> { self.show_line_names }
155    /// Show track size labels (default: false).
156    pub fn show_track_sizes(&self) -> Option<bool> { self.show_track_sizes }
157    /// The grid container border highlight color (default: transparent).
158    pub fn grid_border_color(&self) -> Option<&crate::dom::RGBA> { self.grid_border_color.as_ref() }
159    /// The cell border color (default: transparent). Deprecated, please use rowLineColor and columnLineColor instead.
160    pub fn cell_border_color(&self) -> Option<&crate::dom::RGBA> { self.cell_border_color.as_ref() }
161    /// The row line color (default: transparent).
162    pub fn row_line_color(&self) -> Option<&crate::dom::RGBA> { self.row_line_color.as_ref() }
163    /// The column line color (default: transparent).
164    pub fn column_line_color(&self) -> Option<&crate::dom::RGBA> { self.column_line_color.as_ref() }
165    /// Whether the grid border is dashed (default: false).
166    pub fn grid_border_dash(&self) -> Option<bool> { self.grid_border_dash }
167    /// Whether the cell border is dashed (default: false). Deprecated, please us rowLineDash and columnLineDash instead.
168    pub fn cell_border_dash(&self) -> Option<bool> { self.cell_border_dash }
169    /// Whether row lines are dashed (default: false).
170    pub fn row_line_dash(&self) -> Option<bool> { self.row_line_dash }
171    /// Whether column lines are dashed (default: false).
172    pub fn column_line_dash(&self) -> Option<bool> { self.column_line_dash }
173    /// The row gap highlight fill color (default: transparent).
174    pub fn row_gap_color(&self) -> Option<&crate::dom::RGBA> { self.row_gap_color.as_ref() }
175    /// The row gap hatching fill color (default: transparent).
176    pub fn row_hatch_color(&self) -> Option<&crate::dom::RGBA> { self.row_hatch_color.as_ref() }
177    /// The column gap highlight fill color (default: transparent).
178    pub fn column_gap_color(&self) -> Option<&crate::dom::RGBA> { self.column_gap_color.as_ref() }
179    /// The column gap hatching fill color (default: transparent).
180    pub fn column_hatch_color(&self) -> Option<&crate::dom::RGBA> { self.column_hatch_color.as_ref() }
181    /// The named grid areas border color (Default: transparent).
182    pub fn area_border_color(&self) -> Option<&crate::dom::RGBA> { self.area_border_color.as_ref() }
183    /// The grid container background color (Default: transparent).
184    pub fn grid_background_color(&self) -> Option<&crate::dom::RGBA> { self.grid_background_color.as_ref() }
185}
186
187#[derive(Default)]
188pub struct GridHighlightConfigBuilder {
189    show_grid_extension_lines: Option<bool>,
190    show_positive_line_numbers: Option<bool>,
191    show_negative_line_numbers: Option<bool>,
192    show_area_names: Option<bool>,
193    show_line_names: Option<bool>,
194    show_track_sizes: Option<bool>,
195    grid_border_color: Option<crate::dom::RGBA>,
196    cell_border_color: Option<crate::dom::RGBA>,
197    row_line_color: Option<crate::dom::RGBA>,
198    column_line_color: Option<crate::dom::RGBA>,
199    grid_border_dash: Option<bool>,
200    cell_border_dash: Option<bool>,
201    row_line_dash: Option<bool>,
202    column_line_dash: Option<bool>,
203    row_gap_color: Option<crate::dom::RGBA>,
204    row_hatch_color: Option<crate::dom::RGBA>,
205    column_gap_color: Option<crate::dom::RGBA>,
206    column_hatch_color: Option<crate::dom::RGBA>,
207    area_border_color: Option<crate::dom::RGBA>,
208    grid_background_color: Option<crate::dom::RGBA>,
209}
210
211impl GridHighlightConfigBuilder {
212    /// Whether the extension lines from grid cells to the rulers should be shown (default: false).
213    pub fn show_grid_extension_lines(mut self, show_grid_extension_lines: bool) -> Self { self.show_grid_extension_lines = Some(show_grid_extension_lines); self }
214    /// Show Positive line number labels (default: false).
215    pub fn show_positive_line_numbers(mut self, show_positive_line_numbers: bool) -> Self { self.show_positive_line_numbers = Some(show_positive_line_numbers); self }
216    /// Show Negative line number labels (default: false).
217    pub fn show_negative_line_numbers(mut self, show_negative_line_numbers: bool) -> Self { self.show_negative_line_numbers = Some(show_negative_line_numbers); self }
218    /// Show area name labels (default: false).
219    pub fn show_area_names(mut self, show_area_names: bool) -> Self { self.show_area_names = Some(show_area_names); self }
220    /// Show line name labels (default: false).
221    pub fn show_line_names(mut self, show_line_names: bool) -> Self { self.show_line_names = Some(show_line_names); self }
222    /// Show track size labels (default: false).
223    pub fn show_track_sizes(mut self, show_track_sizes: bool) -> Self { self.show_track_sizes = Some(show_track_sizes); self }
224    /// The grid container border highlight color (default: transparent).
225    pub fn grid_border_color(mut self, grid_border_color: crate::dom::RGBA) -> Self { self.grid_border_color = Some(grid_border_color); self }
226    /// The cell border color (default: transparent). Deprecated, please use rowLineColor and columnLineColor instead.
227    pub fn cell_border_color(mut self, cell_border_color: crate::dom::RGBA) -> Self { self.cell_border_color = Some(cell_border_color); self }
228    /// The row line color (default: transparent).
229    pub fn row_line_color(mut self, row_line_color: crate::dom::RGBA) -> Self { self.row_line_color = Some(row_line_color); self }
230    /// The column line color (default: transparent).
231    pub fn column_line_color(mut self, column_line_color: crate::dom::RGBA) -> Self { self.column_line_color = Some(column_line_color); self }
232    /// Whether the grid border is dashed (default: false).
233    pub fn grid_border_dash(mut self, grid_border_dash: bool) -> Self { self.grid_border_dash = Some(grid_border_dash); self }
234    /// Whether the cell border is dashed (default: false). Deprecated, please us rowLineDash and columnLineDash instead.
235    pub fn cell_border_dash(mut self, cell_border_dash: bool) -> Self { self.cell_border_dash = Some(cell_border_dash); self }
236    /// Whether row lines are dashed (default: false).
237    pub fn row_line_dash(mut self, row_line_dash: bool) -> Self { self.row_line_dash = Some(row_line_dash); self }
238    /// Whether column lines are dashed (default: false).
239    pub fn column_line_dash(mut self, column_line_dash: bool) -> Self { self.column_line_dash = Some(column_line_dash); self }
240    /// The row gap highlight fill color (default: transparent).
241    pub fn row_gap_color(mut self, row_gap_color: crate::dom::RGBA) -> Self { self.row_gap_color = Some(row_gap_color); self }
242    /// The row gap hatching fill color (default: transparent).
243    pub fn row_hatch_color(mut self, row_hatch_color: crate::dom::RGBA) -> Self { self.row_hatch_color = Some(row_hatch_color); self }
244    /// The column gap highlight fill color (default: transparent).
245    pub fn column_gap_color(mut self, column_gap_color: crate::dom::RGBA) -> Self { self.column_gap_color = Some(column_gap_color); self }
246    /// The column gap hatching fill color (default: transparent).
247    pub fn column_hatch_color(mut self, column_hatch_color: crate::dom::RGBA) -> Self { self.column_hatch_color = Some(column_hatch_color); self }
248    /// The named grid areas border color (Default: transparent).
249    pub fn area_border_color(mut self, area_border_color: crate::dom::RGBA) -> Self { self.area_border_color = Some(area_border_color); self }
250    /// The grid container background color (Default: transparent).
251    pub fn grid_background_color(mut self, grid_background_color: crate::dom::RGBA) -> Self { self.grid_background_color = Some(grid_background_color); self }
252    pub fn build(self) -> GridHighlightConfig {
253        GridHighlightConfig {
254            show_grid_extension_lines: self.show_grid_extension_lines,
255            show_positive_line_numbers: self.show_positive_line_numbers,
256            show_negative_line_numbers: self.show_negative_line_numbers,
257            show_area_names: self.show_area_names,
258            show_line_names: self.show_line_names,
259            show_track_sizes: self.show_track_sizes,
260            grid_border_color: self.grid_border_color,
261            cell_border_color: self.cell_border_color,
262            row_line_color: self.row_line_color,
263            column_line_color: self.column_line_color,
264            grid_border_dash: self.grid_border_dash,
265            cell_border_dash: self.cell_border_dash,
266            row_line_dash: self.row_line_dash,
267            column_line_dash: self.column_line_dash,
268            row_gap_color: self.row_gap_color,
269            row_hatch_color: self.row_hatch_color,
270            column_gap_color: self.column_gap_color,
271            column_hatch_color: self.column_hatch_color,
272            area_border_color: self.area_border_color,
273            grid_background_color: self.grid_background_color,
274        }
275    }
276}
277
278/// Configuration data for the highlighting of Flex container elements.
279
280#[derive(Debug, Clone, Serialize, Deserialize, Default)]
281#[serde(rename_all = "camelCase")]
282pub struct FlexContainerHighlightConfig<'a> {
283    /// The style of the container border
284    #[serde(skip_serializing_if = "Option::is_none", rename = "containerBorder")]
285    container_border: Option<LineStyle<'a>>,
286    /// The style of the separator between lines
287    #[serde(skip_serializing_if = "Option::is_none", rename = "lineSeparator")]
288    line_separator: Option<LineStyle<'a>>,
289    /// The style of the separator between items
290    #[serde(skip_serializing_if = "Option::is_none", rename = "itemSeparator")]
291    item_separator: Option<LineStyle<'a>>,
292    /// Style of content-distribution space on the main axis (justify-content).
293    #[serde(skip_serializing_if = "Option::is_none", rename = "mainDistributedSpace")]
294    main_distributed_space: Option<BoxStyle>,
295    /// Style of content-distribution space on the cross axis (align-content).
296    #[serde(skip_serializing_if = "Option::is_none", rename = "crossDistributedSpace")]
297    cross_distributed_space: Option<BoxStyle>,
298    /// Style of empty space caused by row gaps (gap/row-gap).
299    #[serde(skip_serializing_if = "Option::is_none", rename = "rowGapSpace")]
300    row_gap_space: Option<BoxStyle>,
301    /// Style of empty space caused by columns gaps (gap/column-gap).
302    #[serde(skip_serializing_if = "Option::is_none", rename = "columnGapSpace")]
303    column_gap_space: Option<BoxStyle>,
304    /// Style of the self-alignment line (align-items).
305    #[serde(skip_serializing_if = "Option::is_none", rename = "crossAlignment")]
306    cross_alignment: Option<LineStyle<'a>>,
307}
308
309impl<'a> FlexContainerHighlightConfig<'a> {
310    /// Creates a builder for this type.
311    pub fn builder() -> FlexContainerHighlightConfigBuilder<'a> {
312        FlexContainerHighlightConfigBuilder {
313            container_border: None,
314            line_separator: None,
315            item_separator: None,
316            main_distributed_space: None,
317            cross_distributed_space: None,
318            row_gap_space: None,
319            column_gap_space: None,
320            cross_alignment: None,
321        }
322    }
323    /// The style of the container border
324    pub fn container_border(&self) -> Option<&LineStyle<'a>> { self.container_border.as_ref() }
325    /// The style of the separator between lines
326    pub fn line_separator(&self) -> Option<&LineStyle<'a>> { self.line_separator.as_ref() }
327    /// The style of the separator between items
328    pub fn item_separator(&self) -> Option<&LineStyle<'a>> { self.item_separator.as_ref() }
329    /// Style of content-distribution space on the main axis (justify-content).
330    pub fn main_distributed_space(&self) -> Option<&BoxStyle> { self.main_distributed_space.as_ref() }
331    /// Style of content-distribution space on the cross axis (align-content).
332    pub fn cross_distributed_space(&self) -> Option<&BoxStyle> { self.cross_distributed_space.as_ref() }
333    /// Style of empty space caused by row gaps (gap/row-gap).
334    pub fn row_gap_space(&self) -> Option<&BoxStyle> { self.row_gap_space.as_ref() }
335    /// Style of empty space caused by columns gaps (gap/column-gap).
336    pub fn column_gap_space(&self) -> Option<&BoxStyle> { self.column_gap_space.as_ref() }
337    /// Style of the self-alignment line (align-items).
338    pub fn cross_alignment(&self) -> Option<&LineStyle<'a>> { self.cross_alignment.as_ref() }
339}
340
341#[derive(Default)]
342pub struct FlexContainerHighlightConfigBuilder<'a> {
343    container_border: Option<LineStyle<'a>>,
344    line_separator: Option<LineStyle<'a>>,
345    item_separator: Option<LineStyle<'a>>,
346    main_distributed_space: Option<BoxStyle>,
347    cross_distributed_space: Option<BoxStyle>,
348    row_gap_space: Option<BoxStyle>,
349    column_gap_space: Option<BoxStyle>,
350    cross_alignment: Option<LineStyle<'a>>,
351}
352
353impl<'a> FlexContainerHighlightConfigBuilder<'a> {
354    /// The style of the container border
355    pub fn container_border(mut self, container_border: LineStyle<'a>) -> Self { self.container_border = Some(container_border); self }
356    /// The style of the separator between lines
357    pub fn line_separator(mut self, line_separator: LineStyle<'a>) -> Self { self.line_separator = Some(line_separator); self }
358    /// The style of the separator between items
359    pub fn item_separator(mut self, item_separator: LineStyle<'a>) -> Self { self.item_separator = Some(item_separator); self }
360    /// Style of content-distribution space on the main axis (justify-content).
361    pub fn main_distributed_space(mut self, main_distributed_space: BoxStyle) -> Self { self.main_distributed_space = Some(main_distributed_space); self }
362    /// Style of content-distribution space on the cross axis (align-content).
363    pub fn cross_distributed_space(mut self, cross_distributed_space: BoxStyle) -> Self { self.cross_distributed_space = Some(cross_distributed_space); self }
364    /// Style of empty space caused by row gaps (gap/row-gap).
365    pub fn row_gap_space(mut self, row_gap_space: BoxStyle) -> Self { self.row_gap_space = Some(row_gap_space); self }
366    /// Style of empty space caused by columns gaps (gap/column-gap).
367    pub fn column_gap_space(mut self, column_gap_space: BoxStyle) -> Self { self.column_gap_space = Some(column_gap_space); self }
368    /// Style of the self-alignment line (align-items).
369    pub fn cross_alignment(mut self, cross_alignment: LineStyle<'a>) -> Self { self.cross_alignment = Some(cross_alignment); self }
370    pub fn build(self) -> FlexContainerHighlightConfig<'a> {
371        FlexContainerHighlightConfig {
372            container_border: self.container_border,
373            line_separator: self.line_separator,
374            item_separator: self.item_separator,
375            main_distributed_space: self.main_distributed_space,
376            cross_distributed_space: self.cross_distributed_space,
377            row_gap_space: self.row_gap_space,
378            column_gap_space: self.column_gap_space,
379            cross_alignment: self.cross_alignment,
380        }
381    }
382}
383
384/// Configuration data for the highlighting of Flex item elements.
385
386#[derive(Debug, Clone, Serialize, Deserialize, Default)]
387#[serde(rename_all = "camelCase")]
388pub struct FlexItemHighlightConfig<'a> {
389    /// Style of the box representing the item's base size
390    #[serde(skip_serializing_if = "Option::is_none", rename = "baseSizeBox")]
391    base_size_box: Option<BoxStyle>,
392    /// Style of the border around the box representing the item's base size
393    #[serde(skip_serializing_if = "Option::is_none", rename = "baseSizeBorder")]
394    base_size_border: Option<LineStyle<'a>>,
395    /// Style of the arrow representing if the item grew or shrank
396    #[serde(skip_serializing_if = "Option::is_none", rename = "flexibilityArrow")]
397    flexibility_arrow: Option<LineStyle<'a>>,
398}
399
400impl<'a> FlexItemHighlightConfig<'a> {
401    /// Creates a builder for this type.
402    pub fn builder() -> FlexItemHighlightConfigBuilder<'a> {
403        FlexItemHighlightConfigBuilder {
404            base_size_box: None,
405            base_size_border: None,
406            flexibility_arrow: None,
407        }
408    }
409    /// Style of the box representing the item's base size
410    pub fn base_size_box(&self) -> Option<&BoxStyle> { self.base_size_box.as_ref() }
411    /// Style of the border around the box representing the item's base size
412    pub fn base_size_border(&self) -> Option<&LineStyle<'a>> { self.base_size_border.as_ref() }
413    /// Style of the arrow representing if the item grew or shrank
414    pub fn flexibility_arrow(&self) -> Option<&LineStyle<'a>> { self.flexibility_arrow.as_ref() }
415}
416
417#[derive(Default)]
418pub struct FlexItemHighlightConfigBuilder<'a> {
419    base_size_box: Option<BoxStyle>,
420    base_size_border: Option<LineStyle<'a>>,
421    flexibility_arrow: Option<LineStyle<'a>>,
422}
423
424impl<'a> FlexItemHighlightConfigBuilder<'a> {
425    /// Style of the box representing the item's base size
426    pub fn base_size_box(mut self, base_size_box: BoxStyle) -> Self { self.base_size_box = Some(base_size_box); self }
427    /// Style of the border around the box representing the item's base size
428    pub fn base_size_border(mut self, base_size_border: LineStyle<'a>) -> Self { self.base_size_border = Some(base_size_border); self }
429    /// Style of the arrow representing if the item grew or shrank
430    pub fn flexibility_arrow(mut self, flexibility_arrow: LineStyle<'a>) -> Self { self.flexibility_arrow = Some(flexibility_arrow); self }
431    pub fn build(self) -> FlexItemHighlightConfig<'a> {
432        FlexItemHighlightConfig {
433            base_size_box: self.base_size_box,
434            base_size_border: self.base_size_border,
435            flexibility_arrow: self.flexibility_arrow,
436        }
437    }
438}
439
440/// Style information for drawing a line.
441
442#[derive(Debug, Clone, Serialize, Deserialize, Default)]
443#[serde(rename_all = "camelCase")]
444pub struct LineStyle<'a> {
445    /// The color of the line (default: transparent)
446    #[serde(skip_serializing_if = "Option::is_none")]
447    color: Option<crate::dom::RGBA>,
448    /// The line pattern (default: solid)
449    #[serde(skip_serializing_if = "Option::is_none")]
450    pattern: Option<Cow<'a, str>>,
451}
452
453impl<'a> LineStyle<'a> {
454    /// Creates a builder for this type.
455    pub fn builder() -> LineStyleBuilder<'a> {
456        LineStyleBuilder {
457            color: None,
458            pattern: None,
459        }
460    }
461    /// The color of the line (default: transparent)
462    pub fn color(&self) -> Option<&crate::dom::RGBA> { self.color.as_ref() }
463    /// The line pattern (default: solid)
464    pub fn pattern(&self) -> Option<&str> { self.pattern.as_deref() }
465}
466
467#[derive(Default)]
468pub struct LineStyleBuilder<'a> {
469    color: Option<crate::dom::RGBA>,
470    pattern: Option<Cow<'a, str>>,
471}
472
473impl<'a> LineStyleBuilder<'a> {
474    /// The color of the line (default: transparent)
475    pub fn color(mut self, color: crate::dom::RGBA) -> Self { self.color = Some(color); self }
476    /// The line pattern (default: solid)
477    pub fn pattern(mut self, pattern: impl Into<Cow<'a, str>>) -> Self { self.pattern = Some(pattern.into()); self }
478    pub fn build(self) -> LineStyle<'a> {
479        LineStyle {
480            color: self.color,
481            pattern: self.pattern,
482        }
483    }
484}
485
486/// Style information for drawing a box.
487
488#[derive(Debug, Clone, Serialize, Deserialize, Default)]
489#[serde(rename_all = "camelCase")]
490pub struct BoxStyle {
491    /// The background color for the box (default: transparent)
492    #[serde(skip_serializing_if = "Option::is_none", rename = "fillColor")]
493    fill_color: Option<crate::dom::RGBA>,
494    /// The hatching color for the box (default: transparent)
495    #[serde(skip_serializing_if = "Option::is_none", rename = "hatchColor")]
496    hatch_color: Option<crate::dom::RGBA>,
497}
498
499impl BoxStyle {
500    /// Creates a builder for this type.
501    pub fn builder() -> BoxStyleBuilder {
502        BoxStyleBuilder {
503            fill_color: None,
504            hatch_color: None,
505        }
506    }
507    /// The background color for the box (default: transparent)
508    pub fn fill_color(&self) -> Option<&crate::dom::RGBA> { self.fill_color.as_ref() }
509    /// The hatching color for the box (default: transparent)
510    pub fn hatch_color(&self) -> Option<&crate::dom::RGBA> { self.hatch_color.as_ref() }
511}
512
513#[derive(Default)]
514pub struct BoxStyleBuilder {
515    fill_color: Option<crate::dom::RGBA>,
516    hatch_color: Option<crate::dom::RGBA>,
517}
518
519impl BoxStyleBuilder {
520    /// The background color for the box (default: transparent)
521    pub fn fill_color(mut self, fill_color: crate::dom::RGBA) -> Self { self.fill_color = Some(fill_color); self }
522    /// The hatching color for the box (default: transparent)
523    pub fn hatch_color(mut self, hatch_color: crate::dom::RGBA) -> Self { self.hatch_color = Some(hatch_color); self }
524    pub fn build(self) -> BoxStyle {
525        BoxStyle {
526            fill_color: self.fill_color,
527            hatch_color: self.hatch_color,
528        }
529    }
530}
531
532
533#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
534pub enum ContrastAlgorithm {
535    #[default]
536    #[serde(rename = "aa")]
537    Aa,
538    #[serde(rename = "aaa")]
539    Aaa,
540    #[serde(rename = "apca")]
541    Apca,
542}
543
544/// Configuration data for the highlighting of page elements.
545
546#[derive(Debug, Clone, Serialize, Deserialize, Default)]
547#[serde(rename_all = "camelCase")]
548pub struct HighlightConfig<'a> {
549    /// Whether the node info tooltip should be shown (default: false).
550    #[serde(skip_serializing_if = "Option::is_none", rename = "showInfo")]
551    show_info: Option<bool>,
552    /// Whether the node styles in the tooltip (default: false).
553    #[serde(skip_serializing_if = "Option::is_none", rename = "showStyles")]
554    show_styles: Option<bool>,
555    /// Whether the rulers should be shown (default: false).
556    #[serde(skip_serializing_if = "Option::is_none", rename = "showRulers")]
557    show_rulers: Option<bool>,
558    /// Whether the a11y info should be shown (default: true).
559    #[serde(skip_serializing_if = "Option::is_none", rename = "showAccessibilityInfo")]
560    show_accessibility_info: Option<bool>,
561    /// Whether the extension lines from node to the rulers should be shown (default: false).
562    #[serde(skip_serializing_if = "Option::is_none", rename = "showExtensionLines")]
563    show_extension_lines: Option<bool>,
564    /// The content box highlight fill color (default: transparent).
565    #[serde(skip_serializing_if = "Option::is_none", rename = "contentColor")]
566    content_color: Option<crate::dom::RGBA>,
567    /// The padding highlight fill color (default: transparent).
568    #[serde(skip_serializing_if = "Option::is_none", rename = "paddingColor")]
569    padding_color: Option<crate::dom::RGBA>,
570    /// The border highlight fill color (default: transparent).
571    #[serde(skip_serializing_if = "Option::is_none", rename = "borderColor")]
572    border_color: Option<crate::dom::RGBA>,
573    /// The margin highlight fill color (default: transparent).
574    #[serde(skip_serializing_if = "Option::is_none", rename = "marginColor")]
575    margin_color: Option<crate::dom::RGBA>,
576    /// The event target element highlight fill color (default: transparent).
577    #[serde(skip_serializing_if = "Option::is_none", rename = "eventTargetColor")]
578    event_target_color: Option<crate::dom::RGBA>,
579    /// The shape outside fill color (default: transparent).
580    #[serde(skip_serializing_if = "Option::is_none", rename = "shapeColor")]
581    shape_color: Option<crate::dom::RGBA>,
582    /// The shape margin fill color (default: transparent).
583    #[serde(skip_serializing_if = "Option::is_none", rename = "shapeMarginColor")]
584    shape_margin_color: Option<crate::dom::RGBA>,
585    /// The grid layout color (default: transparent).
586    #[serde(skip_serializing_if = "Option::is_none", rename = "cssGridColor")]
587    css_grid_color: Option<crate::dom::RGBA>,
588    /// The color format used to format color styles (default: hex).
589    #[serde(skip_serializing_if = "Option::is_none", rename = "colorFormat")]
590    color_format: Option<ColorFormat>,
591    /// The grid layout highlight configuration (default: all transparent).
592    #[serde(skip_serializing_if = "Option::is_none", rename = "gridHighlightConfig")]
593    grid_highlight_config: Option<GridHighlightConfig>,
594    /// The flex container highlight configuration (default: all transparent).
595    #[serde(skip_serializing_if = "Option::is_none", rename = "flexContainerHighlightConfig")]
596    flex_container_highlight_config: Option<FlexContainerHighlightConfig<'a>>,
597    /// The flex item highlight configuration (default: all transparent).
598    #[serde(skip_serializing_if = "Option::is_none", rename = "flexItemHighlightConfig")]
599    flex_item_highlight_config: Option<FlexItemHighlightConfig<'a>>,
600    /// The contrast algorithm to use for the contrast ratio (default: aa).
601    #[serde(skip_serializing_if = "Option::is_none", rename = "contrastAlgorithm")]
602    contrast_algorithm: Option<ContrastAlgorithm>,
603    /// The container query container highlight configuration (default: all transparent).
604    #[serde(skip_serializing_if = "Option::is_none", rename = "containerQueryContainerHighlightConfig")]
605    container_query_container_highlight_config: Option<ContainerQueryContainerHighlightConfig<'a>>,
606}
607
608impl<'a> HighlightConfig<'a> {
609    /// Creates a builder for this type.
610    pub fn builder() -> HighlightConfigBuilder<'a> {
611        HighlightConfigBuilder {
612            show_info: None,
613            show_styles: None,
614            show_rulers: None,
615            show_accessibility_info: None,
616            show_extension_lines: None,
617            content_color: None,
618            padding_color: None,
619            border_color: None,
620            margin_color: None,
621            event_target_color: None,
622            shape_color: None,
623            shape_margin_color: None,
624            css_grid_color: None,
625            color_format: None,
626            grid_highlight_config: None,
627            flex_container_highlight_config: None,
628            flex_item_highlight_config: None,
629            contrast_algorithm: None,
630            container_query_container_highlight_config: None,
631        }
632    }
633    /// Whether the node info tooltip should be shown (default: false).
634    pub fn show_info(&self) -> Option<bool> { self.show_info }
635    /// Whether the node styles in the tooltip (default: false).
636    pub fn show_styles(&self) -> Option<bool> { self.show_styles }
637    /// Whether the rulers should be shown (default: false).
638    pub fn show_rulers(&self) -> Option<bool> { self.show_rulers }
639    /// Whether the a11y info should be shown (default: true).
640    pub fn show_accessibility_info(&self) -> Option<bool> { self.show_accessibility_info }
641    /// Whether the extension lines from node to the rulers should be shown (default: false).
642    pub fn show_extension_lines(&self) -> Option<bool> { self.show_extension_lines }
643    /// The content box highlight fill color (default: transparent).
644    pub fn content_color(&self) -> Option<&crate::dom::RGBA> { self.content_color.as_ref() }
645    /// The padding highlight fill color (default: transparent).
646    pub fn padding_color(&self) -> Option<&crate::dom::RGBA> { self.padding_color.as_ref() }
647    /// The border highlight fill color (default: transparent).
648    pub fn border_color(&self) -> Option<&crate::dom::RGBA> { self.border_color.as_ref() }
649    /// The margin highlight fill color (default: transparent).
650    pub fn margin_color(&self) -> Option<&crate::dom::RGBA> { self.margin_color.as_ref() }
651    /// The event target element highlight fill color (default: transparent).
652    pub fn event_target_color(&self) -> Option<&crate::dom::RGBA> { self.event_target_color.as_ref() }
653    /// The shape outside fill color (default: transparent).
654    pub fn shape_color(&self) -> Option<&crate::dom::RGBA> { self.shape_color.as_ref() }
655    /// The shape margin fill color (default: transparent).
656    pub fn shape_margin_color(&self) -> Option<&crate::dom::RGBA> { self.shape_margin_color.as_ref() }
657    /// The grid layout color (default: transparent).
658    pub fn css_grid_color(&self) -> Option<&crate::dom::RGBA> { self.css_grid_color.as_ref() }
659    /// The color format used to format color styles (default: hex).
660    pub fn color_format(&self) -> Option<&ColorFormat> { self.color_format.as_ref() }
661    /// The grid layout highlight configuration (default: all transparent).
662    pub fn grid_highlight_config(&self) -> Option<&GridHighlightConfig> { self.grid_highlight_config.as_ref() }
663    /// The flex container highlight configuration (default: all transparent).
664    pub fn flex_container_highlight_config(&self) -> Option<&FlexContainerHighlightConfig<'a>> { self.flex_container_highlight_config.as_ref() }
665    /// The flex item highlight configuration (default: all transparent).
666    pub fn flex_item_highlight_config(&self) -> Option<&FlexItemHighlightConfig<'a>> { self.flex_item_highlight_config.as_ref() }
667    /// The contrast algorithm to use for the contrast ratio (default: aa).
668    pub fn contrast_algorithm(&self) -> Option<&ContrastAlgorithm> { self.contrast_algorithm.as_ref() }
669    /// The container query container highlight configuration (default: all transparent).
670    pub fn container_query_container_highlight_config(&self) -> Option<&ContainerQueryContainerHighlightConfig<'a>> { self.container_query_container_highlight_config.as_ref() }
671}
672
673#[derive(Default)]
674pub struct HighlightConfigBuilder<'a> {
675    show_info: Option<bool>,
676    show_styles: Option<bool>,
677    show_rulers: Option<bool>,
678    show_accessibility_info: Option<bool>,
679    show_extension_lines: Option<bool>,
680    content_color: Option<crate::dom::RGBA>,
681    padding_color: Option<crate::dom::RGBA>,
682    border_color: Option<crate::dom::RGBA>,
683    margin_color: Option<crate::dom::RGBA>,
684    event_target_color: Option<crate::dom::RGBA>,
685    shape_color: Option<crate::dom::RGBA>,
686    shape_margin_color: Option<crate::dom::RGBA>,
687    css_grid_color: Option<crate::dom::RGBA>,
688    color_format: Option<ColorFormat>,
689    grid_highlight_config: Option<GridHighlightConfig>,
690    flex_container_highlight_config: Option<FlexContainerHighlightConfig<'a>>,
691    flex_item_highlight_config: Option<FlexItemHighlightConfig<'a>>,
692    contrast_algorithm: Option<ContrastAlgorithm>,
693    container_query_container_highlight_config: Option<ContainerQueryContainerHighlightConfig<'a>>,
694}
695
696impl<'a> HighlightConfigBuilder<'a> {
697    /// Whether the node info tooltip should be shown (default: false).
698    pub fn show_info(mut self, show_info: bool) -> Self { self.show_info = Some(show_info); self }
699    /// Whether the node styles in the tooltip (default: false).
700    pub fn show_styles(mut self, show_styles: bool) -> Self { self.show_styles = Some(show_styles); self }
701    /// Whether the rulers should be shown (default: false).
702    pub fn show_rulers(mut self, show_rulers: bool) -> Self { self.show_rulers = Some(show_rulers); self }
703    /// Whether the a11y info should be shown (default: true).
704    pub fn show_accessibility_info(mut self, show_accessibility_info: bool) -> Self { self.show_accessibility_info = Some(show_accessibility_info); self }
705    /// Whether the extension lines from node to the rulers should be shown (default: false).
706    pub fn show_extension_lines(mut self, show_extension_lines: bool) -> Self { self.show_extension_lines = Some(show_extension_lines); self }
707    /// The content box highlight fill color (default: transparent).
708    pub fn content_color(mut self, content_color: crate::dom::RGBA) -> Self { self.content_color = Some(content_color); self }
709    /// The padding highlight fill color (default: transparent).
710    pub fn padding_color(mut self, padding_color: crate::dom::RGBA) -> Self { self.padding_color = Some(padding_color); self }
711    /// The border highlight fill color (default: transparent).
712    pub fn border_color(mut self, border_color: crate::dom::RGBA) -> Self { self.border_color = Some(border_color); self }
713    /// The margin highlight fill color (default: transparent).
714    pub fn margin_color(mut self, margin_color: crate::dom::RGBA) -> Self { self.margin_color = Some(margin_color); self }
715    /// The event target element highlight fill color (default: transparent).
716    pub fn event_target_color(mut self, event_target_color: crate::dom::RGBA) -> Self { self.event_target_color = Some(event_target_color); self }
717    /// The shape outside fill color (default: transparent).
718    pub fn shape_color(mut self, shape_color: crate::dom::RGBA) -> Self { self.shape_color = Some(shape_color); self }
719    /// The shape margin fill color (default: transparent).
720    pub fn shape_margin_color(mut self, shape_margin_color: crate::dom::RGBA) -> Self { self.shape_margin_color = Some(shape_margin_color); self }
721    /// The grid layout color (default: transparent).
722    pub fn css_grid_color(mut self, css_grid_color: crate::dom::RGBA) -> Self { self.css_grid_color = Some(css_grid_color); self }
723    /// The color format used to format color styles (default: hex).
724    pub fn color_format(mut self, color_format: impl Into<ColorFormat>) -> Self { self.color_format = Some(color_format.into()); self }
725    /// The grid layout highlight configuration (default: all transparent).
726    pub fn grid_highlight_config(mut self, grid_highlight_config: GridHighlightConfig) -> Self { self.grid_highlight_config = Some(grid_highlight_config); self }
727    /// The flex container highlight configuration (default: all transparent).
728    pub fn flex_container_highlight_config(mut self, flex_container_highlight_config: FlexContainerHighlightConfig<'a>) -> Self { self.flex_container_highlight_config = Some(flex_container_highlight_config); self }
729    /// The flex item highlight configuration (default: all transparent).
730    pub fn flex_item_highlight_config(mut self, flex_item_highlight_config: FlexItemHighlightConfig<'a>) -> Self { self.flex_item_highlight_config = Some(flex_item_highlight_config); self }
731    /// The contrast algorithm to use for the contrast ratio (default: aa).
732    pub fn contrast_algorithm(mut self, contrast_algorithm: impl Into<ContrastAlgorithm>) -> Self { self.contrast_algorithm = Some(contrast_algorithm.into()); self }
733    /// The container query container highlight configuration (default: all transparent).
734    pub fn container_query_container_highlight_config(mut self, container_query_container_highlight_config: ContainerQueryContainerHighlightConfig<'a>) -> Self { self.container_query_container_highlight_config = Some(container_query_container_highlight_config); self }
735    pub fn build(self) -> HighlightConfig<'a> {
736        HighlightConfig {
737            show_info: self.show_info,
738            show_styles: self.show_styles,
739            show_rulers: self.show_rulers,
740            show_accessibility_info: self.show_accessibility_info,
741            show_extension_lines: self.show_extension_lines,
742            content_color: self.content_color,
743            padding_color: self.padding_color,
744            border_color: self.border_color,
745            margin_color: self.margin_color,
746            event_target_color: self.event_target_color,
747            shape_color: self.shape_color,
748            shape_margin_color: self.shape_margin_color,
749            css_grid_color: self.css_grid_color,
750            color_format: self.color_format,
751            grid_highlight_config: self.grid_highlight_config,
752            flex_container_highlight_config: self.flex_container_highlight_config,
753            flex_item_highlight_config: self.flex_item_highlight_config,
754            contrast_algorithm: self.contrast_algorithm,
755            container_query_container_highlight_config: self.container_query_container_highlight_config,
756        }
757    }
758}
759
760
761#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
762pub enum ColorFormat {
763    #[default]
764    #[serde(rename = "rgb")]
765    Rgb,
766    #[serde(rename = "hsl")]
767    Hsl,
768    #[serde(rename = "hwb")]
769    Hwb,
770    #[serde(rename = "hex")]
771    Hex,
772}
773
774/// Configurations for Persistent Grid Highlight
775
776#[derive(Debug, Clone, Serialize, Deserialize, Default)]
777#[serde(rename_all = "camelCase")]
778pub struct GridNodeHighlightConfig {
779    /// A descriptor for the highlight appearance.
780    #[serde(rename = "gridHighlightConfig")]
781    grid_highlight_config: GridHighlightConfig,
782    /// Identifier of the node to highlight.
783    #[serde(rename = "nodeId")]
784    node_id: crate::dom::NodeId,
785}
786
787impl GridNodeHighlightConfig {
788    /// Creates a builder for this type with the required parameters:
789    /// * `grid_highlight_config`: A descriptor for the highlight appearance.
790    /// * `node_id`: Identifier of the node to highlight.
791    pub fn builder(grid_highlight_config: GridHighlightConfig, node_id: crate::dom::NodeId) -> GridNodeHighlightConfigBuilder {
792        GridNodeHighlightConfigBuilder {
793            grid_highlight_config: grid_highlight_config,
794            node_id: node_id,
795        }
796    }
797    /// A descriptor for the highlight appearance.
798    pub fn grid_highlight_config(&self) -> &GridHighlightConfig { &self.grid_highlight_config }
799    /// Identifier of the node to highlight.
800    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
801}
802
803
804pub struct GridNodeHighlightConfigBuilder {
805    grid_highlight_config: GridHighlightConfig,
806    node_id: crate::dom::NodeId,
807}
808
809impl GridNodeHighlightConfigBuilder {
810    pub fn build(self) -> GridNodeHighlightConfig {
811        GridNodeHighlightConfig {
812            grid_highlight_config: self.grid_highlight_config,
813            node_id: self.node_id,
814        }
815    }
816}
817
818
819#[derive(Debug, Clone, Serialize, Deserialize, Default)]
820#[serde(rename_all = "camelCase")]
821pub struct FlexNodeHighlightConfig<'a> {
822    /// A descriptor for the highlight appearance of flex containers.
823    #[serde(rename = "flexContainerHighlightConfig")]
824    flex_container_highlight_config: FlexContainerHighlightConfig<'a>,
825    /// Identifier of the node to highlight.
826    #[serde(rename = "nodeId")]
827    node_id: crate::dom::NodeId,
828}
829
830impl<'a> FlexNodeHighlightConfig<'a> {
831    /// Creates a builder for this type with the required parameters:
832    /// * `flex_container_highlight_config`: A descriptor for the highlight appearance of flex containers.
833    /// * `node_id`: Identifier of the node to highlight.
834    pub fn builder(flex_container_highlight_config: FlexContainerHighlightConfig<'a>, node_id: crate::dom::NodeId) -> FlexNodeHighlightConfigBuilder<'a> {
835        FlexNodeHighlightConfigBuilder {
836            flex_container_highlight_config: flex_container_highlight_config,
837            node_id: node_id,
838        }
839    }
840    /// A descriptor for the highlight appearance of flex containers.
841    pub fn flex_container_highlight_config(&self) -> &FlexContainerHighlightConfig<'a> { &self.flex_container_highlight_config }
842    /// Identifier of the node to highlight.
843    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
844}
845
846
847pub struct FlexNodeHighlightConfigBuilder<'a> {
848    flex_container_highlight_config: FlexContainerHighlightConfig<'a>,
849    node_id: crate::dom::NodeId,
850}
851
852impl<'a> FlexNodeHighlightConfigBuilder<'a> {
853    pub fn build(self) -> FlexNodeHighlightConfig<'a> {
854        FlexNodeHighlightConfig {
855            flex_container_highlight_config: self.flex_container_highlight_config,
856            node_id: self.node_id,
857        }
858    }
859}
860
861
862#[derive(Debug, Clone, Serialize, Deserialize, Default)]
863#[serde(rename_all = "camelCase")]
864pub struct ScrollSnapContainerHighlightConfig<'a> {
865    /// The style of the snapport border (default: transparent)
866    #[serde(skip_serializing_if = "Option::is_none", rename = "snapportBorder")]
867    snapport_border: Option<LineStyle<'a>>,
868    /// The style of the snap area border (default: transparent)
869    #[serde(skip_serializing_if = "Option::is_none", rename = "snapAreaBorder")]
870    snap_area_border: Option<LineStyle<'a>>,
871    /// The margin highlight fill color (default: transparent).
872    #[serde(skip_serializing_if = "Option::is_none", rename = "scrollMarginColor")]
873    scroll_margin_color: Option<crate::dom::RGBA>,
874    /// The padding highlight fill color (default: transparent).
875    #[serde(skip_serializing_if = "Option::is_none", rename = "scrollPaddingColor")]
876    scroll_padding_color: Option<crate::dom::RGBA>,
877}
878
879impl<'a> ScrollSnapContainerHighlightConfig<'a> {
880    /// Creates a builder for this type.
881    pub fn builder() -> ScrollSnapContainerHighlightConfigBuilder<'a> {
882        ScrollSnapContainerHighlightConfigBuilder {
883            snapport_border: None,
884            snap_area_border: None,
885            scroll_margin_color: None,
886            scroll_padding_color: None,
887        }
888    }
889    /// The style of the snapport border (default: transparent)
890    pub fn snapport_border(&self) -> Option<&LineStyle<'a>> { self.snapport_border.as_ref() }
891    /// The style of the snap area border (default: transparent)
892    pub fn snap_area_border(&self) -> Option<&LineStyle<'a>> { self.snap_area_border.as_ref() }
893    /// The margin highlight fill color (default: transparent).
894    pub fn scroll_margin_color(&self) -> Option<&crate::dom::RGBA> { self.scroll_margin_color.as_ref() }
895    /// The padding highlight fill color (default: transparent).
896    pub fn scroll_padding_color(&self) -> Option<&crate::dom::RGBA> { self.scroll_padding_color.as_ref() }
897}
898
899#[derive(Default)]
900pub struct ScrollSnapContainerHighlightConfigBuilder<'a> {
901    snapport_border: Option<LineStyle<'a>>,
902    snap_area_border: Option<LineStyle<'a>>,
903    scroll_margin_color: Option<crate::dom::RGBA>,
904    scroll_padding_color: Option<crate::dom::RGBA>,
905}
906
907impl<'a> ScrollSnapContainerHighlightConfigBuilder<'a> {
908    /// The style of the snapport border (default: transparent)
909    pub fn snapport_border(mut self, snapport_border: LineStyle<'a>) -> Self { self.snapport_border = Some(snapport_border); self }
910    /// The style of the snap area border (default: transparent)
911    pub fn snap_area_border(mut self, snap_area_border: LineStyle<'a>) -> Self { self.snap_area_border = Some(snap_area_border); self }
912    /// The margin highlight fill color (default: transparent).
913    pub fn scroll_margin_color(mut self, scroll_margin_color: crate::dom::RGBA) -> Self { self.scroll_margin_color = Some(scroll_margin_color); self }
914    /// The padding highlight fill color (default: transparent).
915    pub fn scroll_padding_color(mut self, scroll_padding_color: crate::dom::RGBA) -> Self { self.scroll_padding_color = Some(scroll_padding_color); self }
916    pub fn build(self) -> ScrollSnapContainerHighlightConfig<'a> {
917        ScrollSnapContainerHighlightConfig {
918            snapport_border: self.snapport_border,
919            snap_area_border: self.snap_area_border,
920            scroll_margin_color: self.scroll_margin_color,
921            scroll_padding_color: self.scroll_padding_color,
922        }
923    }
924}
925
926
927#[derive(Debug, Clone, Serialize, Deserialize, Default)]
928#[serde(rename_all = "camelCase")]
929pub struct ScrollSnapHighlightConfig<'a> {
930    /// A descriptor for the highlight appearance of scroll snap containers.
931    #[serde(rename = "scrollSnapContainerHighlightConfig")]
932    scroll_snap_container_highlight_config: ScrollSnapContainerHighlightConfig<'a>,
933    /// Identifier of the node to highlight.
934    #[serde(rename = "nodeId")]
935    node_id: crate::dom::NodeId,
936}
937
938impl<'a> ScrollSnapHighlightConfig<'a> {
939    /// Creates a builder for this type with the required parameters:
940    /// * `scroll_snap_container_highlight_config`: A descriptor for the highlight appearance of scroll snap containers.
941    /// * `node_id`: Identifier of the node to highlight.
942    pub fn builder(scroll_snap_container_highlight_config: ScrollSnapContainerHighlightConfig<'a>, node_id: crate::dom::NodeId) -> ScrollSnapHighlightConfigBuilder<'a> {
943        ScrollSnapHighlightConfigBuilder {
944            scroll_snap_container_highlight_config: scroll_snap_container_highlight_config,
945            node_id: node_id,
946        }
947    }
948    /// A descriptor for the highlight appearance of scroll snap containers.
949    pub fn scroll_snap_container_highlight_config(&self) -> &ScrollSnapContainerHighlightConfig<'a> { &self.scroll_snap_container_highlight_config }
950    /// Identifier of the node to highlight.
951    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
952}
953
954
955pub struct ScrollSnapHighlightConfigBuilder<'a> {
956    scroll_snap_container_highlight_config: ScrollSnapContainerHighlightConfig<'a>,
957    node_id: crate::dom::NodeId,
958}
959
960impl<'a> ScrollSnapHighlightConfigBuilder<'a> {
961    pub fn build(self) -> ScrollSnapHighlightConfig<'a> {
962        ScrollSnapHighlightConfig {
963            scroll_snap_container_highlight_config: self.scroll_snap_container_highlight_config,
964            node_id: self.node_id,
965        }
966    }
967}
968
969/// Configuration for dual screen hinge
970
971#[derive(Debug, Clone, Serialize, Deserialize, Default)]
972#[serde(rename_all = "camelCase")]
973pub struct HingeConfig {
974    /// A rectangle represent hinge
975    rect: crate::dom::Rect,
976    /// The content box highlight fill color (default: a dark color).
977    #[serde(skip_serializing_if = "Option::is_none", rename = "contentColor")]
978    content_color: Option<crate::dom::RGBA>,
979    /// The content box highlight outline color (default: transparent).
980    #[serde(skip_serializing_if = "Option::is_none", rename = "outlineColor")]
981    outline_color: Option<crate::dom::RGBA>,
982}
983
984impl HingeConfig {
985    /// Creates a builder for this type with the required parameters:
986    /// * `rect`: A rectangle represent hinge
987    pub fn builder(rect: crate::dom::Rect) -> HingeConfigBuilder {
988        HingeConfigBuilder {
989            rect: rect,
990            content_color: None,
991            outline_color: None,
992        }
993    }
994    /// A rectangle represent hinge
995    pub fn rect(&self) -> &crate::dom::Rect { &self.rect }
996    /// The content box highlight fill color (default: a dark color).
997    pub fn content_color(&self) -> Option<&crate::dom::RGBA> { self.content_color.as_ref() }
998    /// The content box highlight outline color (default: transparent).
999    pub fn outline_color(&self) -> Option<&crate::dom::RGBA> { self.outline_color.as_ref() }
1000}
1001
1002
1003pub struct HingeConfigBuilder {
1004    rect: crate::dom::Rect,
1005    content_color: Option<crate::dom::RGBA>,
1006    outline_color: Option<crate::dom::RGBA>,
1007}
1008
1009impl HingeConfigBuilder {
1010    /// The content box highlight fill color (default: a dark color).
1011    pub fn content_color(mut self, content_color: crate::dom::RGBA) -> Self { self.content_color = Some(content_color); self }
1012    /// The content box highlight outline color (default: transparent).
1013    pub fn outline_color(mut self, outline_color: crate::dom::RGBA) -> Self { self.outline_color = Some(outline_color); self }
1014    pub fn build(self) -> HingeConfig {
1015        HingeConfig {
1016            rect: self.rect,
1017            content_color: self.content_color,
1018            outline_color: self.outline_color,
1019        }
1020    }
1021}
1022
1023/// Configuration for Window Controls Overlay
1024
1025#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1026#[serde(rename_all = "camelCase")]
1027pub struct WindowControlsOverlayConfig<'a> {
1028    /// Whether the title bar CSS should be shown when emulating the Window Controls Overlay.
1029    #[serde(rename = "showCSS")]
1030    show_css: bool,
1031    /// Selected platforms to show the overlay.
1032    #[serde(rename = "selectedPlatform")]
1033    selected_platform: Cow<'a, str>,
1034    /// The theme color defined in app manifest.
1035    #[serde(rename = "themeColor")]
1036    theme_color: Cow<'a, str>,
1037}
1038
1039impl<'a> WindowControlsOverlayConfig<'a> {
1040    /// Creates a builder for this type with the required parameters:
1041    /// * `show_css`: Whether the title bar CSS should be shown when emulating the Window Controls Overlay.
1042    /// * `selected_platform`: Selected platforms to show the overlay.
1043    /// * `theme_color`: The theme color defined in app manifest.
1044    pub fn builder(show_css: bool, selected_platform: impl Into<Cow<'a, str>>, theme_color: impl Into<Cow<'a, str>>) -> WindowControlsOverlayConfigBuilder<'a> {
1045        WindowControlsOverlayConfigBuilder {
1046            show_css: show_css,
1047            selected_platform: selected_platform.into(),
1048            theme_color: theme_color.into(),
1049        }
1050    }
1051    /// Whether the title bar CSS should be shown when emulating the Window Controls Overlay.
1052    pub fn show_css(&self) -> bool { self.show_css }
1053    /// Selected platforms to show the overlay.
1054    pub fn selected_platform(&self) -> &str { self.selected_platform.as_ref() }
1055    /// The theme color defined in app manifest.
1056    pub fn theme_color(&self) -> &str { self.theme_color.as_ref() }
1057}
1058
1059
1060pub struct WindowControlsOverlayConfigBuilder<'a> {
1061    show_css: bool,
1062    selected_platform: Cow<'a, str>,
1063    theme_color: Cow<'a, str>,
1064}
1065
1066impl<'a> WindowControlsOverlayConfigBuilder<'a> {
1067    pub fn build(self) -> WindowControlsOverlayConfig<'a> {
1068        WindowControlsOverlayConfig {
1069            show_css: self.show_css,
1070            selected_platform: self.selected_platform,
1071            theme_color: self.theme_color,
1072        }
1073    }
1074}
1075
1076
1077#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1078#[serde(rename_all = "camelCase")]
1079pub struct ContainerQueryHighlightConfig<'a> {
1080    /// A descriptor for the highlight appearance of container query containers.
1081    #[serde(rename = "containerQueryContainerHighlightConfig")]
1082    container_query_container_highlight_config: ContainerQueryContainerHighlightConfig<'a>,
1083    /// Identifier of the container node to highlight.
1084    #[serde(rename = "nodeId")]
1085    node_id: crate::dom::NodeId,
1086}
1087
1088impl<'a> ContainerQueryHighlightConfig<'a> {
1089    /// Creates a builder for this type with the required parameters:
1090    /// * `container_query_container_highlight_config`: A descriptor for the highlight appearance of container query containers.
1091    /// * `node_id`: Identifier of the container node to highlight.
1092    pub fn builder(container_query_container_highlight_config: ContainerQueryContainerHighlightConfig<'a>, node_id: crate::dom::NodeId) -> ContainerQueryHighlightConfigBuilder<'a> {
1093        ContainerQueryHighlightConfigBuilder {
1094            container_query_container_highlight_config: container_query_container_highlight_config,
1095            node_id: node_id,
1096        }
1097    }
1098    /// A descriptor for the highlight appearance of container query containers.
1099    pub fn container_query_container_highlight_config(&self) -> &ContainerQueryContainerHighlightConfig<'a> { &self.container_query_container_highlight_config }
1100    /// Identifier of the container node to highlight.
1101    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
1102}
1103
1104
1105pub struct ContainerQueryHighlightConfigBuilder<'a> {
1106    container_query_container_highlight_config: ContainerQueryContainerHighlightConfig<'a>,
1107    node_id: crate::dom::NodeId,
1108}
1109
1110impl<'a> ContainerQueryHighlightConfigBuilder<'a> {
1111    pub fn build(self) -> ContainerQueryHighlightConfig<'a> {
1112        ContainerQueryHighlightConfig {
1113            container_query_container_highlight_config: self.container_query_container_highlight_config,
1114            node_id: self.node_id,
1115        }
1116    }
1117}
1118
1119
1120#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1121#[serde(rename_all = "camelCase")]
1122pub struct ContainerQueryContainerHighlightConfig<'a> {
1123    /// The style of the container border.
1124    #[serde(skip_serializing_if = "Option::is_none", rename = "containerBorder")]
1125    container_border: Option<LineStyle<'a>>,
1126    /// The style of the descendants' borders.
1127    #[serde(skip_serializing_if = "Option::is_none", rename = "descendantBorder")]
1128    descendant_border: Option<LineStyle<'a>>,
1129}
1130
1131impl<'a> ContainerQueryContainerHighlightConfig<'a> {
1132    /// Creates a builder for this type.
1133    pub fn builder() -> ContainerQueryContainerHighlightConfigBuilder<'a> {
1134        ContainerQueryContainerHighlightConfigBuilder {
1135            container_border: None,
1136            descendant_border: None,
1137        }
1138    }
1139    /// The style of the container border.
1140    pub fn container_border(&self) -> Option<&LineStyle<'a>> { self.container_border.as_ref() }
1141    /// The style of the descendants' borders.
1142    pub fn descendant_border(&self) -> Option<&LineStyle<'a>> { self.descendant_border.as_ref() }
1143}
1144
1145#[derive(Default)]
1146pub struct ContainerQueryContainerHighlightConfigBuilder<'a> {
1147    container_border: Option<LineStyle<'a>>,
1148    descendant_border: Option<LineStyle<'a>>,
1149}
1150
1151impl<'a> ContainerQueryContainerHighlightConfigBuilder<'a> {
1152    /// The style of the container border.
1153    pub fn container_border(mut self, container_border: LineStyle<'a>) -> Self { self.container_border = Some(container_border); self }
1154    /// The style of the descendants' borders.
1155    pub fn descendant_border(mut self, descendant_border: LineStyle<'a>) -> Self { self.descendant_border = Some(descendant_border); self }
1156    pub fn build(self) -> ContainerQueryContainerHighlightConfig<'a> {
1157        ContainerQueryContainerHighlightConfig {
1158            container_border: self.container_border,
1159            descendant_border: self.descendant_border,
1160        }
1161    }
1162}
1163
1164
1165#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1166#[serde(rename_all = "camelCase")]
1167pub struct IsolatedElementHighlightConfig {
1168    /// A descriptor for the highlight appearance of an element in isolation mode.
1169    #[serde(rename = "isolationModeHighlightConfig")]
1170    isolation_mode_highlight_config: IsolationModeHighlightConfig,
1171    /// Identifier of the isolated element to highlight.
1172    #[serde(rename = "nodeId")]
1173    node_id: crate::dom::NodeId,
1174}
1175
1176impl IsolatedElementHighlightConfig {
1177    /// Creates a builder for this type with the required parameters:
1178    /// * `isolation_mode_highlight_config`: A descriptor for the highlight appearance of an element in isolation mode.
1179    /// * `node_id`: Identifier of the isolated element to highlight.
1180    pub fn builder(isolation_mode_highlight_config: IsolationModeHighlightConfig, node_id: crate::dom::NodeId) -> IsolatedElementHighlightConfigBuilder {
1181        IsolatedElementHighlightConfigBuilder {
1182            isolation_mode_highlight_config: isolation_mode_highlight_config,
1183            node_id: node_id,
1184        }
1185    }
1186    /// A descriptor for the highlight appearance of an element in isolation mode.
1187    pub fn isolation_mode_highlight_config(&self) -> &IsolationModeHighlightConfig { &self.isolation_mode_highlight_config }
1188    /// Identifier of the isolated element to highlight.
1189    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
1190}
1191
1192
1193pub struct IsolatedElementHighlightConfigBuilder {
1194    isolation_mode_highlight_config: IsolationModeHighlightConfig,
1195    node_id: crate::dom::NodeId,
1196}
1197
1198impl IsolatedElementHighlightConfigBuilder {
1199    pub fn build(self) -> IsolatedElementHighlightConfig {
1200        IsolatedElementHighlightConfig {
1201            isolation_mode_highlight_config: self.isolation_mode_highlight_config,
1202            node_id: self.node_id,
1203        }
1204    }
1205}
1206
1207
1208#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1209#[serde(rename_all = "camelCase")]
1210pub struct IsolationModeHighlightConfig {
1211    /// The fill color of the resizers (default: transparent).
1212    #[serde(skip_serializing_if = "Option::is_none", rename = "resizerColor")]
1213    resizer_color: Option<crate::dom::RGBA>,
1214    /// The fill color for resizer handles (default: transparent).
1215    #[serde(skip_serializing_if = "Option::is_none", rename = "resizerHandleColor")]
1216    resizer_handle_color: Option<crate::dom::RGBA>,
1217    /// The fill color for the mask covering non-isolated elements (default: transparent).
1218    #[serde(skip_serializing_if = "Option::is_none", rename = "maskColor")]
1219    mask_color: Option<crate::dom::RGBA>,
1220}
1221
1222impl IsolationModeHighlightConfig {
1223    /// Creates a builder for this type.
1224    pub fn builder() -> IsolationModeHighlightConfigBuilder {
1225        IsolationModeHighlightConfigBuilder {
1226            resizer_color: None,
1227            resizer_handle_color: None,
1228            mask_color: None,
1229        }
1230    }
1231    /// The fill color of the resizers (default: transparent).
1232    pub fn resizer_color(&self) -> Option<&crate::dom::RGBA> { self.resizer_color.as_ref() }
1233    /// The fill color for resizer handles (default: transparent).
1234    pub fn resizer_handle_color(&self) -> Option<&crate::dom::RGBA> { self.resizer_handle_color.as_ref() }
1235    /// The fill color for the mask covering non-isolated elements (default: transparent).
1236    pub fn mask_color(&self) -> Option<&crate::dom::RGBA> { self.mask_color.as_ref() }
1237}
1238
1239#[derive(Default)]
1240pub struct IsolationModeHighlightConfigBuilder {
1241    resizer_color: Option<crate::dom::RGBA>,
1242    resizer_handle_color: Option<crate::dom::RGBA>,
1243    mask_color: Option<crate::dom::RGBA>,
1244}
1245
1246impl IsolationModeHighlightConfigBuilder {
1247    /// The fill color of the resizers (default: transparent).
1248    pub fn resizer_color(mut self, resizer_color: crate::dom::RGBA) -> Self { self.resizer_color = Some(resizer_color); self }
1249    /// The fill color for resizer handles (default: transparent).
1250    pub fn resizer_handle_color(mut self, resizer_handle_color: crate::dom::RGBA) -> Self { self.resizer_handle_color = Some(resizer_handle_color); self }
1251    /// The fill color for the mask covering non-isolated elements (default: transparent).
1252    pub fn mask_color(mut self, mask_color: crate::dom::RGBA) -> Self { self.mask_color = Some(mask_color); self }
1253    pub fn build(self) -> IsolationModeHighlightConfig {
1254        IsolationModeHighlightConfig {
1255            resizer_color: self.resizer_color,
1256            resizer_handle_color: self.resizer_handle_color,
1257            mask_color: self.mask_color,
1258        }
1259    }
1260}
1261
1262
1263#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1264pub enum InspectMode {
1265    #[default]
1266    #[serde(rename = "searchForNode")]
1267    SearchForNode,
1268    #[serde(rename = "searchForUAShadowDOM")]
1269    SearchForUAShadowDOM,
1270    #[serde(rename = "captureAreaScreenshot")]
1271    CaptureAreaScreenshot,
1272    #[serde(rename = "none")]
1273    None,
1274}
1275
1276
1277#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1278#[serde(rename_all = "camelCase")]
1279pub struct InspectedElementAnchorConfig {
1280    /// Identifier of the node to highlight.
1281    #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
1282    node_id: Option<crate::dom::NodeId>,
1283    /// Identifier of the backend node to highlight.
1284    #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
1285    backend_node_id: Option<crate::dom::BackendNodeId>,
1286}
1287
1288impl InspectedElementAnchorConfig {
1289    /// Creates a builder for this type.
1290    pub fn builder() -> InspectedElementAnchorConfigBuilder {
1291        InspectedElementAnchorConfigBuilder {
1292            node_id: None,
1293            backend_node_id: None,
1294        }
1295    }
1296    /// Identifier of the node to highlight.
1297    pub fn node_id(&self) -> Option<&crate::dom::NodeId> { self.node_id.as_ref() }
1298    /// Identifier of the backend node to highlight.
1299    pub fn backend_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.backend_node_id.as_ref() }
1300}
1301
1302#[derive(Default)]
1303pub struct InspectedElementAnchorConfigBuilder {
1304    node_id: Option<crate::dom::NodeId>,
1305    backend_node_id: Option<crate::dom::BackendNodeId>,
1306}
1307
1308impl InspectedElementAnchorConfigBuilder {
1309    /// Identifier of the node to highlight.
1310    pub fn node_id(mut self, node_id: crate::dom::NodeId) -> Self { self.node_id = Some(node_id); self }
1311    /// Identifier of the backend node to highlight.
1312    pub fn backend_node_id(mut self, backend_node_id: crate::dom::BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
1313    pub fn build(self) -> InspectedElementAnchorConfig {
1314        InspectedElementAnchorConfig {
1315            node_id: self.node_id,
1316            backend_node_id: self.backend_node_id,
1317        }
1318    }
1319}
1320
1321#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1322pub struct DisableParams {}
1323
1324impl DisableParams { pub const METHOD: &'static str = "Overlay.disable"; }
1325
1326impl<'a> crate::CdpCommand<'a> for DisableParams {
1327    const METHOD: &'static str = "Overlay.disable";
1328    type Response = crate::EmptyReturns;
1329}
1330
1331#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1332pub struct EnableParams {}
1333
1334impl EnableParams { pub const METHOD: &'static str = "Overlay.enable"; }
1335
1336impl<'a> crate::CdpCommand<'a> for EnableParams {
1337    const METHOD: &'static str = "Overlay.enable";
1338    type Response = crate::EmptyReturns;
1339}
1340
1341/// For testing.
1342
1343#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1344#[serde(rename_all = "camelCase")]
1345pub struct GetHighlightObjectForTestParams {
1346    /// Id of the node to get highlight object for.
1347    #[serde(rename = "nodeId")]
1348    node_id: crate::dom::NodeId,
1349    /// Whether to include distance info.
1350    #[serde(skip_serializing_if = "Option::is_none", rename = "includeDistance")]
1351    include_distance: Option<bool>,
1352    /// Whether to include style info.
1353    #[serde(skip_serializing_if = "Option::is_none", rename = "includeStyle")]
1354    include_style: Option<bool>,
1355    /// The color format to get config with (default: hex).
1356    #[serde(skip_serializing_if = "Option::is_none", rename = "colorFormat")]
1357    color_format: Option<ColorFormat>,
1358    /// Whether to show accessibility info (default: true).
1359    #[serde(skip_serializing_if = "Option::is_none", rename = "showAccessibilityInfo")]
1360    show_accessibility_info: Option<bool>,
1361}
1362
1363impl GetHighlightObjectForTestParams {
1364    /// Creates a builder for this type with the required parameters:
1365    /// * `node_id`: Id of the node to get highlight object for.
1366    pub fn builder(node_id: crate::dom::NodeId) -> GetHighlightObjectForTestParamsBuilder {
1367        GetHighlightObjectForTestParamsBuilder {
1368            node_id: node_id,
1369            include_distance: None,
1370            include_style: None,
1371            color_format: None,
1372            show_accessibility_info: None,
1373        }
1374    }
1375    /// Id of the node to get highlight object for.
1376    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
1377    /// Whether to include distance info.
1378    pub fn include_distance(&self) -> Option<bool> { self.include_distance }
1379    /// Whether to include style info.
1380    pub fn include_style(&self) -> Option<bool> { self.include_style }
1381    /// The color format to get config with (default: hex).
1382    pub fn color_format(&self) -> Option<&ColorFormat> { self.color_format.as_ref() }
1383    /// Whether to show accessibility info (default: true).
1384    pub fn show_accessibility_info(&self) -> Option<bool> { self.show_accessibility_info }
1385}
1386
1387
1388pub struct GetHighlightObjectForTestParamsBuilder {
1389    node_id: crate::dom::NodeId,
1390    include_distance: Option<bool>,
1391    include_style: Option<bool>,
1392    color_format: Option<ColorFormat>,
1393    show_accessibility_info: Option<bool>,
1394}
1395
1396impl GetHighlightObjectForTestParamsBuilder {
1397    /// Whether to include distance info.
1398    pub fn include_distance(mut self, include_distance: bool) -> Self { self.include_distance = Some(include_distance); self }
1399    /// Whether to include style info.
1400    pub fn include_style(mut self, include_style: bool) -> Self { self.include_style = Some(include_style); self }
1401    /// The color format to get config with (default: hex).
1402    pub fn color_format(mut self, color_format: impl Into<ColorFormat>) -> Self { self.color_format = Some(color_format.into()); self }
1403    /// Whether to show accessibility info (default: true).
1404    pub fn show_accessibility_info(mut self, show_accessibility_info: bool) -> Self { self.show_accessibility_info = Some(show_accessibility_info); self }
1405    pub fn build(self) -> GetHighlightObjectForTestParams {
1406        GetHighlightObjectForTestParams {
1407            node_id: self.node_id,
1408            include_distance: self.include_distance,
1409            include_style: self.include_style,
1410            color_format: self.color_format,
1411            show_accessibility_info: self.show_accessibility_info,
1412        }
1413    }
1414}
1415
1416/// For testing.
1417
1418#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1419#[serde(rename_all = "camelCase")]
1420pub struct GetHighlightObjectForTestReturns {
1421    /// Highlight data for the node.
1422    highlight: serde_json::Map<String, JsonValue>,
1423}
1424
1425impl GetHighlightObjectForTestReturns {
1426    /// Creates a builder for this type with the required parameters:
1427    /// * `highlight`: Highlight data for the node.
1428    pub fn builder(highlight: serde_json::Map<String, JsonValue>) -> GetHighlightObjectForTestReturnsBuilder {
1429        GetHighlightObjectForTestReturnsBuilder {
1430            highlight: highlight,
1431        }
1432    }
1433    /// Highlight data for the node.
1434    pub fn highlight(&self) -> &serde_json::Map<String, JsonValue> { &self.highlight }
1435}
1436
1437
1438pub struct GetHighlightObjectForTestReturnsBuilder {
1439    highlight: serde_json::Map<String, JsonValue>,
1440}
1441
1442impl GetHighlightObjectForTestReturnsBuilder {
1443    pub fn build(self) -> GetHighlightObjectForTestReturns {
1444        GetHighlightObjectForTestReturns {
1445            highlight: self.highlight,
1446        }
1447    }
1448}
1449
1450impl GetHighlightObjectForTestParams { pub const METHOD: &'static str = "Overlay.getHighlightObjectForTest"; }
1451
1452impl<'a> crate::CdpCommand<'a> for GetHighlightObjectForTestParams {
1453    const METHOD: &'static str = "Overlay.getHighlightObjectForTest";
1454    type Response = GetHighlightObjectForTestReturns;
1455}
1456
1457/// For Persistent Grid testing.
1458
1459#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1460#[serde(rename_all = "camelCase")]
1461pub struct GetGridHighlightObjectsForTestParams {
1462    /// Ids of the node to get highlight object for.
1463    #[serde(rename = "nodeIds")]
1464    node_ids: Vec<crate::dom::NodeId>,
1465}
1466
1467impl GetGridHighlightObjectsForTestParams {
1468    /// Creates a builder for this type with the required parameters:
1469    /// * `node_ids`: Ids of the node to get highlight object for.
1470    pub fn builder(node_ids: Vec<crate::dom::NodeId>) -> GetGridHighlightObjectsForTestParamsBuilder {
1471        GetGridHighlightObjectsForTestParamsBuilder {
1472            node_ids: node_ids,
1473        }
1474    }
1475    /// Ids of the node to get highlight object for.
1476    pub fn node_ids(&self) -> &[crate::dom::NodeId] { &self.node_ids }
1477}
1478
1479
1480pub struct GetGridHighlightObjectsForTestParamsBuilder {
1481    node_ids: Vec<crate::dom::NodeId>,
1482}
1483
1484impl GetGridHighlightObjectsForTestParamsBuilder {
1485    pub fn build(self) -> GetGridHighlightObjectsForTestParams {
1486        GetGridHighlightObjectsForTestParams {
1487            node_ids: self.node_ids,
1488        }
1489    }
1490}
1491
1492/// For Persistent Grid testing.
1493
1494#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1495#[serde(rename_all = "camelCase")]
1496pub struct GetGridHighlightObjectsForTestReturns {
1497    /// Grid Highlight data for the node ids provided.
1498    highlights: serde_json::Map<String, JsonValue>,
1499}
1500
1501impl GetGridHighlightObjectsForTestReturns {
1502    /// Creates a builder for this type with the required parameters:
1503    /// * `highlights`: Grid Highlight data for the node ids provided.
1504    pub fn builder(highlights: serde_json::Map<String, JsonValue>) -> GetGridHighlightObjectsForTestReturnsBuilder {
1505        GetGridHighlightObjectsForTestReturnsBuilder {
1506            highlights: highlights,
1507        }
1508    }
1509    /// Grid Highlight data for the node ids provided.
1510    pub fn highlights(&self) -> &serde_json::Map<String, JsonValue> { &self.highlights }
1511}
1512
1513
1514pub struct GetGridHighlightObjectsForTestReturnsBuilder {
1515    highlights: serde_json::Map<String, JsonValue>,
1516}
1517
1518impl GetGridHighlightObjectsForTestReturnsBuilder {
1519    pub fn build(self) -> GetGridHighlightObjectsForTestReturns {
1520        GetGridHighlightObjectsForTestReturns {
1521            highlights: self.highlights,
1522        }
1523    }
1524}
1525
1526impl GetGridHighlightObjectsForTestParams { pub const METHOD: &'static str = "Overlay.getGridHighlightObjectsForTest"; }
1527
1528impl<'a> crate::CdpCommand<'a> for GetGridHighlightObjectsForTestParams {
1529    const METHOD: &'static str = "Overlay.getGridHighlightObjectsForTest";
1530    type Response = GetGridHighlightObjectsForTestReturns;
1531}
1532
1533/// For Source Order Viewer testing.
1534
1535#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1536#[serde(rename_all = "camelCase")]
1537pub struct GetSourceOrderHighlightObjectForTestParams {
1538    /// Id of the node to highlight.
1539    #[serde(rename = "nodeId")]
1540    node_id: crate::dom::NodeId,
1541}
1542
1543impl GetSourceOrderHighlightObjectForTestParams {
1544    /// Creates a builder for this type with the required parameters:
1545    /// * `node_id`: Id of the node to highlight.
1546    pub fn builder(node_id: crate::dom::NodeId) -> GetSourceOrderHighlightObjectForTestParamsBuilder {
1547        GetSourceOrderHighlightObjectForTestParamsBuilder {
1548            node_id: node_id,
1549        }
1550    }
1551    /// Id of the node to highlight.
1552    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
1553}
1554
1555
1556pub struct GetSourceOrderHighlightObjectForTestParamsBuilder {
1557    node_id: crate::dom::NodeId,
1558}
1559
1560impl GetSourceOrderHighlightObjectForTestParamsBuilder {
1561    pub fn build(self) -> GetSourceOrderHighlightObjectForTestParams {
1562        GetSourceOrderHighlightObjectForTestParams {
1563            node_id: self.node_id,
1564        }
1565    }
1566}
1567
1568/// For Source Order Viewer testing.
1569
1570#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1571#[serde(rename_all = "camelCase")]
1572pub struct GetSourceOrderHighlightObjectForTestReturns {
1573    /// Source order highlight data for the node id provided.
1574    highlight: serde_json::Map<String, JsonValue>,
1575}
1576
1577impl GetSourceOrderHighlightObjectForTestReturns {
1578    /// Creates a builder for this type with the required parameters:
1579    /// * `highlight`: Source order highlight data for the node id provided.
1580    pub fn builder(highlight: serde_json::Map<String, JsonValue>) -> GetSourceOrderHighlightObjectForTestReturnsBuilder {
1581        GetSourceOrderHighlightObjectForTestReturnsBuilder {
1582            highlight: highlight,
1583        }
1584    }
1585    /// Source order highlight data for the node id provided.
1586    pub fn highlight(&self) -> &serde_json::Map<String, JsonValue> { &self.highlight }
1587}
1588
1589
1590pub struct GetSourceOrderHighlightObjectForTestReturnsBuilder {
1591    highlight: serde_json::Map<String, JsonValue>,
1592}
1593
1594impl GetSourceOrderHighlightObjectForTestReturnsBuilder {
1595    pub fn build(self) -> GetSourceOrderHighlightObjectForTestReturns {
1596        GetSourceOrderHighlightObjectForTestReturns {
1597            highlight: self.highlight,
1598        }
1599    }
1600}
1601
1602impl GetSourceOrderHighlightObjectForTestParams { pub const METHOD: &'static str = "Overlay.getSourceOrderHighlightObjectForTest"; }
1603
1604impl<'a> crate::CdpCommand<'a> for GetSourceOrderHighlightObjectForTestParams {
1605    const METHOD: &'static str = "Overlay.getSourceOrderHighlightObjectForTest";
1606    type Response = GetSourceOrderHighlightObjectForTestReturns;
1607}
1608
1609#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1610pub struct HideHighlightParams {}
1611
1612impl HideHighlightParams { pub const METHOD: &'static str = "Overlay.hideHighlight"; }
1613
1614impl<'a> crate::CdpCommand<'a> for HideHighlightParams {
1615    const METHOD: &'static str = "Overlay.hideHighlight";
1616    type Response = crate::EmptyReturns;
1617}
1618
1619/// Highlights owner element of the frame with given id.
1620/// Deprecated: Doesn't work reliably and cannot be fixed due to process
1621/// separation (the owner node might be in a different process). Determine
1622/// the owner node in the client and use highlightNode.
1623
1624#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1625#[serde(rename_all = "camelCase")]
1626pub struct HighlightFrameParams<'a> {
1627    /// Identifier of the frame to highlight.
1628    #[serde(rename = "frameId")]
1629    frame_id: crate::page::FrameId<'a>,
1630    /// The content box highlight fill color (default: transparent).
1631    #[serde(skip_serializing_if = "Option::is_none", rename = "contentColor")]
1632    content_color: Option<crate::dom::RGBA>,
1633    /// The content box highlight outline color (default: transparent).
1634    #[serde(skip_serializing_if = "Option::is_none", rename = "contentOutlineColor")]
1635    content_outline_color: Option<crate::dom::RGBA>,
1636}
1637
1638impl<'a> HighlightFrameParams<'a> {
1639    /// Creates a builder for this type with the required parameters:
1640    /// * `frame_id`: Identifier of the frame to highlight.
1641    pub fn builder(frame_id: crate::page::FrameId<'a>) -> HighlightFrameParamsBuilder<'a> {
1642        HighlightFrameParamsBuilder {
1643            frame_id: frame_id,
1644            content_color: None,
1645            content_outline_color: None,
1646        }
1647    }
1648    /// Identifier of the frame to highlight.
1649    pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
1650    /// The content box highlight fill color (default: transparent).
1651    pub fn content_color(&self) -> Option<&crate::dom::RGBA> { self.content_color.as_ref() }
1652    /// The content box highlight outline color (default: transparent).
1653    pub fn content_outline_color(&self) -> Option<&crate::dom::RGBA> { self.content_outline_color.as_ref() }
1654}
1655
1656
1657pub struct HighlightFrameParamsBuilder<'a> {
1658    frame_id: crate::page::FrameId<'a>,
1659    content_color: Option<crate::dom::RGBA>,
1660    content_outline_color: Option<crate::dom::RGBA>,
1661}
1662
1663impl<'a> HighlightFrameParamsBuilder<'a> {
1664    /// The content box highlight fill color (default: transparent).
1665    pub fn content_color(mut self, content_color: crate::dom::RGBA) -> Self { self.content_color = Some(content_color); self }
1666    /// The content box highlight outline color (default: transparent).
1667    pub fn content_outline_color(mut self, content_outline_color: crate::dom::RGBA) -> Self { self.content_outline_color = Some(content_outline_color); self }
1668    pub fn build(self) -> HighlightFrameParams<'a> {
1669        HighlightFrameParams {
1670            frame_id: self.frame_id,
1671            content_color: self.content_color,
1672            content_outline_color: self.content_outline_color,
1673        }
1674    }
1675}
1676
1677impl<'a> HighlightFrameParams<'a> { pub const METHOD: &'static str = "Overlay.highlightFrame"; }
1678
1679impl<'a> crate::CdpCommand<'a> for HighlightFrameParams<'a> {
1680    const METHOD: &'static str = "Overlay.highlightFrame";
1681    type Response = crate::EmptyReturns;
1682}
1683
1684/// Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or
1685/// objectId must be specified.
1686
1687#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1688#[serde(rename_all = "camelCase")]
1689pub struct HighlightNodeParams<'a> {
1690    /// A descriptor for the highlight appearance.
1691    #[serde(rename = "highlightConfig")]
1692    highlight_config: HighlightConfig<'a>,
1693    /// Identifier of the node to highlight.
1694    #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
1695    node_id: Option<crate::dom::NodeId>,
1696    /// Identifier of the backend node to highlight.
1697    #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
1698    backend_node_id: Option<crate::dom::BackendNodeId>,
1699    /// JavaScript object id of the node to be highlighted.
1700    #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
1701    object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1702    /// Selectors to highlight relevant nodes.
1703    #[serde(skip_serializing_if = "Option::is_none")]
1704    selector: Option<Cow<'a, str>>,
1705}
1706
1707impl<'a> HighlightNodeParams<'a> {
1708    /// Creates a builder for this type with the required parameters:
1709    /// * `highlight_config`: A descriptor for the highlight appearance.
1710    pub fn builder(highlight_config: HighlightConfig<'a>) -> HighlightNodeParamsBuilder<'a> {
1711        HighlightNodeParamsBuilder {
1712            highlight_config: highlight_config,
1713            node_id: None,
1714            backend_node_id: None,
1715            object_id: None,
1716            selector: None,
1717        }
1718    }
1719    /// A descriptor for the highlight appearance.
1720    pub fn highlight_config(&self) -> &HighlightConfig<'a> { &self.highlight_config }
1721    /// Identifier of the node to highlight.
1722    pub fn node_id(&self) -> Option<&crate::dom::NodeId> { self.node_id.as_ref() }
1723    /// Identifier of the backend node to highlight.
1724    pub fn backend_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.backend_node_id.as_ref() }
1725    /// JavaScript object id of the node to be highlighted.
1726    pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
1727    /// Selectors to highlight relevant nodes.
1728    pub fn selector(&self) -> Option<&str> { self.selector.as_deref() }
1729}
1730
1731
1732pub struct HighlightNodeParamsBuilder<'a> {
1733    highlight_config: HighlightConfig<'a>,
1734    node_id: Option<crate::dom::NodeId>,
1735    backend_node_id: Option<crate::dom::BackendNodeId>,
1736    object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1737    selector: Option<Cow<'a, str>>,
1738}
1739
1740impl<'a> HighlightNodeParamsBuilder<'a> {
1741    /// Identifier of the node to highlight.
1742    pub fn node_id(mut self, node_id: crate::dom::NodeId) -> Self { self.node_id = Some(node_id); self }
1743    /// Identifier of the backend node to highlight.
1744    pub fn backend_node_id(mut self, backend_node_id: crate::dom::BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
1745    /// JavaScript object id of the node to be highlighted.
1746    pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
1747    /// Selectors to highlight relevant nodes.
1748    pub fn selector(mut self, selector: impl Into<Cow<'a, str>>) -> Self { self.selector = Some(selector.into()); self }
1749    pub fn build(self) -> HighlightNodeParams<'a> {
1750        HighlightNodeParams {
1751            highlight_config: self.highlight_config,
1752            node_id: self.node_id,
1753            backend_node_id: self.backend_node_id,
1754            object_id: self.object_id,
1755            selector: self.selector,
1756        }
1757    }
1758}
1759
1760impl<'a> HighlightNodeParams<'a> { pub const METHOD: &'static str = "Overlay.highlightNode"; }
1761
1762impl<'a> crate::CdpCommand<'a> for HighlightNodeParams<'a> {
1763    const METHOD: &'static str = "Overlay.highlightNode";
1764    type Response = crate::EmptyReturns;
1765}
1766
1767/// Highlights given quad. Coordinates are absolute with respect to the main frame viewport.
1768
1769#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1770#[serde(rename_all = "camelCase")]
1771pub struct HighlightQuadParams {
1772    /// Quad to highlight
1773    quad: crate::dom::Quad,
1774    /// The highlight fill color (default: transparent).
1775    #[serde(skip_serializing_if = "Option::is_none")]
1776    color: Option<crate::dom::RGBA>,
1777    /// The highlight outline color (default: transparent).
1778    #[serde(skip_serializing_if = "Option::is_none", rename = "outlineColor")]
1779    outline_color: Option<crate::dom::RGBA>,
1780}
1781
1782impl HighlightQuadParams {
1783    /// Creates a builder for this type with the required parameters:
1784    /// * `quad`: Quad to highlight
1785    pub fn builder(quad: crate::dom::Quad) -> HighlightQuadParamsBuilder {
1786        HighlightQuadParamsBuilder {
1787            quad: quad,
1788            color: None,
1789            outline_color: None,
1790        }
1791    }
1792    /// Quad to highlight
1793    pub fn quad(&self) -> &crate::dom::Quad { &self.quad }
1794    /// The highlight fill color (default: transparent).
1795    pub fn color(&self) -> Option<&crate::dom::RGBA> { self.color.as_ref() }
1796    /// The highlight outline color (default: transparent).
1797    pub fn outline_color(&self) -> Option<&crate::dom::RGBA> { self.outline_color.as_ref() }
1798}
1799
1800
1801pub struct HighlightQuadParamsBuilder {
1802    quad: crate::dom::Quad,
1803    color: Option<crate::dom::RGBA>,
1804    outline_color: Option<crate::dom::RGBA>,
1805}
1806
1807impl HighlightQuadParamsBuilder {
1808    /// The highlight fill color (default: transparent).
1809    pub fn color(mut self, color: crate::dom::RGBA) -> Self { self.color = Some(color); self }
1810    /// The highlight outline color (default: transparent).
1811    pub fn outline_color(mut self, outline_color: crate::dom::RGBA) -> Self { self.outline_color = Some(outline_color); self }
1812    pub fn build(self) -> HighlightQuadParams {
1813        HighlightQuadParams {
1814            quad: self.quad,
1815            color: self.color,
1816            outline_color: self.outline_color,
1817        }
1818    }
1819}
1820
1821impl HighlightQuadParams { pub const METHOD: &'static str = "Overlay.highlightQuad"; }
1822
1823impl<'a> crate::CdpCommand<'a> for HighlightQuadParams {
1824    const METHOD: &'static str = "Overlay.highlightQuad";
1825    type Response = crate::EmptyReturns;
1826}
1827
1828/// Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
1829/// Issue: the method does not handle device pixel ratio (DPR) correctly.
1830/// The coordinates currently have to be adjusted by the client
1831/// if DPR is not 1 (see crbug.com/437807128).
1832
1833#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1834#[serde(rename_all = "camelCase")]
1835pub struct HighlightRectParams {
1836    /// X coordinate
1837    x: i32,
1838    /// Y coordinate
1839    y: i32,
1840    /// Rectangle width
1841    width: u64,
1842    /// Rectangle height
1843    height: i64,
1844    /// The highlight fill color (default: transparent).
1845    #[serde(skip_serializing_if = "Option::is_none")]
1846    color: Option<crate::dom::RGBA>,
1847    /// The highlight outline color (default: transparent).
1848    #[serde(skip_serializing_if = "Option::is_none", rename = "outlineColor")]
1849    outline_color: Option<crate::dom::RGBA>,
1850}
1851
1852impl HighlightRectParams {
1853    /// Creates a builder for this type with the required parameters:
1854    /// * `x`: X coordinate
1855    /// * `y`: Y coordinate
1856    /// * `width`: Rectangle width
1857    /// * `height`: Rectangle height
1858    pub fn builder(x: i32, y: i32, width: u64, height: i64) -> HighlightRectParamsBuilder {
1859        HighlightRectParamsBuilder {
1860            x: x,
1861            y: y,
1862            width: width,
1863            height: height,
1864            color: None,
1865            outline_color: None,
1866        }
1867    }
1868    /// X coordinate
1869    pub fn x(&self) -> i32 { self.x }
1870    /// Y coordinate
1871    pub fn y(&self) -> i32 { self.y }
1872    /// Rectangle width
1873    pub fn width(&self) -> u64 { self.width }
1874    /// Rectangle height
1875    pub fn height(&self) -> i64 { self.height }
1876    /// The highlight fill color (default: transparent).
1877    pub fn color(&self) -> Option<&crate::dom::RGBA> { self.color.as_ref() }
1878    /// The highlight outline color (default: transparent).
1879    pub fn outline_color(&self) -> Option<&crate::dom::RGBA> { self.outline_color.as_ref() }
1880}
1881
1882
1883pub struct HighlightRectParamsBuilder {
1884    x: i32,
1885    y: i32,
1886    width: u64,
1887    height: i64,
1888    color: Option<crate::dom::RGBA>,
1889    outline_color: Option<crate::dom::RGBA>,
1890}
1891
1892impl HighlightRectParamsBuilder {
1893    /// The highlight fill color (default: transparent).
1894    pub fn color(mut self, color: crate::dom::RGBA) -> Self { self.color = Some(color); self }
1895    /// The highlight outline color (default: transparent).
1896    pub fn outline_color(mut self, outline_color: crate::dom::RGBA) -> Self { self.outline_color = Some(outline_color); self }
1897    pub fn build(self) -> HighlightRectParams {
1898        HighlightRectParams {
1899            x: self.x,
1900            y: self.y,
1901            width: self.width,
1902            height: self.height,
1903            color: self.color,
1904            outline_color: self.outline_color,
1905        }
1906    }
1907}
1908
1909impl HighlightRectParams { pub const METHOD: &'static str = "Overlay.highlightRect"; }
1910
1911impl<'a> crate::CdpCommand<'a> for HighlightRectParams {
1912    const METHOD: &'static str = "Overlay.highlightRect";
1913    type Response = crate::EmptyReturns;
1914}
1915
1916/// Highlights the source order of the children of the DOM node with given id or with the given
1917/// JavaScript object wrapper. Either nodeId or objectId must be specified.
1918
1919#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1920#[serde(rename_all = "camelCase")]
1921pub struct HighlightSourceOrderParams<'a> {
1922    /// A descriptor for the appearance of the overlay drawing.
1923    #[serde(rename = "sourceOrderConfig")]
1924    source_order_config: SourceOrderConfig,
1925    /// Identifier of the node to highlight.
1926    #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
1927    node_id: Option<crate::dom::NodeId>,
1928    /// Identifier of the backend node to highlight.
1929    #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
1930    backend_node_id: Option<crate::dom::BackendNodeId>,
1931    /// JavaScript object id of the node to be highlighted.
1932    #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
1933    object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1934}
1935
1936impl<'a> HighlightSourceOrderParams<'a> {
1937    /// Creates a builder for this type with the required parameters:
1938    /// * `source_order_config`: A descriptor for the appearance of the overlay drawing.
1939    pub fn builder(source_order_config: SourceOrderConfig) -> HighlightSourceOrderParamsBuilder<'a> {
1940        HighlightSourceOrderParamsBuilder {
1941            source_order_config: source_order_config,
1942            node_id: None,
1943            backend_node_id: None,
1944            object_id: None,
1945        }
1946    }
1947    /// A descriptor for the appearance of the overlay drawing.
1948    pub fn source_order_config(&self) -> &SourceOrderConfig { &self.source_order_config }
1949    /// Identifier of the node to highlight.
1950    pub fn node_id(&self) -> Option<&crate::dom::NodeId> { self.node_id.as_ref() }
1951    /// Identifier of the backend node to highlight.
1952    pub fn backend_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.backend_node_id.as_ref() }
1953    /// JavaScript object id of the node to be highlighted.
1954    pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
1955}
1956
1957
1958pub struct HighlightSourceOrderParamsBuilder<'a> {
1959    source_order_config: SourceOrderConfig,
1960    node_id: Option<crate::dom::NodeId>,
1961    backend_node_id: Option<crate::dom::BackendNodeId>,
1962    object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1963}
1964
1965impl<'a> HighlightSourceOrderParamsBuilder<'a> {
1966    /// Identifier of the node to highlight.
1967    pub fn node_id(mut self, node_id: crate::dom::NodeId) -> Self { self.node_id = Some(node_id); self }
1968    /// Identifier of the backend node to highlight.
1969    pub fn backend_node_id(mut self, backend_node_id: crate::dom::BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
1970    /// JavaScript object id of the node to be highlighted.
1971    pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
1972    pub fn build(self) -> HighlightSourceOrderParams<'a> {
1973        HighlightSourceOrderParams {
1974            source_order_config: self.source_order_config,
1975            node_id: self.node_id,
1976            backend_node_id: self.backend_node_id,
1977            object_id: self.object_id,
1978        }
1979    }
1980}
1981
1982impl<'a> HighlightSourceOrderParams<'a> { pub const METHOD: &'static str = "Overlay.highlightSourceOrder"; }
1983
1984impl<'a> crate::CdpCommand<'a> for HighlightSourceOrderParams<'a> {
1985    const METHOD: &'static str = "Overlay.highlightSourceOrder";
1986    type Response = crate::EmptyReturns;
1987}
1988
1989/// Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted.
1990/// Backend then generates 'inspectNodeRequested' event upon element selection.
1991
1992#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1993#[serde(rename_all = "camelCase")]
1994pub struct SetInspectModeParams<'a> {
1995    /// Set an inspection mode.
1996    mode: InspectMode,
1997    /// A descriptor for the highlight appearance of hovered-over nodes. May be omitted if 'enabled
1998    /// == false'.
1999    #[serde(skip_serializing_if = "Option::is_none", rename = "highlightConfig")]
2000    highlight_config: Option<HighlightConfig<'a>>,
2001}
2002
2003impl<'a> SetInspectModeParams<'a> {
2004    /// Creates a builder for this type with the required parameters:
2005    /// * `mode`: Set an inspection mode.
2006    pub fn builder(mode: impl Into<InspectMode>) -> SetInspectModeParamsBuilder<'a> {
2007        SetInspectModeParamsBuilder {
2008            mode: mode.into(),
2009            highlight_config: None,
2010        }
2011    }
2012    /// Set an inspection mode.
2013    pub fn mode(&self) -> &InspectMode { &self.mode }
2014    /// A descriptor for the highlight appearance of hovered-over nodes. May be omitted if 'enabled
2015    /// == false'.
2016    pub fn highlight_config(&self) -> Option<&HighlightConfig<'a>> { self.highlight_config.as_ref() }
2017}
2018
2019
2020pub struct SetInspectModeParamsBuilder<'a> {
2021    mode: InspectMode,
2022    highlight_config: Option<HighlightConfig<'a>>,
2023}
2024
2025impl<'a> SetInspectModeParamsBuilder<'a> {
2026    /// A descriptor for the highlight appearance of hovered-over nodes. May be omitted if 'enabled
2027    /// == false'.
2028    pub fn highlight_config(mut self, highlight_config: HighlightConfig<'a>) -> Self { self.highlight_config = Some(highlight_config); self }
2029    pub fn build(self) -> SetInspectModeParams<'a> {
2030        SetInspectModeParams {
2031            mode: self.mode,
2032            highlight_config: self.highlight_config,
2033        }
2034    }
2035}
2036
2037impl<'a> SetInspectModeParams<'a> { pub const METHOD: &'static str = "Overlay.setInspectMode"; }
2038
2039impl<'a> crate::CdpCommand<'a> for SetInspectModeParams<'a> {
2040    const METHOD: &'static str = "Overlay.setInspectMode";
2041    type Response = crate::EmptyReturns;
2042}
2043
2044/// Highlights owner element of all frames detected to be ads.
2045
2046#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2047#[serde(rename_all = "camelCase")]
2048pub struct SetShowAdHighlightsParams {
2049    /// True for showing ad highlights
2050    show: bool,
2051}
2052
2053impl SetShowAdHighlightsParams {
2054    /// Creates a builder for this type with the required parameters:
2055    /// * `show`: True for showing ad highlights
2056    pub fn builder(show: bool) -> SetShowAdHighlightsParamsBuilder {
2057        SetShowAdHighlightsParamsBuilder {
2058            show: show,
2059        }
2060    }
2061    /// True for showing ad highlights
2062    pub fn show(&self) -> bool { self.show }
2063}
2064
2065
2066pub struct SetShowAdHighlightsParamsBuilder {
2067    show: bool,
2068}
2069
2070impl SetShowAdHighlightsParamsBuilder {
2071    pub fn build(self) -> SetShowAdHighlightsParams {
2072        SetShowAdHighlightsParams {
2073            show: self.show,
2074        }
2075    }
2076}
2077
2078impl SetShowAdHighlightsParams { pub const METHOD: &'static str = "Overlay.setShowAdHighlights"; }
2079
2080impl<'a> crate::CdpCommand<'a> for SetShowAdHighlightsParams {
2081    const METHOD: &'static str = "Overlay.setShowAdHighlights";
2082    type Response = crate::EmptyReturns;
2083}
2084
2085
2086#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2087#[serde(rename_all = "camelCase")]
2088pub struct SetPausedInDebuggerMessageParams<'a> {
2089    /// The message to display, also triggers resume and step over controls.
2090    #[serde(skip_serializing_if = "Option::is_none")]
2091    message: Option<Cow<'a, str>>,
2092}
2093
2094impl<'a> SetPausedInDebuggerMessageParams<'a> {
2095    /// Creates a builder for this type.
2096    pub fn builder() -> SetPausedInDebuggerMessageParamsBuilder<'a> {
2097        SetPausedInDebuggerMessageParamsBuilder {
2098            message: None,
2099        }
2100    }
2101    /// The message to display, also triggers resume and step over controls.
2102    pub fn message(&self) -> Option<&str> { self.message.as_deref() }
2103}
2104
2105#[derive(Default)]
2106pub struct SetPausedInDebuggerMessageParamsBuilder<'a> {
2107    message: Option<Cow<'a, str>>,
2108}
2109
2110impl<'a> SetPausedInDebuggerMessageParamsBuilder<'a> {
2111    /// The message to display, also triggers resume and step over controls.
2112    pub fn message(mut self, message: impl Into<Cow<'a, str>>) -> Self { self.message = Some(message.into()); self }
2113    pub fn build(self) -> SetPausedInDebuggerMessageParams<'a> {
2114        SetPausedInDebuggerMessageParams {
2115            message: self.message,
2116        }
2117    }
2118}
2119
2120impl<'a> SetPausedInDebuggerMessageParams<'a> { pub const METHOD: &'static str = "Overlay.setPausedInDebuggerMessage"; }
2121
2122impl<'a> crate::CdpCommand<'a> for SetPausedInDebuggerMessageParams<'a> {
2123    const METHOD: &'static str = "Overlay.setPausedInDebuggerMessage";
2124    type Response = crate::EmptyReturns;
2125}
2126
2127/// Requests that backend shows debug borders on layers
2128
2129#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2130#[serde(rename_all = "camelCase")]
2131pub struct SetShowDebugBordersParams {
2132    /// True for showing debug borders
2133    show: bool,
2134}
2135
2136impl SetShowDebugBordersParams {
2137    /// Creates a builder for this type with the required parameters:
2138    /// * `show`: True for showing debug borders
2139    pub fn builder(show: bool) -> SetShowDebugBordersParamsBuilder {
2140        SetShowDebugBordersParamsBuilder {
2141            show: show,
2142        }
2143    }
2144    /// True for showing debug borders
2145    pub fn show(&self) -> bool { self.show }
2146}
2147
2148
2149pub struct SetShowDebugBordersParamsBuilder {
2150    show: bool,
2151}
2152
2153impl SetShowDebugBordersParamsBuilder {
2154    pub fn build(self) -> SetShowDebugBordersParams {
2155        SetShowDebugBordersParams {
2156            show: self.show,
2157        }
2158    }
2159}
2160
2161impl SetShowDebugBordersParams { pub const METHOD: &'static str = "Overlay.setShowDebugBorders"; }
2162
2163impl<'a> crate::CdpCommand<'a> for SetShowDebugBordersParams {
2164    const METHOD: &'static str = "Overlay.setShowDebugBorders";
2165    type Response = crate::EmptyReturns;
2166}
2167
2168/// Requests that backend shows the FPS counter
2169
2170#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2171#[serde(rename_all = "camelCase")]
2172pub struct SetShowFPSCounterParams {
2173    /// True for showing the FPS counter
2174    show: bool,
2175}
2176
2177impl SetShowFPSCounterParams {
2178    /// Creates a builder for this type with the required parameters:
2179    /// * `show`: True for showing the FPS counter
2180    pub fn builder(show: bool) -> SetShowFPSCounterParamsBuilder {
2181        SetShowFPSCounterParamsBuilder {
2182            show: show,
2183        }
2184    }
2185    /// True for showing the FPS counter
2186    pub fn show(&self) -> bool { self.show }
2187}
2188
2189
2190pub struct SetShowFPSCounterParamsBuilder {
2191    show: bool,
2192}
2193
2194impl SetShowFPSCounterParamsBuilder {
2195    pub fn build(self) -> SetShowFPSCounterParams {
2196        SetShowFPSCounterParams {
2197            show: self.show,
2198        }
2199    }
2200}
2201
2202impl SetShowFPSCounterParams { pub const METHOD: &'static str = "Overlay.setShowFPSCounter"; }
2203
2204impl<'a> crate::CdpCommand<'a> for SetShowFPSCounterParams {
2205    const METHOD: &'static str = "Overlay.setShowFPSCounter";
2206    type Response = crate::EmptyReturns;
2207}
2208
2209/// Highlight multiple elements with the CSS Grid overlay.
2210
2211#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2212#[serde(rename_all = "camelCase")]
2213pub struct SetShowGridOverlaysParams {
2214    /// An array of node identifiers and descriptors for the highlight appearance.
2215    #[serde(rename = "gridNodeHighlightConfigs")]
2216    grid_node_highlight_configs: Vec<GridNodeHighlightConfig>,
2217}
2218
2219impl SetShowGridOverlaysParams {
2220    /// Creates a builder for this type with the required parameters:
2221    /// * `grid_node_highlight_configs`: An array of node identifiers and descriptors for the highlight appearance.
2222    pub fn builder(grid_node_highlight_configs: Vec<GridNodeHighlightConfig>) -> SetShowGridOverlaysParamsBuilder {
2223        SetShowGridOverlaysParamsBuilder {
2224            grid_node_highlight_configs: grid_node_highlight_configs,
2225        }
2226    }
2227    /// An array of node identifiers and descriptors for the highlight appearance.
2228    pub fn grid_node_highlight_configs(&self) -> &[GridNodeHighlightConfig] { &self.grid_node_highlight_configs }
2229}
2230
2231
2232pub struct SetShowGridOverlaysParamsBuilder {
2233    grid_node_highlight_configs: Vec<GridNodeHighlightConfig>,
2234}
2235
2236impl SetShowGridOverlaysParamsBuilder {
2237    pub fn build(self) -> SetShowGridOverlaysParams {
2238        SetShowGridOverlaysParams {
2239            grid_node_highlight_configs: self.grid_node_highlight_configs,
2240        }
2241    }
2242}
2243
2244impl SetShowGridOverlaysParams { pub const METHOD: &'static str = "Overlay.setShowGridOverlays"; }
2245
2246impl<'a> crate::CdpCommand<'a> for SetShowGridOverlaysParams {
2247    const METHOD: &'static str = "Overlay.setShowGridOverlays";
2248    type Response = crate::EmptyReturns;
2249}
2250
2251
2252#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2253#[serde(rename_all = "camelCase")]
2254pub struct SetShowFlexOverlaysParams<'a> {
2255    /// An array of node identifiers and descriptors for the highlight appearance.
2256    #[serde(rename = "flexNodeHighlightConfigs")]
2257    flex_node_highlight_configs: Vec<FlexNodeHighlightConfig<'a>>,
2258}
2259
2260impl<'a> SetShowFlexOverlaysParams<'a> {
2261    /// Creates a builder for this type with the required parameters:
2262    /// * `flex_node_highlight_configs`: An array of node identifiers and descriptors for the highlight appearance.
2263    pub fn builder(flex_node_highlight_configs: Vec<FlexNodeHighlightConfig<'a>>) -> SetShowFlexOverlaysParamsBuilder<'a> {
2264        SetShowFlexOverlaysParamsBuilder {
2265            flex_node_highlight_configs: flex_node_highlight_configs,
2266        }
2267    }
2268    /// An array of node identifiers and descriptors for the highlight appearance.
2269    pub fn flex_node_highlight_configs(&self) -> &[FlexNodeHighlightConfig<'a>] { &self.flex_node_highlight_configs }
2270}
2271
2272
2273pub struct SetShowFlexOverlaysParamsBuilder<'a> {
2274    flex_node_highlight_configs: Vec<FlexNodeHighlightConfig<'a>>,
2275}
2276
2277impl<'a> SetShowFlexOverlaysParamsBuilder<'a> {
2278    pub fn build(self) -> SetShowFlexOverlaysParams<'a> {
2279        SetShowFlexOverlaysParams {
2280            flex_node_highlight_configs: self.flex_node_highlight_configs,
2281        }
2282    }
2283}
2284
2285impl<'a> SetShowFlexOverlaysParams<'a> { pub const METHOD: &'static str = "Overlay.setShowFlexOverlays"; }
2286
2287impl<'a> crate::CdpCommand<'a> for SetShowFlexOverlaysParams<'a> {
2288    const METHOD: &'static str = "Overlay.setShowFlexOverlays";
2289    type Response = crate::EmptyReturns;
2290}
2291
2292
2293#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2294#[serde(rename_all = "camelCase")]
2295pub struct SetShowScrollSnapOverlaysParams<'a> {
2296    /// An array of node identifiers and descriptors for the highlight appearance.
2297    #[serde(rename = "scrollSnapHighlightConfigs")]
2298    scroll_snap_highlight_configs: Vec<ScrollSnapHighlightConfig<'a>>,
2299}
2300
2301impl<'a> SetShowScrollSnapOverlaysParams<'a> {
2302    /// Creates a builder for this type with the required parameters:
2303    /// * `scroll_snap_highlight_configs`: An array of node identifiers and descriptors for the highlight appearance.
2304    pub fn builder(scroll_snap_highlight_configs: Vec<ScrollSnapHighlightConfig<'a>>) -> SetShowScrollSnapOverlaysParamsBuilder<'a> {
2305        SetShowScrollSnapOverlaysParamsBuilder {
2306            scroll_snap_highlight_configs: scroll_snap_highlight_configs,
2307        }
2308    }
2309    /// An array of node identifiers and descriptors for the highlight appearance.
2310    pub fn scroll_snap_highlight_configs(&self) -> &[ScrollSnapHighlightConfig<'a>] { &self.scroll_snap_highlight_configs }
2311}
2312
2313
2314pub struct SetShowScrollSnapOverlaysParamsBuilder<'a> {
2315    scroll_snap_highlight_configs: Vec<ScrollSnapHighlightConfig<'a>>,
2316}
2317
2318impl<'a> SetShowScrollSnapOverlaysParamsBuilder<'a> {
2319    pub fn build(self) -> SetShowScrollSnapOverlaysParams<'a> {
2320        SetShowScrollSnapOverlaysParams {
2321            scroll_snap_highlight_configs: self.scroll_snap_highlight_configs,
2322        }
2323    }
2324}
2325
2326impl<'a> SetShowScrollSnapOverlaysParams<'a> { pub const METHOD: &'static str = "Overlay.setShowScrollSnapOverlays"; }
2327
2328impl<'a> crate::CdpCommand<'a> for SetShowScrollSnapOverlaysParams<'a> {
2329    const METHOD: &'static str = "Overlay.setShowScrollSnapOverlays";
2330    type Response = crate::EmptyReturns;
2331}
2332
2333
2334#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2335#[serde(rename_all = "camelCase")]
2336pub struct SetShowContainerQueryOverlaysParams<'a> {
2337    /// An array of node identifiers and descriptors for the highlight appearance.
2338    #[serde(rename = "containerQueryHighlightConfigs")]
2339    container_query_highlight_configs: Vec<ContainerQueryHighlightConfig<'a>>,
2340}
2341
2342impl<'a> SetShowContainerQueryOverlaysParams<'a> {
2343    /// Creates a builder for this type with the required parameters:
2344    /// * `container_query_highlight_configs`: An array of node identifiers and descriptors for the highlight appearance.
2345    pub fn builder(container_query_highlight_configs: Vec<ContainerQueryHighlightConfig<'a>>) -> SetShowContainerQueryOverlaysParamsBuilder<'a> {
2346        SetShowContainerQueryOverlaysParamsBuilder {
2347            container_query_highlight_configs: container_query_highlight_configs,
2348        }
2349    }
2350    /// An array of node identifiers and descriptors for the highlight appearance.
2351    pub fn container_query_highlight_configs(&self) -> &[ContainerQueryHighlightConfig<'a>] { &self.container_query_highlight_configs }
2352}
2353
2354
2355pub struct SetShowContainerQueryOverlaysParamsBuilder<'a> {
2356    container_query_highlight_configs: Vec<ContainerQueryHighlightConfig<'a>>,
2357}
2358
2359impl<'a> SetShowContainerQueryOverlaysParamsBuilder<'a> {
2360    pub fn build(self) -> SetShowContainerQueryOverlaysParams<'a> {
2361        SetShowContainerQueryOverlaysParams {
2362            container_query_highlight_configs: self.container_query_highlight_configs,
2363        }
2364    }
2365}
2366
2367impl<'a> SetShowContainerQueryOverlaysParams<'a> { pub const METHOD: &'static str = "Overlay.setShowContainerQueryOverlays"; }
2368
2369impl<'a> crate::CdpCommand<'a> for SetShowContainerQueryOverlaysParams<'a> {
2370    const METHOD: &'static str = "Overlay.setShowContainerQueryOverlays";
2371    type Response = crate::EmptyReturns;
2372}
2373
2374
2375#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2376#[serde(rename_all = "camelCase")]
2377pub struct SetShowInspectedElementAnchorParams {
2378    /// Node identifier for which to show an anchor for.
2379    #[serde(rename = "inspectedElementAnchorConfig")]
2380    inspected_element_anchor_config: InspectedElementAnchorConfig,
2381}
2382
2383impl SetShowInspectedElementAnchorParams {
2384    /// Creates a builder for this type with the required parameters:
2385    /// * `inspected_element_anchor_config`: Node identifier for which to show an anchor for.
2386    pub fn builder(inspected_element_anchor_config: InspectedElementAnchorConfig) -> SetShowInspectedElementAnchorParamsBuilder {
2387        SetShowInspectedElementAnchorParamsBuilder {
2388            inspected_element_anchor_config: inspected_element_anchor_config,
2389        }
2390    }
2391    /// Node identifier for which to show an anchor for.
2392    pub fn inspected_element_anchor_config(&self) -> &InspectedElementAnchorConfig { &self.inspected_element_anchor_config }
2393}
2394
2395
2396pub struct SetShowInspectedElementAnchorParamsBuilder {
2397    inspected_element_anchor_config: InspectedElementAnchorConfig,
2398}
2399
2400impl SetShowInspectedElementAnchorParamsBuilder {
2401    pub fn build(self) -> SetShowInspectedElementAnchorParams {
2402        SetShowInspectedElementAnchorParams {
2403            inspected_element_anchor_config: self.inspected_element_anchor_config,
2404        }
2405    }
2406}
2407
2408impl SetShowInspectedElementAnchorParams { pub const METHOD: &'static str = "Overlay.setShowInspectedElementAnchor"; }
2409
2410impl<'a> crate::CdpCommand<'a> for SetShowInspectedElementAnchorParams {
2411    const METHOD: &'static str = "Overlay.setShowInspectedElementAnchor";
2412    type Response = crate::EmptyReturns;
2413}
2414
2415/// Requests that backend shows paint rectangles
2416
2417#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2418#[serde(rename_all = "camelCase")]
2419pub struct SetShowPaintRectsParams {
2420    /// True for showing paint rectangles
2421    result: bool,
2422}
2423
2424impl SetShowPaintRectsParams {
2425    /// Creates a builder for this type with the required parameters:
2426    /// * `result`: True for showing paint rectangles
2427    pub fn builder(result: bool) -> SetShowPaintRectsParamsBuilder {
2428        SetShowPaintRectsParamsBuilder {
2429            result: result,
2430        }
2431    }
2432    /// True for showing paint rectangles
2433    pub fn result(&self) -> bool { self.result }
2434}
2435
2436
2437pub struct SetShowPaintRectsParamsBuilder {
2438    result: bool,
2439}
2440
2441impl SetShowPaintRectsParamsBuilder {
2442    pub fn build(self) -> SetShowPaintRectsParams {
2443        SetShowPaintRectsParams {
2444            result: self.result,
2445        }
2446    }
2447}
2448
2449impl SetShowPaintRectsParams { pub const METHOD: &'static str = "Overlay.setShowPaintRects"; }
2450
2451impl<'a> crate::CdpCommand<'a> for SetShowPaintRectsParams {
2452    const METHOD: &'static str = "Overlay.setShowPaintRects";
2453    type Response = crate::EmptyReturns;
2454}
2455
2456/// Requests that backend shows layout shift regions
2457
2458#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2459#[serde(rename_all = "camelCase")]
2460pub struct SetShowLayoutShiftRegionsParams {
2461    /// True for showing layout shift regions
2462    result: bool,
2463}
2464
2465impl SetShowLayoutShiftRegionsParams {
2466    /// Creates a builder for this type with the required parameters:
2467    /// * `result`: True for showing layout shift regions
2468    pub fn builder(result: bool) -> SetShowLayoutShiftRegionsParamsBuilder {
2469        SetShowLayoutShiftRegionsParamsBuilder {
2470            result: result,
2471        }
2472    }
2473    /// True for showing layout shift regions
2474    pub fn result(&self) -> bool { self.result }
2475}
2476
2477
2478pub struct SetShowLayoutShiftRegionsParamsBuilder {
2479    result: bool,
2480}
2481
2482impl SetShowLayoutShiftRegionsParamsBuilder {
2483    pub fn build(self) -> SetShowLayoutShiftRegionsParams {
2484        SetShowLayoutShiftRegionsParams {
2485            result: self.result,
2486        }
2487    }
2488}
2489
2490impl SetShowLayoutShiftRegionsParams { pub const METHOD: &'static str = "Overlay.setShowLayoutShiftRegions"; }
2491
2492impl<'a> crate::CdpCommand<'a> for SetShowLayoutShiftRegionsParams {
2493    const METHOD: &'static str = "Overlay.setShowLayoutShiftRegions";
2494    type Response = crate::EmptyReturns;
2495}
2496
2497/// Requests that backend shows scroll bottleneck rects
2498
2499#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2500#[serde(rename_all = "camelCase")]
2501pub struct SetShowScrollBottleneckRectsParams {
2502    /// True for showing scroll bottleneck rects
2503    show: bool,
2504}
2505
2506impl SetShowScrollBottleneckRectsParams {
2507    /// Creates a builder for this type with the required parameters:
2508    /// * `show`: True for showing scroll bottleneck rects
2509    pub fn builder(show: bool) -> SetShowScrollBottleneckRectsParamsBuilder {
2510        SetShowScrollBottleneckRectsParamsBuilder {
2511            show: show,
2512        }
2513    }
2514    /// True for showing scroll bottleneck rects
2515    pub fn show(&self) -> bool { self.show }
2516}
2517
2518
2519pub struct SetShowScrollBottleneckRectsParamsBuilder {
2520    show: bool,
2521}
2522
2523impl SetShowScrollBottleneckRectsParamsBuilder {
2524    pub fn build(self) -> SetShowScrollBottleneckRectsParams {
2525        SetShowScrollBottleneckRectsParams {
2526            show: self.show,
2527        }
2528    }
2529}
2530
2531impl SetShowScrollBottleneckRectsParams { pub const METHOD: &'static str = "Overlay.setShowScrollBottleneckRects"; }
2532
2533impl<'a> crate::CdpCommand<'a> for SetShowScrollBottleneckRectsParams {
2534    const METHOD: &'static str = "Overlay.setShowScrollBottleneckRects";
2535    type Response = crate::EmptyReturns;
2536}
2537
2538/// Deprecated, no longer has any effect.
2539
2540#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2541#[serde(rename_all = "camelCase")]
2542pub struct SetShowHitTestBordersParams {
2543    /// True for showing hit-test borders
2544    show: bool,
2545}
2546
2547impl SetShowHitTestBordersParams {
2548    /// Creates a builder for this type with the required parameters:
2549    /// * `show`: True for showing hit-test borders
2550    pub fn builder(show: bool) -> SetShowHitTestBordersParamsBuilder {
2551        SetShowHitTestBordersParamsBuilder {
2552            show: show,
2553        }
2554    }
2555    /// True for showing hit-test borders
2556    pub fn show(&self) -> bool { self.show }
2557}
2558
2559
2560pub struct SetShowHitTestBordersParamsBuilder {
2561    show: bool,
2562}
2563
2564impl SetShowHitTestBordersParamsBuilder {
2565    pub fn build(self) -> SetShowHitTestBordersParams {
2566        SetShowHitTestBordersParams {
2567            show: self.show,
2568        }
2569    }
2570}
2571
2572impl SetShowHitTestBordersParams { pub const METHOD: &'static str = "Overlay.setShowHitTestBorders"; }
2573
2574impl<'a> crate::CdpCommand<'a> for SetShowHitTestBordersParams {
2575    const METHOD: &'static str = "Overlay.setShowHitTestBorders";
2576    type Response = crate::EmptyReturns;
2577}
2578
2579/// Deprecated, no longer has any effect.
2580
2581#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2582#[serde(rename_all = "camelCase")]
2583pub struct SetShowWebVitalsParams {
2584    show: bool,
2585}
2586
2587impl SetShowWebVitalsParams {
2588    /// Creates a builder for this type with the required parameters:
2589    /// * `show`: 
2590    pub fn builder(show: bool) -> SetShowWebVitalsParamsBuilder {
2591        SetShowWebVitalsParamsBuilder {
2592            show: show,
2593        }
2594    }
2595    pub fn show(&self) -> bool { self.show }
2596}
2597
2598
2599pub struct SetShowWebVitalsParamsBuilder {
2600    show: bool,
2601}
2602
2603impl SetShowWebVitalsParamsBuilder {
2604    pub fn build(self) -> SetShowWebVitalsParams {
2605        SetShowWebVitalsParams {
2606            show: self.show,
2607        }
2608    }
2609}
2610
2611impl SetShowWebVitalsParams { pub const METHOD: &'static str = "Overlay.setShowWebVitals"; }
2612
2613impl<'a> crate::CdpCommand<'a> for SetShowWebVitalsParams {
2614    const METHOD: &'static str = "Overlay.setShowWebVitals";
2615    type Response = crate::EmptyReturns;
2616}
2617
2618/// Paints viewport size upon main frame resize.
2619
2620#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2621#[serde(rename_all = "camelCase")]
2622pub struct SetShowViewportSizeOnResizeParams {
2623    /// Whether to paint size or not.
2624    show: bool,
2625}
2626
2627impl SetShowViewportSizeOnResizeParams {
2628    /// Creates a builder for this type with the required parameters:
2629    /// * `show`: Whether to paint size or not.
2630    pub fn builder(show: bool) -> SetShowViewportSizeOnResizeParamsBuilder {
2631        SetShowViewportSizeOnResizeParamsBuilder {
2632            show: show,
2633        }
2634    }
2635    /// Whether to paint size or not.
2636    pub fn show(&self) -> bool { self.show }
2637}
2638
2639
2640pub struct SetShowViewportSizeOnResizeParamsBuilder {
2641    show: bool,
2642}
2643
2644impl SetShowViewportSizeOnResizeParamsBuilder {
2645    pub fn build(self) -> SetShowViewportSizeOnResizeParams {
2646        SetShowViewportSizeOnResizeParams {
2647            show: self.show,
2648        }
2649    }
2650}
2651
2652impl SetShowViewportSizeOnResizeParams { pub const METHOD: &'static str = "Overlay.setShowViewportSizeOnResize"; }
2653
2654impl<'a> crate::CdpCommand<'a> for SetShowViewportSizeOnResizeParams {
2655    const METHOD: &'static str = "Overlay.setShowViewportSizeOnResize";
2656    type Response = crate::EmptyReturns;
2657}
2658
2659/// Add a dual screen device hinge
2660
2661#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2662#[serde(rename_all = "camelCase")]
2663pub struct SetShowHingeParams {
2664    /// hinge data, null means hideHinge
2665    #[serde(skip_serializing_if = "Option::is_none", rename = "hingeConfig")]
2666    hinge_config: Option<HingeConfig>,
2667}
2668
2669impl SetShowHingeParams {
2670    /// Creates a builder for this type.
2671    pub fn builder() -> SetShowHingeParamsBuilder {
2672        SetShowHingeParamsBuilder {
2673            hinge_config: None,
2674        }
2675    }
2676    /// hinge data, null means hideHinge
2677    pub fn hinge_config(&self) -> Option<&HingeConfig> { self.hinge_config.as_ref() }
2678}
2679
2680#[derive(Default)]
2681pub struct SetShowHingeParamsBuilder {
2682    hinge_config: Option<HingeConfig>,
2683}
2684
2685impl SetShowHingeParamsBuilder {
2686    /// hinge data, null means hideHinge
2687    pub fn hinge_config(mut self, hinge_config: HingeConfig) -> Self { self.hinge_config = Some(hinge_config); self }
2688    pub fn build(self) -> SetShowHingeParams {
2689        SetShowHingeParams {
2690            hinge_config: self.hinge_config,
2691        }
2692    }
2693}
2694
2695impl SetShowHingeParams { pub const METHOD: &'static str = "Overlay.setShowHinge"; }
2696
2697impl<'a> crate::CdpCommand<'a> for SetShowHingeParams {
2698    const METHOD: &'static str = "Overlay.setShowHinge";
2699    type Response = crate::EmptyReturns;
2700}
2701
2702/// Show elements in isolation mode with overlays.
2703
2704#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2705#[serde(rename_all = "camelCase")]
2706pub struct SetShowIsolatedElementsParams {
2707    /// An array of node identifiers and descriptors for the highlight appearance.
2708    #[serde(rename = "isolatedElementHighlightConfigs")]
2709    isolated_element_highlight_configs: Vec<IsolatedElementHighlightConfig>,
2710}
2711
2712impl SetShowIsolatedElementsParams {
2713    /// Creates a builder for this type with the required parameters:
2714    /// * `isolated_element_highlight_configs`: An array of node identifiers and descriptors for the highlight appearance.
2715    pub fn builder(isolated_element_highlight_configs: Vec<IsolatedElementHighlightConfig>) -> SetShowIsolatedElementsParamsBuilder {
2716        SetShowIsolatedElementsParamsBuilder {
2717            isolated_element_highlight_configs: isolated_element_highlight_configs,
2718        }
2719    }
2720    /// An array of node identifiers and descriptors for the highlight appearance.
2721    pub fn isolated_element_highlight_configs(&self) -> &[IsolatedElementHighlightConfig] { &self.isolated_element_highlight_configs }
2722}
2723
2724
2725pub struct SetShowIsolatedElementsParamsBuilder {
2726    isolated_element_highlight_configs: Vec<IsolatedElementHighlightConfig>,
2727}
2728
2729impl SetShowIsolatedElementsParamsBuilder {
2730    pub fn build(self) -> SetShowIsolatedElementsParams {
2731        SetShowIsolatedElementsParams {
2732            isolated_element_highlight_configs: self.isolated_element_highlight_configs,
2733        }
2734    }
2735}
2736
2737impl SetShowIsolatedElementsParams { pub const METHOD: &'static str = "Overlay.setShowIsolatedElements"; }
2738
2739impl<'a> crate::CdpCommand<'a> for SetShowIsolatedElementsParams {
2740    const METHOD: &'static str = "Overlay.setShowIsolatedElements";
2741    type Response = crate::EmptyReturns;
2742}
2743
2744/// Show Window Controls Overlay for PWA
2745
2746#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2747#[serde(rename_all = "camelCase")]
2748pub struct SetShowWindowControlsOverlayParams<'a> {
2749    /// Window Controls Overlay data, null means hide Window Controls Overlay
2750    #[serde(skip_serializing_if = "Option::is_none", rename = "windowControlsOverlayConfig")]
2751    window_controls_overlay_config: Option<WindowControlsOverlayConfig<'a>>,
2752}
2753
2754impl<'a> SetShowWindowControlsOverlayParams<'a> {
2755    /// Creates a builder for this type.
2756    pub fn builder() -> SetShowWindowControlsOverlayParamsBuilder<'a> {
2757        SetShowWindowControlsOverlayParamsBuilder {
2758            window_controls_overlay_config: None,
2759        }
2760    }
2761    /// Window Controls Overlay data, null means hide Window Controls Overlay
2762    pub fn window_controls_overlay_config(&self) -> Option<&WindowControlsOverlayConfig<'a>> { self.window_controls_overlay_config.as_ref() }
2763}
2764
2765#[derive(Default)]
2766pub struct SetShowWindowControlsOverlayParamsBuilder<'a> {
2767    window_controls_overlay_config: Option<WindowControlsOverlayConfig<'a>>,
2768}
2769
2770impl<'a> SetShowWindowControlsOverlayParamsBuilder<'a> {
2771    /// Window Controls Overlay data, null means hide Window Controls Overlay
2772    pub fn window_controls_overlay_config(mut self, window_controls_overlay_config: WindowControlsOverlayConfig<'a>) -> Self { self.window_controls_overlay_config = Some(window_controls_overlay_config); self }
2773    pub fn build(self) -> SetShowWindowControlsOverlayParams<'a> {
2774        SetShowWindowControlsOverlayParams {
2775            window_controls_overlay_config: self.window_controls_overlay_config,
2776        }
2777    }
2778}
2779
2780impl<'a> SetShowWindowControlsOverlayParams<'a> { pub const METHOD: &'static str = "Overlay.setShowWindowControlsOverlay"; }
2781
2782impl<'a> crate::CdpCommand<'a> for SetShowWindowControlsOverlayParams<'a> {
2783    const METHOD: &'static str = "Overlay.setShowWindowControlsOverlay";
2784    type Response = crate::EmptyReturns;
2785}