Start work on creating and saving new files

This commit is contained in:
Max Brunsfeld
2021-05-04 19:04:11 -07:00
parent 2ce9f271b5
commit 5fd084ec09
10 changed files with 227 additions and 75 deletions
+12 -1
View File
@@ -19,7 +19,13 @@ use crate::{
};
use async_task::Runnable;
pub use event::Event;
use std::{any::Any, ops::Range, path::PathBuf, rc::Rc, sync::Arc};
use std::{
any::Any,
ops::Range,
path::{Path, PathBuf},
rc::Rc,
sync::Arc,
};
pub trait Platform {
fn on_menu_command(&self, callback: Box<dyn FnMut(&str, Option<&dyn Any>)>);
@@ -45,6 +51,11 @@ pub trait Platform {
options: PathPromptOptions,
done_fn: Box<dyn FnOnce(Option<Vec<std::path::PathBuf>>)>,
);
fn prompt_for_new_path(
&self,
directory: &Path,
done_fn: Box<dyn FnOnce(Option<std::path::PathBuf>)>,
);
fn quit(&self);
fn write_to_clipboard(&self, item: ClipboardItem);
fn read_from_clipboard(&self) -> Option<ClipboardItem>;