organic/src/context/global_settings.rs

35 lines
1020 B
Rust
Raw Normal View History

2023-09-06 11:00:19 -04:00
use std::collections::BTreeSet;
use super::FileAccessInterface;
use super::LocalFileAccessInterface;
use crate::types::Object;
2023-09-04 12:31:43 -04:00
// TODO: Ultimately, I think we'll need most of this: https://orgmode.org/manual/In_002dbuffer-Settings.html
#[derive(Debug, Clone)]
2023-09-04 13:26:11 -04:00
pub struct GlobalSettings<'g, 's> {
pub radio_targets: Vec<&'g Vec<Object<'s>>>,
pub file_access: &'g dyn FileAccessInterface,
2023-09-06 11:00:19 -04:00
pub in_progress_todo_keywords: BTreeSet<String>,
pub complete_todo_keywords: BTreeSet<String>,
2023-09-02 20:46:17 -04:00
}
impl<'g, 's> GlobalSettings<'g, 's> {
pub fn new() -> GlobalSettings<'g, 's> {
GlobalSettings {
radio_targets: Vec::new(),
file_access: &LocalFileAccessInterface {
working_directory: None,
},
2023-09-06 11:00:19 -04:00
in_progress_todo_keywords: BTreeSet::new(),
complete_todo_keywords: BTreeSet::new()
}
2023-09-02 20:46:17 -04:00
}
}
impl<'g, 's> Default for GlobalSettings<'g, 's> {
fn default() -> GlobalSettings<'g, 's> {
2023-09-02 20:46:17 -04:00
GlobalSettings::new()
}
}