Struct objc2_app_kit::NSDocument

source ·
#[repr(C)]
pub struct NSDocument { /* private fields */ }
Available on crate feature NSDocument only.

Implementations§

source§

impl NSDocument

source

pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>

source

pub unsafe fn initWithType_error( this: Allocated<Self>, type_name: &NSString ) -> Result<Retained<Self>, Retained<NSError>>

source

pub unsafe fn canConcurrentlyReadDocumentsOfType( type_name: &NSString, mtm: MainThreadMarker ) -> bool

source

pub unsafe fn initWithContentsOfURL_ofType_error( this: Allocated<Self>, url: &NSURL, type_name: &NSString ) -> Result<Retained<Self>, Retained<NSError>>

source

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>>

source

pub unsafe fn fileType(&self) -> Option<Retained<NSString>>

source

pub unsafe fn setFileType(&self, file_type: Option<&NSString>)

source

pub unsafe fn fileURL(&self) -> Option<Retained<NSURL>>

source

pub unsafe fn setFileURL(&self, file_url: Option<&NSURL>)

source

pub unsafe fn fileModificationDate(&self) -> Option<Retained<NSDate>>

source

pub unsafe fn setFileModificationDate( &self, file_modification_date: Option<&NSDate> )

source

pub unsafe fn isDraft(&self) -> bool

source

pub unsafe fn setDraft(&self, draft: bool)

source

pub unsafe fn performActivityWithSynchronousWaiting_usingBlock( &self, wait_synchronously: bool, block: &Block<dyn Fn(NonNull<Block<dyn Fn()>>)> )

Available on crate feature block2 only.
source

pub unsafe fn continueActivityUsingBlock(&self, block: &Block<dyn Fn() + '_>)

Available on crate feature block2 only.
source

pub unsafe fn continueAsynchronousWorkOnMainThreadUsingBlock( &self, block: &Block<dyn Fn()> )

Available on crate feature block2 only.
source

pub unsafe fn performSynchronousFileAccessUsingBlock( &self, block: &Block<dyn Fn() + '_> )

Available on crate feature block2 only.
source

pub unsafe fn performAsynchronousFileAccessUsingBlock( &self, block: &Block<dyn Fn(NonNull<Block<dyn Fn()>>)> )

Available on crate feature block2 only.
source

pub unsafe fn revertDocumentToSaved(&self, sender: Option<&AnyObject>)

source

pub unsafe fn revertToContentsOfURL_ofType_error( &self, url: &NSURL, type_name: &NSString ) -> Result<(), Retained<NSError>>

source

pub unsafe fn readFromURL_ofType_error( &self, url: &NSURL, type_name: &NSString ) -> Result<(), Retained<NSError>>

source

pub unsafe fn readFromFileWrapper_ofType_error( &self, file_wrapper: &NSFileWrapper, type_name: &NSString ) -> Result<(), Retained<NSError>>

source

pub unsafe fn readFromData_ofType_error( &self, data: &NSData, type_name: &NSString ) -> Result<(), Retained<NSError>>

source

pub unsafe fn isEntireFileLoaded(&self) -> bool

source

pub unsafe fn writeToURL_ofType_error( &self, url: &NSURL, type_name: &NSString ) -> Result<(), Retained<NSError>>

source

pub unsafe fn fileWrapperOfType_error( &self, type_name: &NSString ) -> Result<Retained<NSFileWrapper>, Retained<NSError>>

source

pub unsafe fn dataOfType_error( &self, type_name: &NSString ) -> Result<Retained<NSData>, Retained<NSError>>

source

pub unsafe fn unblockUserInteraction(&self)

source

pub unsafe fn autosavingIsImplicitlyCancellable(&self) -> bool

source

pub unsafe fn writeSafelyToURL_ofType_forSaveOperation_error( &self, url: &NSURL, type_name: &NSString, save_operation: NSSaveOperationType ) -> Result<(), Retained<NSError>>

source

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>>

source

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>>

source

pub unsafe fn keepBackupFile(&self) -> bool

source

pub unsafe fn backupFileURL(&self) -> Option<Retained<NSURL>>

source

pub unsafe fn saveDocument(&self, sender: Option<&AnyObject>)

source

pub unsafe fn saveDocumentAs(&self, sender: Option<&AnyObject>)

source

pub unsafe fn saveDocumentTo(&self, sender: Option<&AnyObject>)

source

pub unsafe fn saveDocumentWithDelegate_didSaveSelector_contextInfo( &self, delegate: Option<&AnyObject>, did_save_selector: Option<Sel>, context_info: *mut c_void )

source

pub unsafe fn runModalSavePanelForSaveOperation_delegate_didSaveSelector_contextInfo( &self, save_operation: NSSaveOperationType, delegate: Option<&AnyObject>, did_save_selector: Option<Sel>, context_info: *mut c_void )

source

pub unsafe fn shouldRunSavePanelWithAccessoryView(&self) -> bool

source

pub unsafe fn prepareSavePanel(&self, save_panel: &NSSavePanel) -> bool

Available on crate features NSPanel and NSResponder and NSSavePanel and NSWindow only.
source

pub unsafe fn fileNameExtensionWasHiddenInLastRunSavePanel(&self) -> bool

source

pub unsafe fn fileTypeFromLastRunSavePanel(&self) -> Option<Retained<NSString>>

source

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 )

source

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.
source

pub unsafe fn canAsynchronouslyWriteToURL_ofType_forSaveOperation( &self, url: &NSURL, type_name: &NSString, save_operation: NSSaveOperationType ) -> bool

source

pub unsafe fn checkAutosavingSafetyAndReturnError( &self ) -> Result<(), Retained<NSError>>

source

pub unsafe fn scheduleAutosaving(&self)

source

pub unsafe fn hasUnautosavedChanges(&self) -> bool

source

pub unsafe fn autosaveDocumentWithDelegate_didAutosaveSelector_contextInfo( &self, delegate: Option<&AnyObject>, did_autosave_selector: Option<Sel>, context_info: *mut c_void )

source

pub unsafe fn autosaveWithImplicitCancellability_completionHandler( &self, autosaving_is_implicitly_cancellable: bool, completion_handler: &Block<dyn Fn(*mut NSError)> )

Available on crate feature block2 only.
source

pub unsafe fn autosavesInPlace(mtm: MainThreadMarker) -> bool

source

pub unsafe fn preservesVersions(mtm: MainThreadMarker) -> bool

source

pub unsafe fn browseDocumentVersions(&self, sender: Option<&AnyObject>)

source

pub unsafe fn isBrowsingVersions(&self) -> bool

source

pub unsafe fn stopBrowsingVersionsWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn()>> )

Available on crate feature block2 only.
source

pub unsafe fn autosavesDrafts(mtm: MainThreadMarker) -> bool

source

pub unsafe fn autosavingFileType(&self) -> Option<Retained<NSString>>

source

pub unsafe fn autosavedContentsFileURL(&self) -> Option<Retained<NSURL>>

source

pub unsafe fn setAutosavedContentsFileURL( &self, autosaved_contents_file_url: Option<&NSURL> )

source

pub unsafe fn canCloseDocumentWithDelegate_shouldCloseSelector_contextInfo( &self, delegate: &AnyObject, should_close_selector: Option<Sel>, context_info: *mut c_void )

source

pub unsafe fn close(&self)

source

pub unsafe fn duplicateDocument(&self, sender: Option<&AnyObject>)

source

pub unsafe fn duplicateDocumentWithDelegate_didDuplicateSelector_contextInfo( &self, delegate: Option<&AnyObject>, did_duplicate_selector: Option<Sel>, context_info: *mut c_void )

source

pub unsafe fn duplicateAndReturnError( &self ) -> Result<Retained<NSDocument>, Retained<NSError>>

source

pub unsafe fn renameDocument(&self, sender: Option<&AnyObject>)

source

pub unsafe fn moveDocumentToUbiquityContainer(&self, sender: Option<&AnyObject>)

source

pub unsafe fn moveDocument(&self, sender: Option<&AnyObject>)

source

pub unsafe fn moveDocumentWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(Bool)>> )

Available on crate feature block2 only.
source

pub unsafe fn moveToURL_completionHandler( &self, url: &NSURL, completion_handler: Option<&Block<dyn Fn(*mut NSError)>> )

Available on crate feature block2 only.
source

pub unsafe fn lockDocument(&self, sender: Option<&AnyObject>)

source

pub unsafe fn unlockDocument(&self, sender: Option<&AnyObject>)

source

pub unsafe fn lockDocumentWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(Bool)>> )

Available on crate feature block2 only.
source

pub unsafe fn lockWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(*mut NSError)>> )

Available on crate feature block2 only.
source

pub unsafe fn unlockDocumentWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(Bool)>> )

Available on crate feature block2 only.
source

pub unsafe fn unlockWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(*mut NSError)>> )

Available on crate feature block2 only.
source

pub unsafe fn isLocked(&self) -> bool

source

pub unsafe fn runPageLayout(&self, sender: Option<&AnyObject>)

source

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.
source

pub unsafe fn preparePageLayout(&self, page_layout: &NSPageLayout) -> bool

Available on crate feature NSPageLayout only.
source

pub unsafe fn shouldChangePrintInfo(&self, new_print_info: &NSPrintInfo) -> bool

Available on crate feature NSPrintInfo only.
source

pub unsafe fn printInfo(&self) -> Retained<NSPrintInfo>

Available on crate feature NSPrintInfo only.
source

pub unsafe fn setPrintInfo(&self, print_info: &NSPrintInfo)

Available on crate feature NSPrintInfo only.
source

pub unsafe fn printDocument(&self, sender: Option<&AnyObject>)

source

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.
source

pub unsafe fn printOperationWithSettings_error( &self, print_settings: &NSDictionary<NSPrintInfoAttributeKey, AnyObject> ) -> Result<Retained<NSPrintOperation>, Retained<NSError>>

Available on crate features NSPrintInfo and NSPrintOperation only.
source

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.
source

pub unsafe fn saveDocumentToPDF(&self, sender: Option<&AnyObject>)

source

pub unsafe fn PDFPrintOperation(&self) -> Retained<NSPrintOperation>

Available on crate feature NSPrintOperation only.
source

pub unsafe fn allowsDocumentSharing(&self) -> bool

source

pub unsafe fn shareDocumentWithSharingService_completionHandler( &self, sharing_service: &NSSharingService, completion_handler: Option<&Block<dyn Fn(Bool)>> )

Available on crate features NSSharingService and block2 only.
source

pub unsafe fn prepareSharingServicePicker( &self, sharing_service_picker: &NSSharingServicePicker )

Available on crate feature NSSharingService only.
source

pub unsafe fn previewRepresentableActivityItems( &self ) -> Option<Retained<NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>>>

Available on crate feature NSPreviewRepresentingActivityItem only.
source

pub unsafe fn setPreviewRepresentableActivityItems( &self, preview_representable_activity_items: Option<&NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>> )

Available on crate feature NSPreviewRepresentingActivityItem only.
source

pub unsafe fn isDocumentEdited(&self) -> bool

source

pub unsafe fn isInViewingMode(&self) -> bool

source

pub unsafe fn updateChangeCount(&self, change: NSDocumentChangeType)

source

pub unsafe fn changeCountTokenForSaveOperation( &self, save_operation: NSSaveOperationType ) -> Retained<AnyObject>

source

pub unsafe fn updateChangeCountWithToken_forSaveOperation( &self, change_count_token: &AnyObject, save_operation: NSSaveOperationType )

source

pub unsafe fn undoManager(&self) -> Option<Retained<NSUndoManager>>

source

pub unsafe fn setUndoManager(&self, undo_manager: Option<&NSUndoManager>)

source

pub unsafe fn hasUndoManager(&self) -> bool

source

pub unsafe fn setHasUndoManager(&self, has_undo_manager: bool)

source

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.
source

pub unsafe fn presentError(&self, error: &NSError) -> bool

source

pub unsafe fn willPresentError(&self, error: &NSError) -> Retained<NSError>

source

pub unsafe fn willNotPresentError(&self, error: &NSError)

source

pub unsafe fn makeWindowControllers(&self)

source

pub unsafe fn windowNibName(&self) -> Option<Retained<NSNibName>>

Available on crate feature NSNib only.
source

pub unsafe fn windowControllerWillLoadNib( &self, window_controller: &NSWindowController )

Available on crate features NSResponder and NSWindowController only.
source

pub unsafe fn windowControllerDidLoadNib( &self, window_controller: &NSWindowController )

Available on crate features NSResponder and NSWindowController only.
source

pub unsafe fn setWindow(&self, window: Option<&NSWindow>)

Available on crate features NSResponder and NSWindow only.
source

pub unsafe fn addWindowController(&self, window_controller: &NSWindowController)

Available on crate features NSResponder and NSWindowController only.
source

pub unsafe fn removeWindowController( &self, window_controller: &NSWindowController )

Available on crate features NSResponder and NSWindowController only.
source

pub unsafe fn showWindows(&self)

source

pub unsafe fn windowControllers(&self) -> Retained<NSArray<NSWindowController>>

Available on crate features NSResponder and NSWindowController only.
source

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.
source

pub unsafe fn displayName(&self) -> Retained<NSString>

source

pub unsafe fn defaultDraftName(&self) -> Retained<NSString>

source

pub unsafe fn windowForSheet(&self) -> Option<Retained<NSWindow>>

Available on crate features NSResponder and NSWindow only.
source

pub unsafe fn readableTypes( mtm: MainThreadMarker ) -> Retained<NSArray<NSString>>

source

pub unsafe fn writableTypes( mtm: MainThreadMarker ) -> Retained<NSArray<NSString>>

source

pub unsafe fn isNativeType(type: &NSString, mtm: MainThreadMarker) -> bool

source

pub unsafe fn writableTypesForSaveOperation( &self, save_operation: NSSaveOperationType ) -> Retained<NSArray<NSString>>

source

pub unsafe fn fileNameExtensionForType_saveOperation( &self, type_name: &NSString, save_operation: NSSaveOperationType ) -> Option<Retained<NSString>>

source

pub unsafe fn validateUserInterfaceItem( &self, item: &ProtocolObject<dyn NSValidatedUserInterfaceItem> ) -> bool

Available on crate feature NSUserInterfaceValidation only.
source

pub unsafe fn usesUbiquitousStorage(mtm: MainThreadMarker) -> bool

source

pub unsafe fn presentedItemURL(&self) -> Option<Retained<NSURL>>

source

pub unsafe fn observedPresentedItemUbiquityAttributes( &self ) -> Retained<NSSet<NSURLResourceKey>>

source

pub unsafe fn relinquishPresentedItemToReader( &self, reader: &Block<dyn Fn(*mut Block<dyn Fn()>)> )

Available on crate feature block2 only.
source

pub unsafe fn relinquishPresentedItemToWriter( &self, writer: &Block<dyn Fn(*mut Block<dyn Fn()>)> )

Available on crate feature block2 only.
source

pub unsafe fn savePresentedItemChangesWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSError)> )

Available on crate feature block2 only.
source

pub unsafe fn accommodatePresentedItemDeletionWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSError)> )

Available on crate feature block2 only.
source

pub unsafe fn presentedItemDidMoveToURL(&self, new_url: &NSURL)

source

pub unsafe fn presentedItemDidChange(&self)

source

pub unsafe fn presentedItemDidChangeUbiquityAttributes( &self, attributes: &NSSet<NSURLResourceKey> )

source

pub unsafe fn presentedItemDidGainVersion(&self, version: &NSFileVersion)

source

pub unsafe fn presentedItemDidLoseVersion(&self, version: &NSFileVersion)

source

pub unsafe fn presentedItemDidResolveConflictVersion( &self, version: &NSFileVersion )

source§

impl NSDocument

Methods declared on superclass NSObject

source

pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>

source§

impl NSDocument

NSDeprecated

source

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
source

pub unsafe fn dataRepresentationOfType( &self, type: &NSString ) -> Option<Retained<NSData>>

👎Deprecated
source

pub unsafe fn fileAttributesToWriteToFile_ofType_saveOperation( &self, full_document_path: &NSString, document_type_name: &NSString, save_operation_type: NSSaveOperationType ) -> Option<Retained<NSDictionary>>

👎Deprecated
source

pub unsafe fn fileName(&self) -> Option<Retained<NSString>>

👎Deprecated
source

pub unsafe fn fileWrapperRepresentationOfType( &self, type: &NSString ) -> Option<Retained<NSFileWrapper>>

👎Deprecated
source

pub unsafe fn initWithContentsOfFile_ofType( this: Allocated<Self>, absolute_path: &NSString, type_name: &NSString ) -> Option<Retained<Self>>

👎Deprecated
source

pub unsafe fn initWithContentsOfURL_ofType( this: Allocated<Self>, url: &NSURL, type_name: &NSString ) -> Option<Retained<Self>>

👎Deprecated
source

pub unsafe fn loadDataRepresentation_ofType( &self, data: &NSData, type: &NSString ) -> bool

👎Deprecated
source

pub unsafe fn loadFileWrapperRepresentation_ofType( &self, wrapper: &NSFileWrapper, type: &NSString ) -> bool

👎Deprecated
source

pub unsafe fn printShowingPrintPanel(&self, flag: bool)

👎Deprecated
source

pub unsafe fn readFromFile_ofType( &self, file_name: &NSString, type: &NSString ) -> bool

👎Deprecated
source

pub unsafe fn readFromURL_ofType(&self, url: &NSURL, type: &NSString) -> bool

👎Deprecated
source

pub unsafe fn revertToSavedFromFile_ofType( &self, file_name: &NSString, type: &NSString ) -> bool

👎Deprecated
source

pub unsafe fn revertToSavedFromURL_ofType( &self, url: &NSURL, type: &NSString ) -> bool

👎Deprecated
source

pub unsafe fn runModalPageLayoutWithPrintInfo( &self, print_info: &NSPrintInfo ) -> NSInteger

👎Deprecated
Available on crate feature NSPrintInfo only.
source

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
source

pub unsafe fn setFileName(&self, file_name: Option<&NSString>)

👎Deprecated
source

pub unsafe fn writeToFile_ofType( &self, file_name: &NSString, type: &NSString ) -> bool

👎Deprecated
source

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
source

pub unsafe fn writeToURL_ofType(&self, url: &NSURL, type: &NSString) -> bool

👎Deprecated
source

pub unsafe fn writeWithBackupToFile_ofType_saveOperation( &self, full_document_path: &NSString, document_type_name: &NSString, save_operation_type: NSSaveOperationType ) -> bool

👎Deprecated
source§

impl NSDocument

NSScripting

source

pub unsafe fn lastComponentOfFileName(&self) -> Retained<NSString>

Available on crate feature NSDocumentScripting only.
source

pub unsafe fn setLastComponentOfFileName( &self, last_component_of_file_name: &NSString )

Available on crate feature NSDocumentScripting only.
source

pub unsafe fn handleSaveScriptCommand( &self, command: &NSScriptCommand ) -> Option<Retained<AnyObject>>

Available on crate feature NSDocumentScripting only.
source

pub unsafe fn handleCloseScriptCommand( &self, command: &NSCloseCommand ) -> Option<Retained<AnyObject>>

Available on crate feature NSDocumentScripting only.
source

pub unsafe fn handlePrintScriptCommand( &self, command: &NSScriptCommand ) -> Option<Retained<AnyObject>>

Available on crate feature NSDocumentScripting only.
source

pub unsafe fn objectSpecifier(&self) -> Retained<NSScriptObjectSpecifier>

Available on crate feature NSDocumentScripting only.
source§

impl NSDocument

NSUserActivity

source

pub unsafe fn userActivity(&self) -> Option<Retained<NSUserActivity>>

Available on crate feature NSUserActivity only.
source

pub unsafe fn setUserActivity(&self, user_activity: Option<&NSUserActivity>)

Available on crate feature NSUserActivity only.
source

pub unsafe fn updateUserActivityState(&self, activity: &NSUserActivity)

Available on crate feature NSUserActivity only.
source§

impl NSDocument

NSRestorableState

source

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.
source

pub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder)

Available on crate feature NSWindowRestoration only.
source

pub unsafe fn encodeRestorableStateWithCoder_backgroundQueue( &self, coder: &NSCoder, queue: &NSOperationQueue )

Available on crate feature NSWindowRestoration only.
source

pub unsafe fn restoreStateWithCoder(&self, coder: &NSCoder)

Available on crate feature NSWindowRestoration only.
source

pub unsafe fn invalidateRestorableState(&self)

Available on crate feature NSWindowRestoration only.
source

pub unsafe fn restorableStateKeyPaths( mtm: MainThreadMarker ) -> Retained<NSArray<NSString>>

Available on crate feature NSWindowRestoration only.
source

pub unsafe fn allowedClassesForRestorableStateKeyPath( key_path: &NSString, mtm: MainThreadMarker ) -> Retained<NSArray<TodoClass>>

Available on crate feature NSWindowRestoration only.

Methods from Deref<Target = NSObject>§

source

pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !

Handle messages the object doesn’t recognize.

See Apple’s documentation for details.

Methods from Deref<Target = AnyObject>§

source

pub fn class(&self) -> &'static AnyClass

Available on crate feature 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());
source

pub unsafe fn get_ivar<T>(&self, name: &str) -> &T
where T: Encode,

👎Deprecated: this is difficult to use correctly, use Ivar::load instead.
Available on crate feature 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.

source

pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T
where T: Encode,

👎Deprecated: this is difficult to use correctly, use Ivar::load_mut instead.
Available on crate feature 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

source§

fn as_mut(&mut self) -> &mut AnyObject

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsMut<NSDocument> for NSDocument

source§

fn as_mut(&mut self) -> &mut Self

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsMut<NSDocument> for NSPersistentDocument

Available on crate feature NSPersistentDocument only.
source§

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

source§

fn as_mut(&mut self) -> &mut NSObject

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<AnyObject> for NSDocument

source§

fn as_ref(&self) -> &AnyObject

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<NSDocument> for NSDocument

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<NSDocument> for NSPersistentDocument

Available on crate feature NSPersistentDocument only.
source§

fn as_ref(&self) -> &NSDocument

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<NSObject> for NSDocument

source§

fn as_ref(&self) -> &NSObject

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<AnyObject> for NSDocument

source§

fn borrow(&self) -> &AnyObject

Immutably borrows from an owned value. Read more
source§

impl Borrow<NSDocument> for NSPersistentDocument

Available on crate feature NSPersistentDocument only.
source§

fn borrow(&self) -> &NSDocument

Immutably borrows from an owned value. Read more
source§

impl Borrow<NSObject> for NSDocument

source§

fn borrow(&self) -> &NSObject

Immutably borrows from an owned value. Read more
source§

impl BorrowMut<AnyObject> for NSDocument

source§

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.
source§

fn borrow_mut(&mut self) -> &mut NSDocument

Mutably borrows from an owned value. Read more
source§

impl BorrowMut<NSObject> for NSDocument

source§

fn borrow_mut(&mut self) -> &mut NSObject

Mutably borrows from an owned value. Read more
source§

impl ClassType for NSDocument

§

type Super = NSObject

The superclass of this class. Read more
§

type Mutability = MainThreadOnly

Whether the type is mutable or immutable. Read more
source§

const NAME: &'static str = "NSDocument"

The name of the Objective-C class that this type represents. Read more
source§

fn class() -> &'static AnyClass

Get a reference to the Objective-C class that this type represents. Read more
source§

fn as_super(&self) -> &Self::Super

Get an immutable reference to the superclass.
source§

fn as_super_mut(&mut self) -> &mut Self::Super

Get a mutable reference to the superclass.
source§

fn retain(&self) -> Retained<Self>
where Self: IsRetainable + Sized,

Increment the reference count of the receiver. Read more
source§

impl Debug for NSDocument

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for NSDocument

§

type Target = NSObject

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for NSDocument

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Hash for NSDocument

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl NSEditorRegistration for NSDocument

Available on crate feature NSKeyValueBinding only.
source§

unsafe fn objectDidBeginEditing(&self, editor: &ProtocolObject<dyn NSEditor>)
where Self: Sized + Message,

source§

unsafe fn objectDidEndEditing(&self, editor: &ProtocolObject<dyn NSEditor>)
where Self: Sized + Message,

source§

impl NSFilePresenter for NSDocument

source§

unsafe fn presentedItemURL(&self) -> Option<Retained<NSURL>>
where Self: Sized + Message,

Available on crate feature NSURL only.
source§

unsafe fn presentedItemOperationQueue(&self) -> Retained<NSOperationQueue>
where Self: Sized + Message,

Available on crate feature NSOperation only.
source§

unsafe fn primaryPresentedItemURL(&self) -> Option<Retained<NSURL>>
where Self: Sized + Message,

Available on crate feature NSURL only.
source§

unsafe fn relinquishPresentedItemToReader( &self, reader: &Block<dyn Fn(*mut Block<dyn Fn()>)> )
where Self: Sized + Message,

Available on crate feature block2 only.
source§

unsafe fn relinquishPresentedItemToWriter( &self, writer: &Block<dyn Fn(*mut Block<dyn Fn()>)> )
where Self: Sized + Message,

Available on crate feature block2 only.
source§

unsafe fn savePresentedItemChangesWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSError)> )
where Self: Sized + Message,

Available on crate features NSError and block2 only.
source§

unsafe fn accommodatePresentedItemDeletionWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSError)> )
where Self: Sized + Message,

Available on crate features NSError and block2 only.
source§

unsafe fn accommodatePresentedItemEvictionWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSError)> )
where Self: Sized + Message,

Available on crate features NSError and block2 only.
source§

unsafe fn presentedItemDidMoveToURL(&self, new_url: &NSURL)
where Self: Sized + Message,

Available on crate feature NSURL only.
source§

unsafe fn presentedItemDidChange(&self)
where Self: Sized + Message,

source§

unsafe fn presentedItemDidChangeUbiquityAttributes( &self, attributes: &NSSet<NSString> )
where Self: Sized + Message,

Available on crate features NSSet and NSString and NSURL only.
source§

unsafe fn observedPresentedItemUbiquityAttributes( &self ) -> Retained<NSSet<NSString>>
where Self: Sized + Message,

Available on crate features NSSet and NSString and NSURL only.
source§

unsafe fn presentedItemDidGainVersion(&self, version: &NSFileVersion)
where Self: Sized + Message,

Available on crate feature NSFileVersion only.
source§

unsafe fn presentedItemDidLoseVersion(&self, version: &NSFileVersion)
where Self: Sized + Message,

Available on crate feature NSFileVersion only.
source§

unsafe fn presentedItemDidResolveConflictVersion(&self, version: &NSFileVersion)
where Self: Sized + Message,

Available on crate feature NSFileVersion only.
source§

unsafe fn accommodatePresentedSubitemDeletionAtURL_completionHandler( &self, url: &NSURL, completion_handler: &Block<dyn Fn(*mut NSError)> )
where Self: Sized + Message,

Available on crate features NSError and NSURL and block2 only.
source§

unsafe fn presentedSubitemDidAppearAtURL(&self, url: &NSURL)
where Self: Sized + Message,

Available on crate feature NSURL only.
source§

unsafe fn presentedSubitemAtURL_didMoveToURL( &self, old_url: &NSURL, new_url: &NSURL )
where Self: Sized + Message,

Available on crate feature NSURL only.
source§

unsafe fn presentedSubitemDidChangeAtURL(&self, url: &NSURL)
where Self: Sized + Message,

Available on crate feature NSURL only.
source§

unsafe fn presentedSubitemAtURL_didGainVersion( &self, url: &NSURL, version: &NSFileVersion )
where Self: Sized + Message,

Available on crate features NSFileVersion and NSURL only.
source§

unsafe fn presentedSubitemAtURL_didLoseVersion( &self, url: &NSURL, version: &NSFileVersion )
where Self: Sized + Message,

Available on crate features NSFileVersion and NSURL only.
source§

unsafe fn presentedSubitemAtURL_didResolveConflictVersion( &self, url: &NSURL, version: &NSFileVersion )
where Self: Sized + Message,

Available on crate features NSFileVersion and NSURL only.
source§

impl NSMenuItemValidation for NSDocument

Available on crate feature NSMenu only.
source§

unsafe fn validateMenuItem(&self, menu_item: &NSMenuItem) -> bool
where Self: Sized + Message,

Available on crate feature NSMenuItem only.
source§

impl NSObjectProtocol for NSDocument

source§

fn isEqual(&self, other: &AnyObject) -> bool
where Self: Sized + Message,

Check whether the object is equal to an arbitrary other object. Read more
source§

fn hash(&self) -> usize
where Self: Sized + Message,

An integer that can be used as a table address in a hash table structure. Read more
source§

fn isKindOfClass(&self, cls: &AnyClass) -> bool
where Self: Sized + Message,

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
where T: ClassType, Self: Sized + Message,

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
where Self: Sized + Message,

Check if the object is an instance of a specific class, without checking subclasses. Read more
source§

fn respondsToSelector(&self, aSelector: Sel) -> bool
where Self: Sized + Message,

Check whether the object implements or inherits a method with the given selector. Read more
source§

fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
where Self: Sized + Message,

Check whether the object conforms to a given protocol. Read more
source§

fn description(&self) -> Retained<NSObject>
where Self: Sized + Message,

A textual representation of the object. Read more
source§

fn debugDescription(&self) -> Retained<NSObject>
where Self: Sized + Message,

A textual representation of the object to use when debugging. Read more
source§

fn isProxy(&self) -> bool
where Self: Sized + Message,

Check whether the receiver is a subclass of the NSProxy root class instead of the usual NSObject. Read more
source§

fn retainCount(&self) -> usize
where Self: Sized + Message,

The reference count of the object. Read more
source§

impl NSUserActivityRestoring for NSDocument

Available on crate feature NSUserActivity only.
source§

unsafe fn restoreUserActivityState(&self, user_activity: &NSUserActivity)
where Self: Sized + Message,

source§

impl NSUserInterfaceValidations for NSDocument

Available on crate feature NSUserInterfaceValidation only.
source§

impl PartialEq for NSDocument

source§

fn eq(&self, other: &NSDocument) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl RefEncode for NSDocument

source§

const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF

The Objective-C type-encoding for a reference of this type. Read more
source§

impl Eq for NSDocument

source§

impl Message for NSDocument

source§

impl StructuralPartialEq for NSDocument

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CounterpartOrSelf for T
where T: ClassType + ?Sized, <T as ClassType>::Mutability: MutabilityCounterpartOrSelf<T>,

§

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

The mutable counterpart of the type, or Self if the type has no mutable counterpart. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

source§

impl<T> IsIdCloneable for T
where T: ClassType + ?Sized, <T as ClassType>::Mutability: MutabilityIsIdCloneable,

source§

impl<T> IsMainThreadOnly for T
where T: ClassType + ?Sized, <T as ClassType>::Mutability: MutabilityIsMainThreadOnly,

source§

impl<T> IsRetainable for T
where T: ClassType + ?Sized, <T as ClassType>::Mutability: MutabilityIsRetainable,