#[derive(Clone, Debug, Default)]
pub struct TemplatePage {
pub id: crate::schemas::definitions::StId,
pub name: Option<String>,
pub z_order: Option<TemplatePageZOrder>,
pub base_loc: crate::schemas::definitions::StLoc,
}
#[derive(Clone, Debug, Default)]
pub struct CommonData {
pub max_unit_id: crate::schemas::definitions::StId,
pub page_area: crate::schemas::definitions::CtPageArea,
pub public_res: Vec<crate::schemas::definitions::StLoc>,
pub document_res: Vec<crate::schemas::definitions::StLoc>,
pub template_page: Vec<TemplatePage>,
pub default_cs: Option<crate::schemas::definitions::StRefId>,
}
#[derive(Clone, Debug, Default)]
pub struct Page {
pub id: crate::schemas::definitions::StId,
pub base_loc: crate::schemas::definitions::StLoc,
}
#[derive(Clone, Debug, Default)]
pub struct Pages {
pub page: Vec<Page>,
}
#[derive(Clone, Debug, Default)]
pub struct Outlines {
pub outline_elem: Vec<CtOutlineElem>,
}
#[derive(Clone, Debug, Default)]
pub struct Actions {
pub action: Vec<crate::schemas::definitions::CtAction>,
}
#[derive(Clone, Debug, Default)]
pub struct Bookmarks {
pub bookmark: Vec<CtBookmark>,
}
#[derive(Clone, Debug, Default)]
pub struct Document {
pub common_data: CommonData,
pub pages: Pages,
pub outlines: Option<Outlines>,
pub permissions: Option<CtPermission>,
pub actions: Option<Actions>,
pub v_preferences: Option<CtVPreferences>,
pub bookmarks: Option<Bookmarks>,
pub annotations: Option<crate::schemas::definitions::StLoc>,
pub custom_tags: Option<crate::schemas::definitions::StLoc>,
pub attachments: Option<crate::schemas::definitions::StLoc>,
pub extensions: Option<crate::schemas::definitions::StLoc>,
}
#[derive(Clone, Debug, Default)]
pub struct Print {
pub printable: bool,
pub copies: Option<i32>,
}
#[derive(Clone, Debug, Default)]
pub struct ValidPeriod {
pub start_date: Option<String>,
pub end_date: Option<String>,
}
#[derive(Clone, Debug, Default)]
pub struct CtPermission {
pub edit: Option<bool>,
pub annot: Option<bool>,
pub export: Option<bool>,
pub signature: Option<bool>,
pub watermark: Option<bool>,
pub print_screen: Option<bool>,
pub print: Option<Print>,
pub valid_period: Option<ValidPeriod>,
}
#[derive(Clone, Debug)]
pub enum CtVPreferencesContentChoice {
ZoomMode(Box<ZoomMode>),
Zoom(Box<f64>),
}
#[derive(Clone, Debug, Default)]
pub struct CtVPreferences {
pub page_mode: Option<PageMode>,
pub page_layout: Option<PageLayout>,
pub tab_display: Option<TabDisplay>,
pub hide_toolbar: Option<bool>,
pub hide_menubar: Option<bool>,
pub hide_window_ui: Option<bool>,
pub xml_children: Vec<CtVPreferencesContentChoice>,
}
#[derive(Clone, Debug, Default)]
pub struct CtOutlineElem {
pub title: String,
pub count: Option<i32>,
pub expanded: Option<bool>,
pub actions: Option<Actions>,
pub outline_elem: Vec<CtOutlineElem>,
}
#[derive(Clone, Debug, Default)]
pub struct CtBookmark {
pub name: String,
pub dest: crate::schemas::definitions::CtDest,
}
#[derive(Clone, Debug, Default)]
pub struct PageArea(pub crate::schemas::definitions::CtPageArea);
impl From<crate::schemas::definitions::CtPageArea> for PageArea {
fn from(value: crate::schemas::definitions::CtPageArea) -> Self {
Self(value)
}
}
impl From<PageArea> for crate::schemas::definitions::CtPageArea {
fn from(value: PageArea) -> Self {
value.0
}
}
impl std::ops::Deref for PageArea {
type Target = crate::schemas::definitions::CtPageArea;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for PageArea {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[derive(Clone, Debug, Default)]
pub struct OutlineElem(pub CtOutlineElem);
impl From<CtOutlineElem> for OutlineElem {
fn from(value: CtOutlineElem) -> Self {
Self(value)
}
}
impl From<OutlineElem> for CtOutlineElem {
fn from(value: OutlineElem) -> Self {
value.0
}
}
impl std::ops::Deref for OutlineElem {
type Target = CtOutlineElem;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for OutlineElem {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[derive(Clone, Debug, Default)]
pub struct Permissions(pub CtPermission);
impl From<CtPermission> for Permissions {
fn from(value: CtPermission) -> Self {
Self(value)
}
}
impl From<Permissions> for CtPermission {
fn from(value: Permissions) -> Self {
value.0
}
}
impl std::ops::Deref for Permissions {
type Target = CtPermission;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for Permissions {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[derive(Clone, Debug, Default)]
pub struct Action(pub crate::schemas::definitions::CtAction);
impl From<crate::schemas::definitions::CtAction> for Action {
fn from(value: crate::schemas::definitions::CtAction) -> Self {
Self(value)
}
}
impl From<Action> for crate::schemas::definitions::CtAction {
fn from(value: Action) -> Self {
value.0
}
}
impl std::ops::Deref for Action {
type Target = crate::schemas::definitions::CtAction;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for Action {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[derive(Clone, Debug, Default)]
pub struct VPreferences(pub CtVPreferences);
impl From<CtVPreferences> for VPreferences {
fn from(value: CtVPreferences) -> Self {
Self(value)
}
}
impl From<VPreferences> for CtVPreferences {
fn from(value: VPreferences) -> Self {
value.0
}
}
impl std::ops::Deref for VPreferences {
type Target = CtVPreferences;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for VPreferences {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[derive(Clone, Debug, Default)]
pub struct Bookmark(pub CtBookmark);
impl From<CtBookmark> for Bookmark {
fn from(value: CtBookmark) -> Self {
Self(value)
}
}
impl From<Bookmark> for CtBookmark {
fn from(value: Bookmark) -> Self {
value.0
}
}
impl std::ops::Deref for Bookmark {
type Target = CtBookmark;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for Bookmark {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[derive(Clone, Debug, Default)]
pub struct Dest(pub crate::schemas::definitions::CtDest);
impl From<crate::schemas::definitions::CtDest> for Dest {
fn from(value: crate::schemas::definitions::CtDest) -> Self {
Self(value)
}
}
impl From<Dest> for crate::schemas::definitions::CtDest {
fn from(value: Dest) -> Self {
value.0
}
}
impl std::ops::Deref for Dest {
type Target = crate::schemas::definitions::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 TemplatePageZOrder {
#[default]
Background,
Foreground,
}
#[derive(Clone, Debug, Default)]
pub enum PageMode {
#[default]
None,
FullScreen,
UseOutlines,
UseThumbs,
UseCustomTags,
UseLayers,
UseAttatchs,
UseBookmarks,
}
#[derive(Clone, Debug, Default)]
pub enum PageLayout {
#[default]
OnePage,
OneColumn,
TwoPageL,
TwoColumnL,
TwoPageR,
TwoColumnR,
}
#[derive(Clone, Debug, Default)]
pub enum TabDisplay {
#[default]
DocTitle,
FileName,
}
#[derive(Clone, Debug, Default)]
pub enum ZoomMode {
#[default]
Default,
FitHeight,
FitWidth,
FitRect,
}