1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use std::collections::BTreeSet;

use super::FileAccessInterface;
use super::LocalFileAccessInterface;
use crate::types::Object;

// TODO: Ultimately, I think we'll need most of this: https://orgmode.org/manual/In_002dbuffer-Settings.html

#[derive(Debug, Clone)]
pub struct GlobalSettings<'g, 's> {
    pub radio_targets: Vec<&'g Vec<Object<'s>>>,
    pub file_access: &'g dyn FileAccessInterface,
    pub in_progress_todo_keywords: BTreeSet<String>,
    pub complete_todo_keywords: BTreeSet<String>,
}

impl<'g, 's> GlobalSettings<'g, 's> {
    pub fn new() -> GlobalSettings<'g, 's> {
        GlobalSettings {
            radio_targets: Vec::new(),
            file_access: &LocalFileAccessInterface {
                working_directory: None,
            },
            in_progress_todo_keywords: BTreeSet::new(),
            complete_todo_keywords: BTreeSet::new(),
        }
    }
}

impl<'g, 's> Default for GlobalSettings<'g, 's> {
    fn default() -> GlobalSettings<'g, 's> {
        GlobalSettings::new()
    }
}