Struct objc2_app_kit::NSDocument
source · #[repr(C)]pub struct NSDocument { /* private fields */ }
Available on crate feature
NSDocument
only.Implementations§
source§impl NSDocument
impl NSDocument
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>
pub unsafe fn initWithType_error( this: Allocated<Self>, type_name: &NSString ) -> Result<Retained<Self>, Retained<NSError>>
pub unsafe fn canConcurrentlyReadDocumentsOfType( type_name: &NSString, mtm: MainThreadMarker ) -> bool
pub unsafe fn initWithContentsOfURL_ofType_error( this: Allocated<Self>, url: &NSURL, type_name: &NSString ) -> Result<Retained<Self>, Retained<NSError>>
pub unsafe fn initForURL_withContentsOfURL_ofType_error( this: Allocated<Self>, url_or_nil: Option<&NSURL>, contents_url: &NSURL, type_name: &NSString ) -> Result<Retained<Self>, Retained<NSError>>
pub unsafe fn fileType(&self) -> Option<Retained<NSString>>
pub unsafe fn setFileType(&self, file_type: Option<&NSString>)
pub unsafe fn fileURL(&self) -> Option<Retained<NSURL>>
pub unsafe fn setFileURL(&self, file_url: Option<&NSURL>)
pub unsafe fn fileModificationDate(&self) -> Option<Retained<NSDate>>
pub unsafe fn setFileModificationDate( &self, file_modification_date: Option<&NSDate> )
pub unsafe fn isDraft(&self) -> bool
pub unsafe fn setDraft(&self, draft: bool)
pub unsafe fn performActivityWithSynchronousWaiting_usingBlock( &self, wait_synchronously: bool, block: &Block<dyn Fn(NonNull<Block<dyn Fn()>>)> )
Available on crate feature
block2
only.pub unsafe fn continueActivityUsingBlock(&self, block: &Block<dyn Fn() + '_>)
Available on crate feature
block2
only.pub unsafe fn continueAsynchronousWorkOnMainThreadUsingBlock( &self, block: &Block<dyn Fn()> )
Available on crate feature
block2
only.pub unsafe fn performSynchronousFileAccessUsingBlock( &self, block: &Block<dyn Fn() + '_> )
Available on crate feature
block2
only.pub unsafe fn performAsynchronousFileAccessUsingBlock( &self, block: &Block<dyn Fn(NonNull<Block<dyn Fn()>>)> )
Available on crate feature
block2
only.pub unsafe fn revertDocumentToSaved(&self, sender: Option<&AnyObject>)
pub unsafe fn revertToContentsOfURL_ofType_error( &self, url: &NSURL, type_name: &NSString ) -> Result<(), Retained<NSError>>
pub unsafe fn readFromURL_ofType_error( &self, url: &NSURL, type_name: &NSString ) -> Result<(), Retained<NSError>>
pub unsafe fn readFromFileWrapper_ofType_error( &self, file_wrapper: &NSFileWrapper, type_name: &NSString ) -> Result<(), Retained<NSError>>
pub unsafe fn readFromData_ofType_error( &self, data: &NSData, type_name: &NSString ) -> Result<(), Retained<NSError>>
pub unsafe fn isEntireFileLoaded(&self) -> bool
pub unsafe fn writeToURL_ofType_error( &self, url: &NSURL, type_name: &NSString ) -> Result<(), Retained<NSError>>
pub unsafe fn fileWrapperOfType_error( &self, type_name: &NSString ) -> Result<Retained<NSFileWrapper>, Retained<NSError>>
pub unsafe fn dataOfType_error( &self, type_name: &NSString ) -> Result<Retained<NSData>, Retained<NSError>>
pub unsafe fn unblockUserInteraction(&self)
pub unsafe fn autosavingIsImplicitlyCancellable(&self) -> bool
pub unsafe fn writeSafelyToURL_ofType_forSaveOperation_error( &self, url: &NSURL, type_name: &NSString, save_operation: NSSaveOperationType ) -> Result<(), Retained<NSError>>
pub unsafe fn writeToURL_ofType_forSaveOperation_originalContentsURL_error( &self, url: &NSURL, type_name: &NSString, save_operation: NSSaveOperationType, absolute_original_contents_url: Option<&NSURL> ) -> Result<(), Retained<NSError>>
pub unsafe fn fileAttributesToWriteToURL_ofType_forSaveOperation_originalContentsURL_error( &self, url: &NSURL, type_name: &NSString, save_operation: NSSaveOperationType, absolute_original_contents_url: Option<&NSURL> ) -> Result<Retained<NSDictionary<NSString, AnyObject>>, Retained<NSError>>
pub unsafe fn keepBackupFile(&self) -> bool
pub unsafe fn backupFileURL(&self) -> Option<Retained<NSURL>>
pub unsafe fn saveDocument(&self, sender: Option<&AnyObject>)
pub unsafe fn saveDocumentAs(&self, sender: Option<&AnyObject>)
pub unsafe fn saveDocumentTo(&self, sender: Option<&AnyObject>)
pub unsafe fn saveDocumentWithDelegate_didSaveSelector_contextInfo( &self, delegate: Option<&AnyObject>, did_save_selector: Option<Sel>, context_info: *mut c_void )
pub unsafe fn runModalSavePanelForSaveOperation_delegate_didSaveSelector_contextInfo( &self, save_operation: NSSaveOperationType, delegate: Option<&AnyObject>, did_save_selector: Option<Sel>, context_info: *mut c_void )
pub unsafe fn shouldRunSavePanelWithAccessoryView(&self) -> bool
pub unsafe fn prepareSavePanel(&self, save_panel: &NSSavePanel) -> bool
Available on crate features
NSPanel
and NSResponder
and NSSavePanel
and NSWindow
only.pub unsafe fn fileNameExtensionWasHiddenInLastRunSavePanel(&self) -> bool
pub unsafe fn fileTypeFromLastRunSavePanel(&self) -> Option<Retained<NSString>>
pub unsafe fn saveToURL_ofType_forSaveOperation_delegate_didSaveSelector_contextInfo( &self, url: &NSURL, type_name: &NSString, save_operation: NSSaveOperationType, delegate: Option<&AnyObject>, did_save_selector: Option<Sel>, context_info: *mut c_void )
pub unsafe fn saveToURL_ofType_forSaveOperation_completionHandler( &self, url: &NSURL, type_name: &NSString, save_operation: NSSaveOperationType, completion_handler: &Block<dyn Fn(*mut NSError)> )
Available on crate feature
block2
only.pub unsafe fn canAsynchronouslyWriteToURL_ofType_forSaveOperation( &self, url: &NSURL, type_name: &NSString, save_operation: NSSaveOperationType ) -> bool
pub unsafe fn checkAutosavingSafetyAndReturnError( &self ) -> Result<(), Retained<NSError>>
pub unsafe fn scheduleAutosaving(&self)
pub unsafe fn hasUnautosavedChanges(&self) -> bool
pub unsafe fn autosaveDocumentWithDelegate_didAutosaveSelector_contextInfo( &self, delegate: Option<&AnyObject>, did_autosave_selector: Option<Sel>, context_info: *mut c_void )
pub unsafe fn autosaveWithImplicitCancellability_completionHandler( &self, autosaving_is_implicitly_cancellable: bool, completion_handler: &Block<dyn Fn(*mut NSError)> )
Available on crate feature
block2
only.pub unsafe fn autosavesInPlace(mtm: MainThreadMarker) -> bool
pub unsafe fn preservesVersions(mtm: MainThreadMarker) -> bool
pub unsafe fn browseDocumentVersions(&self, sender: Option<&AnyObject>)
pub unsafe fn isBrowsingVersions(&self) -> bool
pub unsafe fn stopBrowsingVersionsWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn()>> )
Available on crate feature
block2
only.pub unsafe fn autosavesDrafts(mtm: MainThreadMarker) -> bool
pub unsafe fn autosavingFileType(&self) -> Option<Retained<NSString>>
pub unsafe fn autosavedContentsFileURL(&self) -> Option<Retained<NSURL>>
pub unsafe fn setAutosavedContentsFileURL( &self, autosaved_contents_file_url: Option<&NSURL> )
pub unsafe fn canCloseDocumentWithDelegate_shouldCloseSelector_contextInfo( &self, delegate: &AnyObject, should_close_selector: Option<Sel>, context_info: *mut c_void )
pub unsafe fn close(&self)
pub unsafe fn duplicateDocument(&self, sender: Option<&AnyObject>)
pub unsafe fn duplicateDocumentWithDelegate_didDuplicateSelector_contextInfo( &self, delegate: Option<&AnyObject>, did_duplicate_selector: Option<Sel>, context_info: *mut c_void )
pub unsafe fn duplicateAndReturnError( &self ) -> Result<Retained<NSDocument>, Retained<NSError>>
pub unsafe fn renameDocument(&self, sender: Option<&AnyObject>)
pub unsafe fn moveDocumentToUbiquityContainer(&self, sender: Option<&AnyObject>)
pub unsafe fn moveDocument(&self, sender: Option<&AnyObject>)
pub unsafe fn moveDocumentWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(Bool)>> )
Available on crate feature
block2
only.pub unsafe fn moveToURL_completionHandler( &self, url: &NSURL, completion_handler: Option<&Block<dyn Fn(*mut NSError)>> )
Available on crate feature
block2
only.pub unsafe fn lockDocument(&self, sender: Option<&AnyObject>)
pub unsafe fn unlockDocument(&self, sender: Option<&AnyObject>)
pub unsafe fn lockDocumentWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(Bool)>> )
Available on crate feature
block2
only.pub unsafe fn lockWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(*mut NSError)>> )
Available on crate feature
block2
only.pub unsafe fn unlockDocumentWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(Bool)>> )
Available on crate feature
block2
only.pub unsafe fn unlockWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(*mut NSError)>> )
Available on crate feature
block2
only.pub unsafe fn isLocked(&self) -> bool
pub unsafe fn runPageLayout(&self, sender: Option<&AnyObject>)
pub unsafe fn runModalPageLayoutWithPrintInfo_delegate_didRunSelector_contextInfo( &self, print_info: &NSPrintInfo, delegate: Option<&AnyObject>, did_run_selector: Option<Sel>, context_info: *mut c_void )
Available on crate feature
NSPrintInfo
only.pub unsafe fn preparePageLayout(&self, page_layout: &NSPageLayout) -> bool
Available on crate feature
NSPageLayout
only.pub unsafe fn shouldChangePrintInfo(&self, new_print_info: &NSPrintInfo) -> bool
Available on crate feature
NSPrintInfo
only.pub unsafe fn printInfo(&self) -> Retained<NSPrintInfo>
Available on crate feature
NSPrintInfo
only.pub unsafe fn setPrintInfo(&self, print_info: &NSPrintInfo)
Available on crate feature
NSPrintInfo
only.pub unsafe fn printDocument(&self, sender: Option<&AnyObject>)
pub unsafe fn printDocumentWithSettings_showPrintPanel_delegate_didPrintSelector_contextInfo( &self, print_settings: &NSDictionary<NSPrintInfoAttributeKey, AnyObject>, show_print_panel: bool, delegate: Option<&AnyObject>, did_print_selector: Option<Sel>, context_info: *mut c_void )
Available on crate feature
NSPrintInfo
only.pub unsafe fn printOperationWithSettings_error( &self, print_settings: &NSDictionary<NSPrintInfoAttributeKey, AnyObject> ) -> Result<Retained<NSPrintOperation>, Retained<NSError>>
Available on crate features
NSPrintInfo
and NSPrintOperation
only.pub unsafe fn runModalPrintOperation_delegate_didRunSelector_contextInfo( &self, print_operation: &NSPrintOperation, delegate: Option<&AnyObject>, did_run_selector: Option<Sel>, context_info: *mut c_void )
Available on crate feature
NSPrintOperation
only.pub unsafe fn saveDocumentToPDF(&self, sender: Option<&AnyObject>)
pub unsafe fn PDFPrintOperation(&self) -> Retained<NSPrintOperation>
Available on crate feature
NSPrintOperation
only.pub unsafe fn allowsDocumentSharing(&self) -> bool
Available on crate features
NSSharingService
and block2
only.pub unsafe fn prepareSharingServicePicker( &self, sharing_service_picker: &NSSharingServicePicker )
Available on crate feature
NSSharingService
only.pub unsafe fn previewRepresentableActivityItems( &self ) -> Option<Retained<NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>>>
Available on crate feature
NSPreviewRepresentingActivityItem
only.pub unsafe fn setPreviewRepresentableActivityItems( &self, preview_representable_activity_items: Option<&NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>> )
Available on crate feature
NSPreviewRepresentingActivityItem
only.pub unsafe fn isDocumentEdited(&self) -> bool
pub unsafe fn isInViewingMode(&self) -> bool
pub unsafe fn updateChangeCount(&self, change: NSDocumentChangeType)
pub unsafe fn changeCountTokenForSaveOperation( &self, save_operation: NSSaveOperationType ) -> Retained<AnyObject>
pub unsafe fn updateChangeCountWithToken_forSaveOperation( &self, change_count_token: &AnyObject, save_operation: NSSaveOperationType )
pub unsafe fn undoManager(&self) -> Option<Retained<NSUndoManager>>
pub unsafe fn setUndoManager(&self, undo_manager: Option<&NSUndoManager>)
pub unsafe fn hasUndoManager(&self) -> bool
pub unsafe fn setHasUndoManager(&self, has_undo_manager: bool)
pub unsafe fn presentError_modalForWindow_delegate_didPresentSelector_contextInfo( &self, error: &NSError, window: &NSWindow, delegate: Option<&AnyObject>, did_present_selector: Option<Sel>, context_info: *mut c_void )
Available on crate features
NSResponder
and NSWindow
only.pub unsafe fn presentError(&self, error: &NSError) -> bool
pub unsafe fn willPresentError(&self, error: &NSError) -> Retained<NSError>
pub unsafe fn willNotPresentError(&self, error: &NSError)
pub unsafe fn makeWindowControllers(&self)
pub unsafe fn windowNibName(&self) -> Option<Retained<NSNibName>>
Available on crate feature
NSNib
only.pub unsafe fn windowControllerWillLoadNib( &self, window_controller: &NSWindowController )
Available on crate features
NSResponder
and NSWindowController
only.pub unsafe fn windowControllerDidLoadNib( &self, window_controller: &NSWindowController )
Available on crate features
NSResponder
and NSWindowController
only.pub unsafe fn setWindow(&self, window: Option<&NSWindow>)
Available on crate features
NSResponder
and NSWindow
only.pub unsafe fn addWindowController(&self, window_controller: &NSWindowController)
Available on crate features
NSResponder
and NSWindowController
only.pub unsafe fn removeWindowController( &self, window_controller: &NSWindowController )
Available on crate features
NSResponder
and NSWindowController
only.pub unsafe fn showWindows(&self)
pub unsafe fn windowControllers(&self) -> Retained<NSArray<NSWindowController>>
Available on crate features
NSResponder
and NSWindowController
only.pub unsafe fn shouldCloseWindowController_delegate_shouldCloseSelector_contextInfo( &self, window_controller: &NSWindowController, delegate: Option<&AnyObject>, should_close_selector: Option<Sel>, context_info: *mut c_void )
Available on crate features
NSResponder
and NSWindowController
only.pub unsafe fn displayName(&self) -> Retained<NSString>
pub unsafe fn defaultDraftName(&self) -> Retained<NSString>
pub unsafe fn windowForSheet(&self) -> Option<Retained<NSWindow>>
Available on crate features
NSResponder
and NSWindow
only.pub unsafe fn readableTypes( mtm: MainThreadMarker ) -> Retained<NSArray<NSString>>
pub unsafe fn writableTypes( mtm: MainThreadMarker ) -> Retained<NSArray<NSString>>
pub unsafe fn isNativeType(type: &NSString, mtm: MainThreadMarker) -> bool
pub unsafe fn writableTypesForSaveOperation( &self, save_operation: NSSaveOperationType ) -> Retained<NSArray<NSString>>
pub unsafe fn fileNameExtensionForType_saveOperation( &self, type_name: &NSString, save_operation: NSSaveOperationType ) -> Option<Retained<NSString>>
pub unsafe fn validateUserInterfaceItem( &self, item: &ProtocolObject<dyn NSValidatedUserInterfaceItem> ) -> bool
Available on crate feature
NSUserInterfaceValidation
only.pub unsafe fn usesUbiquitousStorage(mtm: MainThreadMarker) -> bool
pub unsafe fn presentedItemURL(&self) -> Option<Retained<NSURL>>
pub unsafe fn observedPresentedItemUbiquityAttributes( &self ) -> Retained<NSSet<NSURLResourceKey>>
pub unsafe fn relinquishPresentedItemToReader( &self, reader: &Block<dyn Fn(*mut Block<dyn Fn()>)> )
Available on crate feature
block2
only.pub unsafe fn relinquishPresentedItemToWriter( &self, writer: &Block<dyn Fn(*mut Block<dyn Fn()>)> )
Available on crate feature
block2
only.pub unsafe fn savePresentedItemChangesWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSError)> )
Available on crate feature
block2
only.pub unsafe fn accommodatePresentedItemDeletionWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSError)> )
Available on crate feature
block2
only.pub unsafe fn presentedItemDidMoveToURL(&self, new_url: &NSURL)
pub unsafe fn presentedItemDidChange(&self)
pub unsafe fn presentedItemDidChangeUbiquityAttributes( &self, attributes: &NSSet<NSURLResourceKey> )
pub unsafe fn presentedItemDidGainVersion(&self, version: &NSFileVersion)
pub unsafe fn presentedItemDidLoseVersion(&self, version: &NSFileVersion)
pub unsafe fn presentedItemDidResolveConflictVersion( &self, version: &NSFileVersion )
source§impl NSDocument
impl NSDocument
Methods declared on superclass NSObject
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>
source§impl NSDocument
impl NSDocument
NSDeprecated
pub unsafe fn saveToURL_ofType_forSaveOperation_error( &self, url: &NSURL, type_name: &NSString, save_operation: NSSaveOperationType ) -> Result<(), Retained<NSError>>
👎Deprecated: Use -saveToURL:ofType:forSaveOperation:completionHandler: instead
pub unsafe fn dataRepresentationOfType( &self, type: &NSString ) -> Option<Retained<NSData>>
👎Deprecated
pub unsafe fn fileAttributesToWriteToFile_ofType_saveOperation( &self, full_document_path: &NSString, document_type_name: &NSString, save_operation_type: NSSaveOperationType ) -> Option<Retained<NSDictionary>>
👎Deprecated
pub unsafe fn fileName(&self) -> Option<Retained<NSString>>
👎Deprecated
pub unsafe fn fileWrapperRepresentationOfType( &self, type: &NSString ) -> Option<Retained<NSFileWrapper>>
👎Deprecated
pub unsafe fn initWithContentsOfFile_ofType( this: Allocated<Self>, absolute_path: &NSString, type_name: &NSString ) -> Option<Retained<Self>>
👎Deprecated
pub unsafe fn initWithContentsOfURL_ofType( this: Allocated<Self>, url: &NSURL, type_name: &NSString ) -> Option<Retained<Self>>
👎Deprecated
pub unsafe fn loadDataRepresentation_ofType( &self, data: &NSData, type: &NSString ) -> bool
👎Deprecated
pub unsafe fn loadFileWrapperRepresentation_ofType( &self, wrapper: &NSFileWrapper, type: &NSString ) -> bool
👎Deprecated
pub unsafe fn printShowingPrintPanel(&self, flag: bool)
👎Deprecated
pub unsafe fn readFromFile_ofType( &self, file_name: &NSString, type: &NSString ) -> bool
👎Deprecated
pub unsafe fn readFromURL_ofType(&self, url: &NSURL, type: &NSString) -> bool
👎Deprecated
pub unsafe fn revertToSavedFromFile_ofType( &self, file_name: &NSString, type: &NSString ) -> bool
👎Deprecated
pub unsafe fn revertToSavedFromURL_ofType( &self, url: &NSURL, type: &NSString ) -> bool
👎Deprecated
pub unsafe fn runModalPageLayoutWithPrintInfo( &self, print_info: &NSPrintInfo ) -> NSInteger
👎Deprecated
Available on crate feature
NSPrintInfo
only.pub unsafe fn saveToFile_saveOperation_delegate_didSaveSelector_contextInfo( &self, file_name: &NSString, save_operation: NSSaveOperationType, delegate: Option<&AnyObject>, did_save_selector: Option<Sel>, context_info: *mut c_void )
👎Deprecated
pub unsafe fn setFileName(&self, file_name: Option<&NSString>)
👎Deprecated
pub unsafe fn writeToFile_ofType( &self, file_name: &NSString, type: &NSString ) -> bool
👎Deprecated
pub unsafe fn writeToFile_ofType_originalFile_saveOperation( &self, full_document_path: &NSString, document_type_name: &NSString, full_original_document_path: Option<&NSString>, save_operation_type: NSSaveOperationType ) -> bool
👎Deprecated
pub unsafe fn writeToURL_ofType(&self, url: &NSURL, type: &NSString) -> bool
👎Deprecated
pub unsafe fn writeWithBackupToFile_ofType_saveOperation( &self, full_document_path: &NSString, document_type_name: &NSString, save_operation_type: NSSaveOperationType ) -> bool
👎Deprecated
source§impl NSDocument
impl NSDocument
NSScripting
pub unsafe fn lastComponentOfFileName(&self) -> Retained<NSString>
Available on crate feature
NSDocumentScripting
only.pub unsafe fn setLastComponentOfFileName( &self, last_component_of_file_name: &NSString )
Available on crate feature
NSDocumentScripting
only.pub unsafe fn handleSaveScriptCommand( &self, command: &NSScriptCommand ) -> Option<Retained<AnyObject>>
Available on crate feature
NSDocumentScripting
only.pub unsafe fn handleCloseScriptCommand( &self, command: &NSCloseCommand ) -> Option<Retained<AnyObject>>
Available on crate feature
NSDocumentScripting
only.pub unsafe fn handlePrintScriptCommand( &self, command: &NSScriptCommand ) -> Option<Retained<AnyObject>>
Available on crate feature
NSDocumentScripting
only.pub unsafe fn objectSpecifier(&self) -> Retained<NSScriptObjectSpecifier>
Available on crate feature
NSDocumentScripting
only.source§impl NSDocument
impl NSDocument
NSUserActivity
pub unsafe fn userActivity(&self) -> Option<Retained<NSUserActivity>>
Available on crate feature
NSUserActivity
only.pub unsafe fn setUserActivity(&self, user_activity: Option<&NSUserActivity>)
Available on crate feature
NSUserActivity
only.pub unsafe fn updateUserActivityState(&self, activity: &NSUserActivity)
Available on crate feature
NSUserActivity
only.source§impl NSDocument
impl NSDocument
NSRestorableState
pub unsafe fn restoreDocumentWindowWithIdentifier_state_completionHandler( &self, identifier: &NSUserInterfaceItemIdentifier, state: &NSCoder, completion_handler: &Block<dyn Fn(*mut NSWindow, *mut NSError)> )
Available on crate features
NSWindowRestoration
and NSResponder
and NSUserInterfaceItemIdentification
and NSWindow
and block2
only.pub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder)
Available on crate feature
NSWindowRestoration
only.pub unsafe fn encodeRestorableStateWithCoder_backgroundQueue( &self, coder: &NSCoder, queue: &NSOperationQueue )
Available on crate feature
NSWindowRestoration
only.pub unsafe fn restoreStateWithCoder(&self, coder: &NSCoder)
Available on crate feature
NSWindowRestoration
only.pub unsafe fn invalidateRestorableState(&self)
Available on crate feature
NSWindowRestoration
only.pub unsafe fn restorableStateKeyPaths( mtm: MainThreadMarker ) -> Retained<NSArray<NSString>>
Available on crate feature
NSWindowRestoration
only.pub unsafe fn allowedClassesForRestorableStateKeyPath( key_path: &NSString, mtm: MainThreadMarker ) -> Retained<NSArray<TodoClass>>
Available on crate feature
NSWindowRestoration
only.Methods from Deref<Target = NSObject>§
sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
sourcepub fn class(&self) -> &'static AnyClass
Available on crate feature NSAccessibilityConstants
only.
pub fn class(&self) -> &'static AnyClass
NSAccessibilityConstants
only.Dynamically find the class of this object.
§Example
Check that an instance of NSObject
has the precise class NSObject
.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load
instead.Available on crate feature NSAccessibilityConstants
only.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load
instead.NSAccessibilityConstants
only.Use Ivar::load
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load_mut
instead.Available on crate feature NSAccessibilityConstants
only.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut
instead.NSAccessibilityConstants
only.Use Ivar::load_mut
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
Trait Implementations§
source§impl AsMut<AnyObject> for NSDocument
impl AsMut<AnyObject> for NSDocument
source§impl AsMut<NSDocument> for NSDocument
impl AsMut<NSDocument> for NSDocument
source§impl AsMut<NSDocument> for NSPersistentDocument
Available on crate feature NSPersistentDocument
only.
impl AsMut<NSDocument> for NSPersistentDocument
Available on crate feature
NSPersistentDocument
only.source§fn as_mut(&mut self) -> &mut NSDocument
fn as_mut(&mut self) -> &mut NSDocument
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl AsMut<NSObject> for NSDocument
impl AsMut<NSObject> for NSDocument
source§impl AsRef<AnyObject> for NSDocument
impl AsRef<AnyObject> for NSDocument
source§impl AsRef<NSDocument> for NSDocument
impl AsRef<NSDocument> for NSDocument
source§impl AsRef<NSDocument> for NSPersistentDocument
Available on crate feature NSPersistentDocument
only.
impl AsRef<NSDocument> for NSPersistentDocument
Available on crate feature
NSPersistentDocument
only.source§fn as_ref(&self) -> &NSDocument
fn as_ref(&self) -> &NSDocument
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<NSObject> for NSDocument
impl AsRef<NSObject> for NSDocument
source§impl Borrow<AnyObject> for NSDocument
impl Borrow<AnyObject> for NSDocument
source§impl Borrow<NSDocument> for NSPersistentDocument
Available on crate feature NSPersistentDocument
only.
impl Borrow<NSDocument> for NSPersistentDocument
Available on crate feature
NSPersistentDocument
only.source§fn borrow(&self) -> &NSDocument
fn borrow(&self) -> &NSDocument
Immutably borrows from an owned value. Read more
source§impl Borrow<NSObject> for NSDocument
impl Borrow<NSObject> for NSDocument
source§impl BorrowMut<AnyObject> for NSDocument
impl BorrowMut<AnyObject> for NSDocument
source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSDocument> for NSPersistentDocument
Available on crate feature NSPersistentDocument
only.
impl BorrowMut<NSDocument> for NSPersistentDocument
Available on crate feature
NSPersistentDocument
only.source§fn borrow_mut(&mut self) -> &mut NSDocument
fn borrow_mut(&mut self) -> &mut NSDocument
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSObject> for NSDocument
impl BorrowMut<NSObject> for NSDocument
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
source§impl ClassType for NSDocument
impl ClassType for NSDocument
§type Mutability = MainThreadOnly
type Mutability = MainThreadOnly
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSDocument"
const NAME: &'static str = "NSDocument"
The name of the Objective-C class that this type represents. Read more
source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
Get a reference to the Objective-C class that this type represents. Read more
source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
Get a mutable reference to the superclass.
source§impl Debug for NSDocument
impl Debug for NSDocument
source§impl Deref for NSDocument
impl Deref for NSDocument
source§impl DerefMut for NSDocument
impl DerefMut for NSDocument
source§impl Hash for NSDocument
impl Hash for NSDocument
source§impl NSEditorRegistration for NSDocument
Available on crate feature NSKeyValueBinding
only.
impl NSEditorRegistration for NSDocument
Available on crate feature
NSKeyValueBinding
only.unsafe fn objectDidBeginEditing(&self, editor: &ProtocolObject<dyn NSEditor>)
unsafe fn objectDidEndEditing(&self, editor: &ProtocolObject<dyn NSEditor>)
source§impl NSFilePresenter for NSDocument
impl NSFilePresenter for NSDocument
source§unsafe fn presentedItemURL(&self) -> Option<Retained<NSURL>>
unsafe fn presentedItemURL(&self) -> Option<Retained<NSURL>>
Available on crate feature
NSURL
only.source§unsafe fn presentedItemOperationQueue(&self) -> Retained<NSOperationQueue>
unsafe fn presentedItemOperationQueue(&self) -> Retained<NSOperationQueue>
Available on crate feature
NSOperation
only.source§unsafe fn primaryPresentedItemURL(&self) -> Option<Retained<NSURL>>
unsafe fn primaryPresentedItemURL(&self) -> Option<Retained<NSURL>>
Available on crate feature
NSURL
only.source§unsafe fn relinquishPresentedItemToReader(
&self,
reader: &Block<dyn Fn(*mut Block<dyn Fn()>)>
)
unsafe fn relinquishPresentedItemToReader( &self, reader: &Block<dyn Fn(*mut Block<dyn Fn()>)> )
Available on crate feature
block2
only.source§unsafe fn relinquishPresentedItemToWriter(
&self,
writer: &Block<dyn Fn(*mut Block<dyn Fn()>)>
)
unsafe fn relinquishPresentedItemToWriter( &self, writer: &Block<dyn Fn(*mut Block<dyn Fn()>)> )
Available on crate feature
block2
only.source§unsafe fn savePresentedItemChangesWithCompletionHandler(
&self,
completion_handler: &Block<dyn Fn(*mut NSError)>
)
unsafe fn savePresentedItemChangesWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSError)> )
Available on crate features
NSError
and block2
only.source§unsafe fn accommodatePresentedItemDeletionWithCompletionHandler(
&self,
completion_handler: &Block<dyn Fn(*mut NSError)>
)
unsafe fn accommodatePresentedItemDeletionWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSError)> )
Available on crate features
NSError
and block2
only.source§unsafe fn accommodatePresentedItemEvictionWithCompletionHandler(
&self,
completion_handler: &Block<dyn Fn(*mut NSError)>
)
unsafe fn accommodatePresentedItemEvictionWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSError)> )
Available on crate features
NSError
and block2
only.source§unsafe fn presentedItemDidMoveToURL(&self, new_url: &NSURL)
unsafe fn presentedItemDidMoveToURL(&self, new_url: &NSURL)
Available on crate feature
NSURL
only.unsafe fn presentedItemDidChange(&self)
source§unsafe fn presentedItemDidChangeUbiquityAttributes(
&self,
attributes: &NSSet<NSString>
)
unsafe fn presentedItemDidChangeUbiquityAttributes( &self, attributes: &NSSet<NSString> )
Available on crate features
NSSet
and NSString
and NSURL
only.source§unsafe fn observedPresentedItemUbiquityAttributes(
&self
) -> Retained<NSSet<NSString>>
unsafe fn observedPresentedItemUbiquityAttributes( &self ) -> Retained<NSSet<NSString>>
Available on crate features
NSSet
and NSString
and NSURL
only.source§unsafe fn presentedItemDidGainVersion(&self, version: &NSFileVersion)
unsafe fn presentedItemDidGainVersion(&self, version: &NSFileVersion)
Available on crate feature
NSFileVersion
only.source§unsafe fn presentedItemDidLoseVersion(&self, version: &NSFileVersion)
unsafe fn presentedItemDidLoseVersion(&self, version: &NSFileVersion)
Available on crate feature
NSFileVersion
only.source§unsafe fn presentedItemDidResolveConflictVersion(&self, version: &NSFileVersion)
unsafe fn presentedItemDidResolveConflictVersion(&self, version: &NSFileVersion)
Available on crate feature
NSFileVersion
only.source§unsafe fn accommodatePresentedSubitemDeletionAtURL_completionHandler(
&self,
url: &NSURL,
completion_handler: &Block<dyn Fn(*mut NSError)>
)
unsafe fn accommodatePresentedSubitemDeletionAtURL_completionHandler( &self, url: &NSURL, completion_handler: &Block<dyn Fn(*mut NSError)> )
Available on crate features
NSError
and NSURL
and block2
only.source§unsafe fn presentedSubitemDidAppearAtURL(&self, url: &NSURL)
unsafe fn presentedSubitemDidAppearAtURL(&self, url: &NSURL)
Available on crate feature
NSURL
only.source§unsafe fn presentedSubitemAtURL_didMoveToURL(
&self,
old_url: &NSURL,
new_url: &NSURL
)
unsafe fn presentedSubitemAtURL_didMoveToURL( &self, old_url: &NSURL, new_url: &NSURL )
Available on crate feature
NSURL
only.source§unsafe fn presentedSubitemDidChangeAtURL(&self, url: &NSURL)
unsafe fn presentedSubitemDidChangeAtURL(&self, url: &NSURL)
Available on crate feature
NSURL
only.source§unsafe fn presentedSubitemAtURL_didGainVersion(
&self,
url: &NSURL,
version: &NSFileVersion
)
unsafe fn presentedSubitemAtURL_didGainVersion( &self, url: &NSURL, version: &NSFileVersion )
Available on crate features
NSFileVersion
and NSURL
only.source§unsafe fn presentedSubitemAtURL_didLoseVersion(
&self,
url: &NSURL,
version: &NSFileVersion
)
unsafe fn presentedSubitemAtURL_didLoseVersion( &self, url: &NSURL, version: &NSFileVersion )
Available on crate features
NSFileVersion
and NSURL
only.source§unsafe fn presentedSubitemAtURL_didResolveConflictVersion(
&self,
url: &NSURL,
version: &NSFileVersion
)
unsafe fn presentedSubitemAtURL_didResolveConflictVersion( &self, url: &NSURL, version: &NSFileVersion )
Available on crate features
NSFileVersion
and NSURL
only.source§impl NSMenuItemValidation for NSDocument
Available on crate feature NSMenu
only.
impl NSMenuItemValidation for NSDocument
Available on crate feature
NSMenu
only.source§unsafe fn validateMenuItem(&self, menu_item: &NSMenuItem) -> bool
unsafe fn validateMenuItem(&self, menu_item: &NSMenuItem) -> bool
Available on crate feature
NSMenuItem
only.source§impl NSObjectProtocol for NSDocument
impl NSObjectProtocol for NSDocument
source§fn isEqual(&self, other: &AnyObject) -> bool
fn isEqual(&self, other: &AnyObject) -> bool
Check whether the object is equal to an arbitrary other object. Read more
source§fn hash(&self) -> usize
fn hash(&self) -> usize
An integer that can be used as a table address in a hash table
structure. Read more
source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of the class, or one of its
subclasses. Read more
source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
Check if the object is an instance of the class type, or one of its
subclasses. Read more
source§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of a specific class, without
checking subclasses. Read more
source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Check whether the object implements or inherits a method with the
given selector. Read more
source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Check whether the object conforms to a given protocol. Read more
source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
A textual representation of the object to use when debugging. Read more
source§impl NSUserActivityRestoring for NSDocument
Available on crate feature NSUserActivity
only.
impl NSUserActivityRestoring for NSDocument
Available on crate feature
NSUserActivity
only.unsafe fn restoreUserActivityState(&self, user_activity: &NSUserActivity)
source§impl NSUserInterfaceValidations for NSDocument
Available on crate feature NSUserInterfaceValidation
only.
impl NSUserInterfaceValidations for NSDocument
Available on crate feature
NSUserInterfaceValidation
only.unsafe fn validateUserInterfaceItem( &self, item: &ProtocolObject<dyn NSValidatedUserInterfaceItem> ) -> bool
source§impl PartialEq for NSDocument
impl PartialEq for NSDocument
source§fn eq(&self, other: &NSDocument) -> bool
fn eq(&self, other: &NSDocument) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RefEncode for NSDocument
impl RefEncode for NSDocument
source§const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for NSDocument
impl Message for NSDocument
impl StructuralPartialEq for NSDocument
Auto Trait Implementations§
impl !Freeze for NSDocument
impl !RefUnwindSafe for NSDocument
impl !Send for NSDocument
impl !Sync for NSDocument
impl !Unpin for NSDocument
impl !UnwindSafe for NSDocument
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CounterpartOrSelf for T
impl<T> CounterpartOrSelf for T
§type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
The immutable counterpart of the type, or
Self
if the type has no
immutable counterpart. Read more§type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
The mutable counterpart of the type, or
Self
if the type has no
mutable counterpart. Read more