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