cdx_core/presentation/
mod.rs1mod continuous;
24mod layout;
25mod notes;
26mod paginated;
27mod precise;
28mod print;
29mod responsive;
30mod style;
31mod toc;
32mod typography;
33
34pub use continuous::{Continuous, Section};
35pub use layout::{ColumnLayout, GridArea, GridLayout};
36pub use notes::{EndnotesConfig, FootnotePosition, FootnoteSeparator, FootnotesConfig};
37pub use paginated::{FlowElement, Margins, PageElement, PageSize, Paginated, Position};
38pub use precise::{
39 FontMetrics, LineInfo, PageRegion, PageTemplate, PreciseLayout, PrecisePage,
40 PrecisePageElement, PrecisePageSize,
41};
42pub use print::{
43 AlternateColor, BleedBox, ColorSpace, CropMarkStyle, MasterElementType, MasterPage,
44 MasterPageElement, MasterPageRegion, OutputIntent, PageBox, PdfXCompliance, PdfXLevel,
45 PlaceholderDefinition, PlaceholderType, PrintSpecification, RegionAlignment, SpotColor,
46 SpotColorType,
47};
48pub use responsive::{Breakpoint, Responsive, ResponsiveDefaults, ResponsiveStyle};
49pub use style::{
50 Color, CssValue, FontWeight, Scale, Style, StyleMap, TextAlign, Transform, TransformOrigin,
51 WritingMode,
52};
53pub use toc::{TocConfig, TocLeaders};
54pub use typography::{
55 BaselineGrid, HyphenationConfig, LineNumbering, LineNumberingRestart, LineNumberingSide,
56 TypographyConfig,
57};
58
59#[derive(Debug, Clone, Copy, PartialEq, Eq, strum::Display)]
61#[strum(serialize_all = "lowercase")]
62pub enum PresentationType {
63 Paginated,
65 Continuous,
67 Responsive,
69 Precise,
72}
73
74impl PresentationType {
75 #[must_use]
77 pub const fn as_str(&self) -> &'static str {
78 match self {
79 Self::Paginated => "paginated",
80 Self::Continuous => "continuous",
81 Self::Responsive => "responsive",
82 Self::Precise => "precise",
83 }
84 }
85
86 #[must_use]
88 pub const fn is_reactive(&self) -> bool {
89 matches!(self, Self::Paginated | Self::Continuous | Self::Responsive)
90 }
91
92 #[must_use]
94 pub const fn is_precise(&self) -> bool {
95 matches!(self, Self::Precise)
96 }
97}