#[derive(Clone, Debug, Default)]
pub struct CtDest {
pub r#type: CtDestType,
pub page_id: StRefId,
pub left: Option<f64>,
pub top: Option<f64>,
pub right: Option<f64>,
pub bottom: Option<f64>,
pub zoom: Option<f64>,
}
#[derive(Clone, Debug, Default)]
pub struct CtPageArea {
pub physical_box: StBox,
pub application_box: Option<StBox>,
pub content_box: Option<StBox>,
pub bleed_box: Option<StBox>,
}
#[derive(Clone, Debug, Default)]
pub struct Bookmark {
pub name: String,
}
#[derive(Clone, Debug)]
pub enum GotoContentChoice {
Dest(Box<CtDest>),
Bookmark(Box<Bookmark>),
}
#[derive(Clone, Debug, Default)]
pub struct Goto {
pub xml_children: Vec<GotoContentChoice>,
}
#[derive(Clone, Debug, Default)]
pub struct Uri {
pub uri: String,
pub base: Option<String>,
pub target: Option<String>,
}
#[derive(Clone, Debug, Default)]
pub struct GotoA {
pub attach_id: String,
pub new_window: Option<bool>,
}
#[derive(Clone, Debug, Default)]
pub struct Sound {
pub resource_id: StRefId,
pub volume: Option<i32>,
pub repeat: Option<bool>,
pub synchronous: Option<bool>,
}
#[derive(Clone, Debug, Default)]
pub struct Movie {
pub resource_id: StRefId,
pub operator: Option<MovieOperator>,
}
#[derive(Clone, Debug)]
pub enum CtActionContentChoice {
Goto(Box<Goto>),
Uri(Box<Uri>),
GotoA(Box<GotoA>),
Sound(Box<Sound>),
Movie(Box<Movie>),
}
#[derive(Clone, Debug, Default)]
pub struct CtAction {
pub event: CtActionEvent,
pub region: Option<CtRegion>,
pub xml_children: Vec<CtActionContentChoice>,
}
#[derive(Clone, Debug, Default)]
pub struct Move {
pub point1: StPos,
}
#[derive(Clone, Debug, Default)]
pub struct Line {
pub point1: StPos,
}
#[derive(Clone, Debug, Default)]
pub struct QuadraticBezier {
pub point1: StPos,
pub point2: StPos,
}
#[derive(Clone, Debug, Default)]
pub struct CubicBezier {
pub point1: Option<StPos>,
pub point2: Option<StPos>,
pub point3: StPos,
}
#[derive(Clone, Debug, Default)]
pub struct Arc {
pub sweep_direction: bool,
pub large_arc: bool,
pub rotation_angle: f64,
pub ellipse_size: StArray,
pub end_point: StPos,
}
#[derive(Clone, Debug, Default)]
pub struct Close {}
#[derive(Clone, Debug)]
pub enum AreaContentChoice {
Move(Box<Move>),
Line(Box<Line>),
QuadraticBezier(Box<QuadraticBezier>),
CubicBezier(Box<CubicBezier>),
Arc(Box<Arc>),
Close(Box<Close>),
}
#[derive(Clone, Debug, Default)]
pub struct Area {
pub start: StPos,
pub xml_children: Vec<AreaContentChoice>,
}
#[derive(Clone, Debug, Default)]
pub struct CtRegion {
pub area: Vec<Area>,
}
pub type StId = u32;
pub type StRefId = u32;
pub type StLoc = String;
pub type StArray = String;
pub type StPos = String;
pub type StBox = String;
#[derive(Clone, Debug, Default)]
pub struct Region(pub CtRegion);
impl From<CtRegion> for Region {
fn from(value: CtRegion) -> Self {
Self(value)
}
}
impl From<Region> for CtRegion {
fn from(value: Region) -> Self {
value.0
}
}
impl std::ops::Deref for Region {
type Target = CtRegion;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for Region {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[derive(Clone, Debug, Default)]
pub struct Dest(pub CtDest);
impl From<CtDest> for Dest {
fn from(value: CtDest) -> Self {
Self(value)
}
}
impl From<Dest> for CtDest {
fn from(value: Dest) -> Self {
value.0
}
}
impl std::ops::Deref for Dest {
type Target = CtDest;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for Dest {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[derive(Clone, Debug, Default)]
pub enum CtDestType {
#[default]
Xyz,
Fit,
FitH,
FitV,
FitR,
}
#[derive(Clone, Debug, Default)]
pub enum MovieOperator {
#[default]
Play,
Stop,
Pause,
Resume,
}
#[derive(Clone, Debug, Default)]
pub enum CtActionEvent {
#[default]
Do,
Po,
Click,
}