use lopdf;
use std::collections::HashMap;
#[derive(Default, Debug, Copy, Clone)]
pub struct Pattern {}
impl Pattern {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Debug)]
pub struct PatternRef {
pub(crate) name: String,
}
impl PatternRef {
pub fn new(index: usize) -> Self {
Self {
name: format!("PT{index}"),
}
}
}
#[derive(Default, Debug, Clone)]
pub struct PatternList {
patterns: HashMap<String, Pattern>,
}
impl PatternList {
pub fn new() -> Self {
Self {
patterns: HashMap::new(),
}
}
pub fn add_pattern(&mut self, pattern: Pattern) -> PatternRef {
let len = self.patterns.len();
let pattern_ref = PatternRef::new(len);
self.patterns.insert(pattern_ref.name.clone(), pattern);
pattern_ref
}
}
impl From<PatternList> for lopdf::Dictionary {
fn from(_val: PatternList) -> Self {
lopdf::Dictionary::new()
}
}