2020-02-28 13:34:34 +11:00
|
|
|
//! A trait that you can implement to handle open and save file dialogs. This more or less maps
|
|
|
|
//! over to `NSOpenPanel` and `NSSavePanel` handling.
|
|
|
|
|
|
|
|
pub trait OpenSaveController {
|
|
|
|
/// Called when the user has entered a filename (typically, during saving). `confirmed`
|
|
|
|
/// indicates whether or not they hit the save button.
|
2020-03-01 10:34:07 +11:00
|
|
|
fn user_entered_filename(&self, _filename: &str, _confirmed: bool) {}
|
2020-02-28 13:34:34 +11:00
|
|
|
|
|
|
|
/// Notifies you that the panel selection changed.
|
|
|
|
fn panel_selection_did_change(&self) {}
|
|
|
|
|
|
|
|
/// Notifies you that the user changed directories.
|
2020-03-01 10:34:07 +11:00
|
|
|
fn did_change_to_directory(&self, _url: &str) {}
|
2020-02-28 13:34:34 +11:00
|
|
|
|
|
|
|
/// Notifies you that the Save panel is about to expand or collapse because the user
|
|
|
|
/// clicked the disclosure triangle that displays or hides the file browser.
|
2020-03-01 10:34:07 +11:00
|
|
|
fn will_expand(&self, _expanding: bool) {}
|
2020-02-28 13:34:34 +11:00
|
|
|
|
|
|
|
/// Determine whether the specified URL should be enabled in the Open panel.
|
2020-03-01 10:34:07 +11:00
|
|
|
fn should_enable_url(&self, _url: &str) -> bool { true }
|
2020-02-28 13:34:34 +11:00
|
|
|
}
|