Struct objc2_app_kit::NSDocumentController
source · #[repr(C)]pub struct NSDocumentController { /* private fields */ }
Available on crate feature
NSDocumentController
only.Implementations§
source§impl NSDocumentController
impl NSDocumentController
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>
pub unsafe fn initWithCoder( this: Allocated<Self>, coder: &NSCoder ) -> Option<Id<Self>>
pub unsafe fn documents(&self) -> Id<NSArray<NSDocument>>
Available on crate feature
NSDocument
only.pub unsafe fn currentDocument(&self) -> Option<Id<NSDocument>>
Available on crate feature
NSDocument
only.pub unsafe fn currentDirectory(&self) -> Option<Id<NSString>>
pub unsafe fn documentForURL(&self, url: &NSURL) -> Option<Id<NSDocument>>
Available on crate feature
NSDocument
only.pub unsafe fn documentForWindow( &self, window: &NSWindow ) -> Option<Id<NSDocument>>
Available on crate features
NSDocument
and NSResponder
and NSWindow
only.pub unsafe fn addDocument(&self, document: &NSDocument)
Available on crate feature
NSDocument
only.pub unsafe fn removeDocument(&self, document: &NSDocument)
Available on crate feature
NSDocument
only.pub unsafe fn newDocument(&self, sender: Option<&AnyObject>)
pub unsafe fn openUntitledDocumentAndDisplay_error( &self, display_document: bool ) -> Result<Id<NSDocument>, Id<NSError>>
Available on crate feature
NSDocument
only.pub unsafe fn makeUntitledDocumentOfType_error( &self, type_name: &NSString ) -> Result<Id<NSDocument>, Id<NSError>>
Available on crate feature
NSDocument
only.pub unsafe fn openDocument(&self, sender: Option<&AnyObject>)
pub unsafe fn URLsFromRunningOpenPanel(&self) -> Option<Id<NSArray<NSURL>>>
pub unsafe fn runModalOpenPanel_forTypes( &self, open_panel: &NSOpenPanel, types: Option<&NSArray<NSString>> ) -> NSInteger
Available on crate features
NSOpenPanel
and NSPanel
and NSResponder
and NSSavePanel
and NSWindow
only.pub unsafe fn beginOpenPanelWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(*mut NSArray<NSURL>)> )
Available on crate feature
block2
only.pub unsafe fn beginOpenPanel_forTypes_completionHandler( &self, open_panel: &NSOpenPanel, in_types: Option<&NSArray<NSString>>, completion_handler: &Block<dyn Fn(NSInteger)> )
Available on crate features
NSOpenPanel
and NSPanel
and NSResponder
and NSSavePanel
and NSWindow
and block2
only.pub unsafe fn openDocumentWithContentsOfURL_display_completionHandler( &self, url: &NSURL, display_document: bool, completion_handler: &Block<dyn Fn(*mut NSDocument, Bool, *mut NSError)> )
Available on crate features
NSDocument
and block2
only.pub unsafe fn makeDocumentWithContentsOfURL_ofType_error( &self, url: &NSURL, type_name: &NSString ) -> Result<Id<NSDocument>, Id<NSError>>
Available on crate feature
NSDocument
only.pub unsafe fn reopenDocumentForURL_withContentsOfURL_display_completionHandler( &self, url_or_nil: Option<&NSURL>, contents_url: &NSURL, display_document: bool, completion_handler: &Block<dyn Fn(*mut NSDocument, Bool, *mut NSError)> )
Available on crate features
NSDocument
and block2
only.pub unsafe fn makeDocumentForURL_withContentsOfURL_ofType_error( &self, url_or_nil: Option<&NSURL>, contents_url: &NSURL, type_name: &NSString ) -> Result<Id<NSDocument>, Id<NSError>>
Available on crate feature
NSDocument
only.pub unsafe fn autosavingDelay(&self) -> NSTimeInterval
pub unsafe fn setAutosavingDelay(&self, autosaving_delay: NSTimeInterval)
pub unsafe fn saveAllDocuments(&self, sender: Option<&AnyObject>)
pub unsafe fn hasEditedDocuments(&self) -> bool
pub unsafe fn reviewUnsavedDocumentsWithAlertTitle_cancellable_delegate_didReviewAllSelector_contextInfo( &self, title: Option<&NSString>, cancellable: bool, delegate: Option<&AnyObject>, did_review_all_selector: Option<Sel>, context_info: *mut c_void )
pub unsafe fn closeAllDocumentsWithDelegate_didCloseAllSelector_contextInfo( &self, delegate: Option<&AnyObject>, did_close_all_selector: Option<Sel>, context_info: *mut c_void )
pub unsafe fn duplicateDocumentWithContentsOfURL_copying_displayName_error( &self, url: &NSURL, duplicate_by_copying: bool, display_name_or_nil: Option<&NSString> ) -> Result<Id<NSDocument>, Id<NSError>>
Available on crate feature
NSDocument
only.Available on crate feature
NSMenuItem
only.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) -> Id<NSError>
pub unsafe fn maximumRecentDocumentCount(&self) -> NSUInteger
pub unsafe fn clearRecentDocuments(&self, sender: Option<&AnyObject>)
pub unsafe fn noteNewRecentDocument(&self, document: &NSDocument)
Available on crate feature
NSDocument
only.pub unsafe fn noteNewRecentDocumentURL(&self, url: &NSURL)
pub unsafe fn recentDocumentURLs(&self) -> Id<NSArray<NSURL>>
pub unsafe fn defaultType(&self) -> Option<Id<NSString>>
pub unsafe fn typeForContentsOfURL_error( &self, url: &NSURL ) -> Result<Id<NSString>, Id<NSError>>
pub unsafe fn documentClassNames(&self) -> Id<NSArray<NSString>>
pub unsafe fn documentClassForType( &self, type_name: &NSString ) -> Option<&'static AnyClass>
pub unsafe fn displayNameForType( &self, type_name: &NSString ) -> Option<Id<NSString>>
pub unsafe fn validateUserInterfaceItem( &self, item: &ProtocolObject<dyn NSValidatedUserInterfaceItem> ) -> bool
Available on crate feature
NSUserInterfaceValidation
only.source§impl NSDocumentController
impl NSDocumentController
Methods declared on superclass NSObject
pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>
source§impl NSDocumentController
impl NSDocumentController
NSDeprecated
pub unsafe fn openDocumentWithContentsOfURL_display_error( &self, url: &NSURL, display_document: bool ) -> Result<Id<AnyObject>, Id<NSError>>
👎Deprecated: Use -openDocumentWithContentsOfURL:display:completionHandler: instead
pub unsafe fn reopenDocumentForURL_withContentsOfURL_error( &self, url: Option<&NSURL>, contents_url: &NSURL ) -> Result<(), Id<NSError>>
👎Deprecated: Use -reopenDocumentForURL:withContentsOfURL:display:completionHandler: instead
pub unsafe fn fileExtensionsFromType( &self, type_name: &NSString ) -> Option<Id<NSArray>>
👎Deprecated
pub unsafe fn typeFromFileExtension( &self, file_name_extension_or_hfs_file_type: &NSString ) -> Option<Id<NSString>>
👎Deprecated
pub unsafe fn documentForFileName( &self, file_name: &NSString ) -> Option<Id<AnyObject>>
👎Deprecated
pub unsafe fn fileNamesFromRunningOpenPanel(&self) -> Option<Id<NSArray>>
👎Deprecated
pub unsafe fn makeDocumentWithContentsOfFile_ofType( &self, file_name: &NSString, type: &NSString ) -> Option<Id<AnyObject>>
👎Deprecated
pub unsafe fn makeDocumentWithContentsOfURL_ofType( &self, url: &NSURL, type: Option<&NSString> ) -> Option<Id<AnyObject>>
👎Deprecated
pub unsafe fn makeUntitledDocumentOfType( &self, type: &NSString ) -> Option<Id<AnyObject>>
👎Deprecated
pub unsafe fn openDocumentWithContentsOfFile_display( &self, file_name: &NSString, display: bool ) -> Option<Id<AnyObject>>
👎Deprecated
pub unsafe fn openDocumentWithContentsOfURL_display( &self, url: &NSURL, display: bool ) -> Option<Id<AnyObject>>
👎Deprecated
pub unsafe fn openUntitledDocumentOfType_display( &self, type: &NSString, display: bool ) -> Option<Id<AnyObject>>
👎Deprecated
pub unsafe fn setShouldCreateUI(&self, flag: bool)
👎Deprecated
pub unsafe fn shouldCreateUI(&self) -> bool
👎Deprecated
impl NSDocumentController
This impl block contains no items.
NSWindowRestoration
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 NSDocumentController
impl AsMut<AnyObject> for NSDocumentController
source§impl AsMut<NSObject> for NSDocumentController
impl AsMut<NSObject> for NSDocumentController
source§impl AsRef<AnyObject> for NSDocumentController
impl AsRef<AnyObject> for NSDocumentController
source§impl AsRef<NSObject> for NSDocumentController
impl AsRef<NSObject> for NSDocumentController
source§impl Borrow<AnyObject> for NSDocumentController
impl Borrow<AnyObject> for NSDocumentController
source§impl Borrow<NSObject> for NSDocumentController
impl Borrow<NSObject> for NSDocumentController
source§impl BorrowMut<AnyObject> for NSDocumentController
impl BorrowMut<AnyObject> for NSDocumentController
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<NSObject> for NSDocumentController
impl BorrowMut<NSObject> for NSDocumentController
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 NSDocumentController
impl ClassType for NSDocumentController
§type Mutability = MainThreadOnly
type Mutability = MainThreadOnly
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSDocumentController"
const NAME: &'static str = "NSDocumentController"
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 NSDocumentController
impl Debug for NSDocumentController
source§impl Deref for NSDocumentController
impl Deref for NSDocumentController
source§impl DerefMut for NSDocumentController
impl DerefMut for NSDocumentController
source§impl Hash for NSDocumentController
impl Hash for NSDocumentController
source§impl NSCoding for NSDocumentController
impl NSCoding for NSDocumentController
source§impl NSMenuItemValidation for NSDocumentController
Available on crate feature NSMenu
only.
impl NSMenuItemValidation for NSDocumentController
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 NSDocumentController
impl NSObjectProtocol for NSDocumentController
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) -> Id<NSObject>
fn debugDescription(&self) -> Id<NSObject>
A textual representation of the object to use when debugging. Read more
source§impl NSUserInterfaceValidations for NSDocumentController
Available on crate feature NSUserInterfaceValidation
only.
impl NSUserInterfaceValidations for NSDocumentController
Available on crate feature
NSUserInterfaceValidation
only.unsafe fn validateUserInterfaceItem( &self, item: &ProtocolObject<dyn NSValidatedUserInterfaceItem> ) -> bool
source§impl NSWindowRestoration for NSDocumentController
Available on crate feature NSWindowRestoration
only.
impl NSWindowRestoration for NSDocumentController
Available on crate feature
NSWindowRestoration
only.source§unsafe fn restoreWindowWithIdentifier_state_completionHandler(
identifier: &NSUserInterfaceItemIdentifier,
state: &NSCoder,
completion_handler: &Block<dyn Fn(*mut NSWindow, *mut NSError)>,
mtm: MainThreadMarker
)
unsafe fn restoreWindowWithIdentifier_state_completionHandler( identifier: &NSUserInterfaceItemIdentifier, state: &NSCoder, completion_handler: &Block<dyn Fn(*mut NSWindow, *mut NSError)>, mtm: MainThreadMarker )
Available on crate features
NSResponder
and NSUserInterfaceItemIdentification
and NSWindow
and block2
only.source§impl PartialEq for NSDocumentController
impl PartialEq for NSDocumentController
source§fn eq(&self, other: &NSDocumentController) -> bool
fn eq(&self, other: &NSDocumentController) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RefEncode for NSDocumentController
impl RefEncode for NSDocumentController
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 NSDocumentController
impl Message for NSDocumentController
impl StructuralPartialEq for NSDocumentController
Auto Trait Implementations§
impl !Freeze for NSDocumentController
impl !RefUnwindSafe for NSDocumentController
impl !Send for NSDocumentController
impl !Sync for NSDocumentController
impl !Unpin for NSDocumentController
impl !UnwindSafe for NSDocumentController
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