objc2_ui_kit/generated/
UIManagedDocument.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-data")]
7use objc2_core_data::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uimanageddocument?language=objc)
14    #[unsafe(super(UIDocument, NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "UIDocument")]
18    pub struct UIManagedDocument;
19);
20
21#[cfg(feature = "UIDocument")]
22extern_conformance!(
23    unsafe impl NSFilePresenter for UIManagedDocument {}
24);
25
26#[cfg(feature = "UIDocument")]
27extern_conformance!(
28    unsafe impl NSObjectProtocol for UIManagedDocument {}
29);
30
31#[cfg(feature = "UIDocument")]
32extern_conformance!(
33    unsafe impl NSProgressReporting for UIManagedDocument {}
34);
35
36#[cfg(feature = "UIDocument")]
37impl UIManagedDocument {
38    extern_methods!(
39        #[unsafe(method(persistentStoreName))]
40        #[unsafe(method_family = none)]
41        pub fn persistentStoreName(mtm: MainThreadMarker) -> Retained<NSString>;
42
43        #[cfg(feature = "objc2-core-data")]
44        #[unsafe(method(managedObjectContext))]
45        #[unsafe(method_family = none)]
46        pub fn managedObjectContext(&self) -> Retained<NSManagedObjectContext>;
47
48        #[cfg(feature = "objc2-core-data")]
49        #[unsafe(method(managedObjectModel))]
50        #[unsafe(method_family = none)]
51        pub fn managedObjectModel(&self) -> Retained<NSManagedObjectModel>;
52
53        #[unsafe(method(persistentStoreOptions))]
54        #[unsafe(method_family = none)]
55        pub fn persistentStoreOptions(&self) -> Option<Retained<NSDictionary>>;
56
57        /// Setter for [`persistentStoreOptions`][Self::persistentStoreOptions].
58        ///
59        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
60        ///
61        /// # Safety
62        ///
63        /// `persistent_store_options` generic should be of the correct type.
64        #[unsafe(method(setPersistentStoreOptions:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn setPersistentStoreOptions(
67            &self,
68            persistent_store_options: Option<&NSDictionary>,
69        );
70
71        #[unsafe(method(modelConfiguration))]
72        #[unsafe(method_family = none)]
73        pub fn modelConfiguration(&self) -> Option<Retained<NSString>>;
74
75        /// Setter for [`modelConfiguration`][Self::modelConfiguration].
76        ///
77        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
78        #[unsafe(method(setModelConfiguration:))]
79        #[unsafe(method_family = none)]
80        pub fn setModelConfiguration(&self, model_configuration: Option<&NSString>);
81
82        /// # Safety
83        ///
84        /// `store_options` generic should be of the correct type.
85        #[unsafe(method(configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error:_))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn configurePersistentStoreCoordinatorForURL_ofType_modelConfiguration_storeOptions_error(
88            &self,
89            store_url: &NSURL,
90            file_type: &NSString,
91            configuration: Option<&NSString>,
92            store_options: Option<&NSDictionary>,
93        ) -> Result<(), Retained<NSError>>;
94
95        #[unsafe(method(persistentStoreTypeForFileType:))]
96        #[unsafe(method_family = none)]
97        pub fn persistentStoreTypeForFileType(&self, file_type: &NSString) -> Retained<NSString>;
98
99        #[unsafe(method(readAdditionalContentFromURL:error:_))]
100        #[unsafe(method_family = none)]
101        pub fn readAdditionalContentFromURL_error(
102            &self,
103            absolute_url: &NSURL,
104        ) -> Result<(), Retained<NSError>>;
105
106        #[unsafe(method(additionalContentForURL:error:_))]
107        #[unsafe(method_family = none)]
108        pub fn additionalContentForURL_error(
109            &self,
110            absolute_url: &NSURL,
111        ) -> Result<Retained<AnyObject>, Retained<NSError>>;
112
113        /// # Safety
114        ///
115        /// `content` should be of the correct type.
116        #[unsafe(method(writeAdditionalContent:toURL:originalContentsURL:error:_))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn writeAdditionalContent_toURL_originalContentsURL_error(
119            &self,
120            content: &AnyObject,
121            absolute_url: &NSURL,
122            absolute_original_contents_url: Option<&NSURL>,
123        ) -> Result<(), Retained<NSError>>;
124    );
125}
126
127/// Methods declared on superclass `UIDocument`.
128#[cfg(feature = "UIDocument")]
129impl UIManagedDocument {
130    extern_methods!(
131        #[unsafe(method(initWithFileURL:))]
132        #[unsafe(method_family = init)]
133        pub fn initWithFileURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
134    );
135}
136
137/// Methods declared on superclass `NSObject`.
138#[cfg(feature = "UIDocument")]
139impl UIManagedDocument {
140    extern_methods!(
141        #[unsafe(method(init))]
142        #[unsafe(method_family = init)]
143        pub fn init(this: Allocated<Self>) -> Retained<Self>;
144
145        #[unsafe(method(new))]
146        #[unsafe(method_family = new)]
147        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
148    );
149}