use crate::core::units::Twip;
use super::document::BlockElement;
use super::formatting::Justification;
#[derive(Debug, Clone)]
pub struct Table {
pub properties: Option<TableProperties>,
pub grid: Vec<Twip>,
pub rows: Vec<TableRow>,
}
#[derive(Debug, Clone)]
pub struct TableRow {
pub properties: Option<TableRowProperties>,
pub cells: Vec<TableCell>,
}
#[derive(Debug, Clone)]
pub struct TableCell {
pub properties: Option<TableCellProperties>,
pub content: Vec<BlockElement>,
}
#[derive(Debug, Clone, Default)]
pub struct TableProperties {
pub width: Option<TableWidth>,
pub justification: Option<Justification>,
pub style_id: Option<String>,
}
#[derive(Debug, Clone, Default)]
pub struct TableRowProperties {
pub is_header: bool,
}
#[derive(Debug, Clone, Default)]
pub struct TableCellProperties {
pub width: Option<TableWidth>,
pub vertical_merge: Option<MergeType>,
pub grid_span: Option<u32>,
pub shading: Option<Shading>,
}
#[derive(Debug, Clone)]
pub struct TableWidth {
pub value: i32,
pub width_type: TableWidthType,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TableWidthType {
Pct,
Dxa,
Auto,
Nil,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum MergeType {
Restart,
Continue,
}
#[derive(Debug, Clone)]
pub struct Shading {
pub fill: Option<String>,
pub color: Option<String>,
pub pattern: Option<String>,
}