Struct objc2_ui_kit::UIDocument
source · #[repr(C)]pub struct UIDocument { /* private fields */ }Available on crate feature
UIDocument only.Implementations§
source§impl UIDocument
impl UIDocument
pub unsafe fn initWithFileURL( this: Allocated<Self>, url: &NSURL ) -> Retained<Self>
pub unsafe fn fileURL(&self) -> Retained<NSURL>
pub unsafe fn localizedName(&self) -> Retained<NSString>
pub unsafe fn fileType(&self) -> Option<Retained<NSString>>
pub unsafe fn fileModificationDate(&self) -> Option<Retained<NSDate>>
pub unsafe fn setFileModificationDate( &self, file_modification_date: Option<&NSDate> )
pub unsafe fn documentState(&self) -> UIDocumentState
pub unsafe fn progress(&self) -> Option<Retained<NSProgress>>
pub unsafe fn openWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(Bool)>> )
Available on crate feature
block2 only.pub unsafe fn closeWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(Bool)>> )
Available on crate feature
block2 only.pub unsafe fn loadFromContents_ofType_error( &self, contents: &AnyObject, type_name: Option<&NSString> ) -> Result<(), Retained<NSError>>
pub unsafe fn contentsForType_error( &self, type_name: &NSString ) -> Result<Retained<AnyObject>, Retained<NSError>>
pub unsafe fn disableEditing(&self)
pub unsafe fn enableEditing(&self)
pub unsafe fn undoManager(&self) -> Option<Retained<NSUndoManager>>
pub unsafe fn setUndoManager(&self, undo_manager: Option<&NSUndoManager>)
pub unsafe fn hasUnsavedChanges(&self) -> bool
pub unsafe fn updateChangeCount(&self, change: UIDocumentChangeKind)
pub unsafe fn changeCountTokenForSaveOperation( &self, save_operation: UIDocumentSaveOperation ) -> Retained<AnyObject>
pub unsafe fn updateChangeCountWithToken_forSaveOperation( &self, change_count_token: &AnyObject, save_operation: UIDocumentSaveOperation )
pub unsafe fn saveToURL_forSaveOperation_completionHandler( &self, url: &NSURL, save_operation: UIDocumentSaveOperation, completion_handler: Option<&Block<dyn Fn(Bool)>> )
Available on crate feature
block2 only.pub unsafe fn autosaveWithCompletionHandler( &self, completion_handler: Option<&Block<dyn Fn(Bool)>> )
Available on crate feature
block2 only.pub unsafe fn savingFileType(&self) -> Option<Retained<NSString>>
pub unsafe fn fileNameExtensionForType_saveOperation( &self, type_name: Option<&NSString>, save_operation: UIDocumentSaveOperation ) -> Retained<NSString>
pub unsafe fn writeContents_andAttributes_safelyToURL_forSaveOperation_error( &self, contents: &AnyObject, additional_file_attributes: Option<&NSDictionary>, url: &NSURL, save_operation: UIDocumentSaveOperation ) -> Result<(), Retained<NSError>>
pub unsafe fn writeContents_toURL_forSaveOperation_originalContentsURL_error( &self, contents: &AnyObject, url: &NSURL, save_operation: UIDocumentSaveOperation, original_contents_url: Option<&NSURL> ) -> Result<(), Retained<NSError>>
pub unsafe fn fileAttributesToWriteToURL_forSaveOperation_error( &self, url: &NSURL, save_operation: UIDocumentSaveOperation ) -> Result<Retained<NSDictionary>, Retained<NSError>>
pub unsafe fn readFromURL_error( &self, url: &NSURL ) -> Result<(), Retained<NSError>>
pub unsafe fn performAsynchronousFileAccessUsingBlock( &self, block: &Block<dyn Fn()> )
Available on crate feature
block2 only.pub unsafe fn handleError_userInteractionPermitted( &self, error: &NSError, user_interaction_permitted: bool )
pub unsafe fn finishedHandlingError_recovered( &self, error: &NSError, recovered: bool )
pub unsafe fn userInteractionNoLongerPermittedForError(&self, error: &NSError)
pub unsafe fn revertToContentsOfURL_completionHandler( &self, url: &NSURL, completion_handler: Option<&Block<dyn Fn(Bool)>> )
Available on crate feature
block2 only.source§impl UIDocument
impl UIDocument
Methods declared on superclass NSObject
source§impl UIDocument
impl UIDocument
ActivityContinuation
pub unsafe fn userActivity(&self) -> Option<Retained<NSUserActivity>>
pub unsafe fn setUserActivity(&self, user_activity: Option<&NSUserActivity>)
pub unsafe fn updateUserActivityState(&self, user_activity: &NSUserActivity)
pub unsafe fn restoreUserActivityState(&self, user_activity: &NSUserActivity)
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 UIIndirectScribbleInteraction only.
pub fn class(&self) -> &'static AnyClass
UIIndirectScribbleInteraction 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 UIIndirectScribbleInteraction only.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load instead.UIIndirectScribbleInteraction 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 UIIndirectScribbleInteraction only.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut instead.UIIndirectScribbleInteraction 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 UIDocument
impl AsMut<AnyObject> for UIDocument
source§impl AsMut<NSObject> for UIDocument
impl AsMut<NSObject> for UIDocument
source§impl AsMut<UIDocument> for UIDocument
impl AsMut<UIDocument> for UIDocument
source§impl AsMut<UIDocument> for UIManagedDocument
Available on crate feature UIManagedDocument only.
impl AsMut<UIDocument> for UIManagedDocument
Available on crate feature
UIManagedDocument only.source§fn as_mut(&mut self) -> &mut UIDocument
fn as_mut(&mut self) -> &mut UIDocument
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl AsRef<AnyObject> for UIDocument
impl AsRef<AnyObject> for UIDocument
source§impl AsRef<NSObject> for UIDocument
impl AsRef<NSObject> for UIDocument
source§impl AsRef<UIDocument> for UIDocument
impl AsRef<UIDocument> for UIDocument
source§impl AsRef<UIDocument> for UIManagedDocument
Available on crate feature UIManagedDocument only.
impl AsRef<UIDocument> for UIManagedDocument
Available on crate feature
UIManagedDocument only.source§fn as_ref(&self) -> &UIDocument
fn as_ref(&self) -> &UIDocument
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Borrow<AnyObject> for UIDocument
impl Borrow<AnyObject> for UIDocument
source§impl Borrow<NSObject> for UIDocument
impl Borrow<NSObject> for UIDocument
source§impl Borrow<UIDocument> for UIManagedDocument
Available on crate feature UIManagedDocument only.
impl Borrow<UIDocument> for UIManagedDocument
Available on crate feature
UIManagedDocument only.source§fn borrow(&self) -> &UIDocument
fn borrow(&self) -> &UIDocument
Immutably borrows from an owned value. Read more
source§impl BorrowMut<AnyObject> for UIDocument
impl BorrowMut<AnyObject> for UIDocument
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 UIDocument
impl BorrowMut<NSObject> for UIDocument
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 BorrowMut<UIDocument> for UIManagedDocument
Available on crate feature UIManagedDocument only.
impl BorrowMut<UIDocument> for UIManagedDocument
Available on crate feature
UIManagedDocument only.source§fn borrow_mut(&mut self) -> &mut UIDocument
fn borrow_mut(&mut self) -> &mut UIDocument
Mutably borrows from an owned value. Read more
source§impl ClassType for UIDocument
impl ClassType for UIDocument
§type Mutability = MainThreadOnly
type Mutability = MainThreadOnly
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "UIDocument"
const NAME: &'static str = "UIDocument"
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 UIDocument
impl Debug for UIDocument
source§impl Deref for UIDocument
impl Deref for UIDocument
source§impl DerefMut for UIDocument
impl DerefMut for UIDocument
source§impl Hash for UIDocument
impl Hash for UIDocument
source§impl NSFilePresenter for UIDocument
impl NSFilePresenter for UIDocument
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 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§impl NSObjectProtocol for UIDocument
impl NSObjectProtocol for UIDocument
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 NSProgressReporting for UIDocument
impl NSProgressReporting for UIDocument
source§impl PartialEq for UIDocument
impl PartialEq for UIDocument
source§fn eq(&self, other: &UIDocument) -> bool
fn eq(&self, other: &UIDocument) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl RefEncode for UIDocument
impl RefEncode for UIDocument
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
source§impl UIUserActivityRestoring for UIDocument
Available on crate feature UIUserActivity only.
impl UIUserActivityRestoring for UIDocument
Available on crate feature
UIUserActivity only.unsafe fn restoreUserActivityState(&self, user_activity: &NSUserActivity)
impl Eq for UIDocument
impl Message for UIDocument
impl StructuralPartialEq for UIDocument
Auto Trait Implementations§
impl !Freeze for UIDocument
impl !RefUnwindSafe for UIDocument
impl !Send for UIDocument
impl !Sync for UIDocument
impl !Unpin for UIDocument
impl !UnwindSafe for UIDocument
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