pub unsafe trait NSOpenSavePanelDelegate: NSObjectProtocol + MainThreadOnly {
// Provided methods
unsafe fn panel_shouldEnableURL(
&self,
sender: &AnyObject,
url: &NSURL,
) -> bool
where Self: Sized + Message { ... }
unsafe fn panel_validateURL_error(
&self,
sender: &AnyObject,
url: &NSURL,
) -> Result<(), Retained<NSError>>
where Self: Sized + Message { ... }
unsafe fn panel_didChangeToDirectoryURL(
&self,
sender: &AnyObject,
url: Option<&NSURL>,
)
where Self: Sized + Message { ... }
unsafe fn panel_userEnteredFilename_confirmed(
&self,
sender: &AnyObject,
filename: &NSString,
ok_flag: bool,
) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
unsafe fn panel_willExpand(&self, sender: &AnyObject, expanding: bool)
where Self: Sized + Message { ... }
unsafe fn panelSelectionDidChange(&self, sender: Option<&AnyObject>)
where Self: Sized + Message { ... }
}NSSavePanel only.Expand description
Provided Methods§
Sourceunsafe fn panel_shouldEnableURL(&self, sender: &AnyObject, url: &NSURL) -> bool
unsafe fn panel_shouldEnableURL(&self, sender: &AnyObject, url: &NSURL) -> bool
Optional — Enabling URLs.
NSSavePanel: This method is not sent. All urls are always disabled.
NSOpenPanel: Return YES to allow the url to be enabled in the panel. Delegate implementations should be fast to avoid stalling the UI. Applications linked on Mac OS 10.7 and later should be prepared to handle non-file URL schemes.
§Safety
sender should be of the correct type.
Sourceunsafe fn panel_validateURL_error(
&self,
sender: &AnyObject,
url: &NSURL,
) -> Result<(), Retained<NSError>>
unsafe fn panel_validateURL_error( &self, sender: &AnyObject, url: &NSURL, ) -> Result<(), Retained<NSError>>
Optional — URL validation for saving and opening files.
NSSavePanel: Sent once by the save panel when the user clicks the Save button. The user is intending to save a file at url. Return YES if the url is a valid location to save to. Return NO and return by reference outError with a user displayable error message for why the url is not valid. If a recovery option is provided by the error, and recovery succeeded, the panel will attempt to close again.
- Note: An item at
urlmay not physically exist yet, unless the user decided to overwrite an existing item.NSOpenPanel: Sent once for each selected filename (or directory) when the user chooses the Open button. ReturnYESif theurlis acceptable to open. ReturnNOand return by referenceoutErrorwith a user displayable message for why theurlis not valid for opening. If a recovery option is provided by the error, and recovery succeeded, the panel will attempt to close again. - Note: Implement this delegate method instead of
panel:shouldEnableURL:if the processing of the selected item takes a long time.
§Safety
sender should be of the correct type.
Sourceunsafe fn panel_didChangeToDirectoryURL(
&self,
sender: &AnyObject,
url: Option<&NSURL>,
)
unsafe fn panel_didChangeToDirectoryURL( &self, sender: &AnyObject, url: Option<&NSURL>, )
Optional — Sent when the user selected the directory located at url. url may be nil. if the current directory can’t be represented by an NSURL object (ie: the media sidebar directory, or the “Computer”).
§Safety
sender should be of the correct type.
Sourceunsafe fn panel_userEnteredFilename_confirmed(
&self,
sender: &AnyObject,
filename: &NSString,
ok_flag: bool,
) -> Option<Retained<NSString>>
unsafe fn panel_userEnteredFilename_confirmed( &self, sender: &AnyObject, filename: &NSString, ok_flag: bool, ) -> Option<Retained<NSString>>
Optional — Filename customization for the NSSavePanel. Allows the delegate to customize the filename entered by the user, before the extension is appended, and before the user is potentially asked to replace a file.
§Safety
sender should be of the correct type.
Sourceunsafe fn panel_willExpand(&self, sender: &AnyObject, expanding: bool)
unsafe fn panel_willExpand(&self, sender: &AnyObject, expanding: bool)
Optional — Sent when the user clicks the disclosure triangle to expand or collapse the file browser while in NSOpenPanel.
§Safety
sender should be of the correct type.
Trait Implementations§
Source§impl ProtocolType for dyn NSOpenSavePanelDelegate
impl ProtocolType for dyn NSOpenSavePanelDelegate
impl<T> ImplementedBy<T> for dyn NSOpenSavePanelDelegate
Implementations on Foreign Types§
impl<T> NSOpenSavePanelDelegate for ProtocolObject<T>where
T: ?Sized + NSOpenSavePanelDelegate,
Implementors§
impl NSOpenSavePanelDelegate for NSPathCell
NSPathCell only.