Skip to main content

appcore_filemaker/
resolved_table.rs

1// =============================================================================
2//        #######
3//     ###       ###     F: resolved_table.rs
4//    ##   ## ##   ##    P: AppCore-Runtime
5//         ## ##
6//                       C: 2026/08/30 05:00:00 by dnettoRaw
7//    ##   ## ##   ##    U: 2026/08/30 05:00:00 by dnettoRaw
8//      ###########      S: 1.0.2-rc
9// =============================================================================
10
11use serde::{Deserialize, Serialize};
12
13use crate::{ComputedStyle, Rect, ResolvedTableColumn, TextLayout};
14
15/// One exporter-ready table cell with final geometry and shaped text.
16#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
17pub struct ResolvedTableCell {
18    /// Stable source field.
19    pub field: String,
20    /// Display text derived before export.
21    pub text: String,
22    /// Cell rectangle in page coordinates.
23    pub bounds: Rect,
24    /// Final style after the data-rule layer.
25    pub style: ComputedStyle,
26    /// Shaped text constrained to the cell.
27    pub text_layout: TextLayout,
28}
29
30/// One exporter-ready table row.
31#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
32pub struct ResolvedTableRow {
33    /// Zero-based source row index across fragments.
34    pub source_index: u64,
35    /// Row rectangle in page coordinates.
36    pub bounds: Rect,
37    /// Group key when this row begins a group.
38    pub group_start: Option<String>,
39    /// Final row style after ordered conditional rules.
40    pub style: ComputedStyle,
41    /// Cells in visual column order.
42    pub cells: Vec<ResolvedTableCell>,
43}
44
45/// One physical-page fragment of a first-class table.
46#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
47pub struct ResolvedTableFragment {
48    /// Zero-based fragment index.
49    pub index: usize,
50    /// Final column widths shared by every fragment.
51    pub columns: Vec<ResolvedTableColumn>,
52    /// Header cells, empty when the header is not repeated.
53    pub header: Vec<ResolvedTableCell>,
54    /// Bounded rows assigned to this fragment.
55    pub rows: Vec<ResolvedTableRow>,
56    /// Final exact totals row, empty before the last fragment.
57    pub totals: Vec<ResolvedTableCell>,
58    /// Group active at the first row of this fragment.
59    pub starting_group: Option<String>,
60}