spreadsheet_ods/format/
stylemap.rs1use crate::condition::ValueCondition;
6use get_size::GetSize;
7use get_size_derive::GetSize;
8
9#[derive(Clone, Debug, Default, GetSize)]
11pub struct ValueStyleMap {
12 condition: ValueCondition,
13 applied_style: String, }
15
16impl ValueStyleMap {
17 pub fn new<T: AsRef<str>>(condition: ValueCondition, applied_style: T) -> Self {
20 Self {
21 condition,
22 applied_style: applied_style.as_ref().to_string(),
23 }
24 }
25
26 pub fn condition(&self) -> &ValueCondition {
28 &self.condition
29 }
30
31 pub fn set_condition(&mut self, cond: ValueCondition) {
33 self.condition = cond;
34 }
35
36 pub fn applied_style(&self) -> &String {
38 &self.applied_style
39 }
40
41 pub fn set_applied_style<S: AsRef<str>>(&mut self, style: S) {
43 self.applied_style = style.as_ref().to_string();
44 }
45}