use super::element::{Element, ElementBase};
use crate::common::Result;
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub struct DrawPage {
element: Element,
}
impl DrawPage {
#[allow(dead_code)]
pub fn new() -> Self {
Self {
element: Element::new("draw:page"),
}
}
#[allow(dead_code)]
pub fn name(&self) -> Option<&str> {
self.element.get_attribute("draw:name")
}
#[allow(dead_code)]
pub fn set_name(&mut self, name: &str) {
self.element.set_attribute("draw:name", name);
}
#[allow(dead_code)]
pub fn style_name(&self) -> Option<&str> {
self.element.get_attribute("draw:style-name")
}
}
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub struct TextBox {
element: Element,
}
#[allow(dead_code)]
impl TextBox {
pub fn new() -> Self {
Self {
element: Element::new("draw:text-box"),
}
}
pub fn text(&self) -> Result<String> {
Ok(self.element.get_text_recursive())
}
}
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub struct Image {
element: Element,
}
#[allow(dead_code)]
impl Image {
pub fn new() -> Self {
Self {
element: Element::new("draw:image"),
}
}
pub fn href(&self) -> Option<&str> {
self.element.get_attribute("xlink:href")
}
}