use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct DjotImportOptions {
pub alignment: bool,
pub line_height: bool,
pub direction: bool,
pub non_breakable_lines: bool,
pub page_break_before: bool,
pub background_color: bool,
pub top_margin: bool,
pub text_indent: bool,
pub semantic_role: bool,
}
impl DjotImportOptions {
pub const fn all() -> Self {
Self {
alignment: true,
line_height: true,
direction: true,
non_breakable_lines: true,
page_break_before: true,
background_color: true,
top_margin: true,
text_indent: true,
semantic_role: true,
}
}
pub const fn none() -> Self {
Self {
alignment: false,
line_height: false,
direction: false,
non_breakable_lines: false,
page_break_before: false,
background_color: false,
top_margin: false,
text_indent: false,
semantic_role: false,
}
}
}
impl Default for DjotImportOptions {
fn default() -> Self {
Self::all()
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct DjotExportOptions {
pub alignment: bool,
pub line_height: bool,
pub direction: bool,
pub non_breakable_lines: bool,
pub page_break_before: bool,
pub background_color: bool,
pub top_margin: bool,
pub text_indent: bool,
pub semantic_role: bool,
#[serde(default)]
pub omit_images: bool,
}
impl DjotExportOptions {
pub const fn all() -> Self {
Self {
alignment: true,
line_height: true,
direction: true,
non_breakable_lines: true,
page_break_before: true,
background_color: true,
top_margin: true,
text_indent: true,
semantic_role: true,
omit_images: false,
}
}
pub const fn none() -> Self {
Self {
alignment: false,
line_height: false,
direction: false,
non_breakable_lines: false,
page_break_before: false,
background_color: false,
top_margin: false,
text_indent: false,
semantic_role: false,
omit_images: false,
}
}
}
impl Default for DjotExportOptions {
fn default() -> Self {
Self::all()
}
}