use std::collections::HashMap;
use super::identifiers::StyleId;
use super::paragraph::ParagraphProperties;
use super::run_properties::RunProperties;
use super::table::{TableCellProperties, TableProperties, TableRowProperties};
#[derive(Clone, Debug, Default)]
pub struct StyleSheet {
pub doc_defaults_paragraph: ParagraphProperties,
pub doc_defaults_run: RunProperties,
pub styles: HashMap<StyleId, Style>,
pub latent_styles: Option<LatentStyles>,
}
#[derive(Clone, Debug)]
pub struct LatentStyles {
pub default_locked_state: Option<bool>,
pub default_ui_priority: Option<u32>,
pub default_semi_hidden: Option<bool>,
pub default_unhide_when_used: Option<bool>,
pub default_q_format: Option<bool>,
pub count: Option<u32>,
pub exceptions: Vec<LatentStyleException>,
}
#[derive(Clone, Debug)]
pub struct LatentStyleException {
pub name: Option<String>,
pub locked: Option<bool>,
pub ui_priority: Option<u32>,
pub semi_hidden: Option<bool>,
pub unhide_when_used: Option<bool>,
pub q_format: Option<bool>,
}
#[derive(Clone, Debug)]
pub struct Style {
pub name: Option<String>,
pub style_type: StyleType,
pub based_on: Option<StyleId>,
pub is_default: bool,
pub paragraph_properties: Option<ParagraphProperties>,
pub run_properties: Option<RunProperties>,
pub table_properties: Option<TableProperties>,
pub table_style_overrides: Vec<TableStyleOverride>,
}
#[derive(Clone, Debug)]
pub struct TableStyleOverride {
pub override_type: TableStyleOverrideType,
pub paragraph_properties: Option<ParagraphProperties>,
pub run_properties: Option<RunProperties>,
pub table_properties: Option<TableProperties>,
pub table_row_properties: Option<TableRowProperties>,
pub table_cell_properties: Option<TableCellProperties>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TableStyleOverrideType {
FirstRow,
LastRow,
FirstCol,
LastCol,
Band1Vert,
Band2Vert,
Band1Horz,
Band2Horz,
NeCell,
NwCell,
SeCell,
SwCell,
WholeTable,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum StyleType {
Paragraph,
Character,
Table,
Numbering,
}