2023-09-06 11:00:19 -04:00
|
|
|
use std::collections::BTreeSet;
|
|
|
|
|
2023-09-04 16:29:41 -04:00
|
|
|
use super::FileAccessInterface;
|
|
|
|
use super::LocalFileAccessInterface;
|
2023-09-04 12:28:33 -04:00
|
|
|
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
|
|
|
|
|
2023-09-04 12:28:33 -04:00
|
|
|
#[derive(Debug, Clone)]
|
2023-09-11 13:13:28 -04:00
|
|
|
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>,
|
2023-09-14 00:27:54 -04:00
|
|
|
/// Set to true to allow for plain lists using single letters as the bullet in the same way that numbers are used.
|
|
|
|
///
|
|
|
|
/// Corresponds to the org-list-allow-alphabetical elisp variable.
|
|
|
|
pub org_list_allow_alphabetical: bool,
|
2023-09-02 20:46:17 -04:00
|
|
|
}
|
|
|
|
|
2023-09-04 12:28:33 -04:00
|
|
|
impl<'g, 's> GlobalSettings<'g, 's> {
|
2023-09-11 13:13:28 -04:00
|
|
|
fn new() -> GlobalSettings<'g, 's> {
|
2023-09-04 12:28:33 -04:00
|
|
|
GlobalSettings {
|
|
|
|
radio_targets: Vec::new(),
|
2023-09-04 21:46:40 -04:00
|
|
|
file_access: &LocalFileAccessInterface {
|
|
|
|
working_directory: None,
|
|
|
|
},
|
2023-09-06 11:00:19 -04:00
|
|
|
in_progress_todo_keywords: BTreeSet::new(),
|
2023-09-06 11:48:24 -04:00
|
|
|
complete_todo_keywords: BTreeSet::new(),
|
2023-09-14 00:27:54 -04:00
|
|
|
org_list_allow_alphabetical: false,
|
2023-09-04 12:28:33 -04:00
|
|
|
}
|
2023-09-02 20:46:17 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-04 12:28:33 -04:00
|
|
|
impl<'g, 's> Default for GlobalSettings<'g, 's> {
|
2023-09-04 16:29:41 -04:00
|
|
|
fn default() -> GlobalSettings<'g, 's> {
|
2023-09-02 20:46:17 -04:00
|
|
|
GlobalSettings::new()
|
|
|
|
}
|
|
|
|
}
|