icrate/generated/FileProvider/
NSFileProviderItem.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use crate::common::*;
4use crate::AppKit::*;
5use crate::FileProvider::*;
6use crate::Foundation::*;
7use crate::UniformTypeIdentifiers::*;
8
9typed_extensible_enum!(
10    pub type NSFileProviderItemIdentifier = NSString;
11);
12
13extern_static!(NSFileProviderRootContainerItemIdentifier: &'static NSFileProviderItemIdentifier);
14
15extern_static!(NSFileProviderWorkingSetContainerItemIdentifier: &'static NSFileProviderItemIdentifier);
16
17extern_static!(NSFileProviderTrashContainerItemIdentifier: &'static NSFileProviderItemIdentifier);
18
19extern_class!(
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    #[cfg(feature = "FileProvider_NSFileProviderItemVersion")]
22    pub struct NSFileProviderItemVersion;
23
24    #[cfg(feature = "FileProvider_NSFileProviderItemVersion")]
25    unsafe impl ClassType for NSFileProviderItemVersion {
26        type Super = NSObject;
27        type Mutability = InteriorMutable;
28    }
29);
30
31#[cfg(feature = "FileProvider_NSFileProviderItemVersion")]
32unsafe impl NSObjectProtocol for NSFileProviderItemVersion {}
33
34extern_methods!(
35    #[cfg(feature = "FileProvider_NSFileProviderItemVersion")]
36    unsafe impl NSFileProviderItemVersion {
37        #[cfg(feature = "Foundation_NSData")]
38        #[method_id(@__retain_semantics Other beforeFirstSyncComponent)]
39        pub unsafe fn beforeFirstSyncComponent() -> Id<NSData>;
40
41        #[cfg(feature = "Foundation_NSData")]
42        #[method_id(@__retain_semantics Init initWithContentVersion:metadataVersion:)]
43        pub unsafe fn initWithContentVersion_metadataVersion(
44            this: Allocated<Self>,
45            content_version: &NSData,
46            metadata_version: &NSData,
47        ) -> Id<Self>;
48
49        #[cfg(feature = "Foundation_NSData")]
50        #[method_id(@__retain_semantics Other contentVersion)]
51        pub unsafe fn contentVersion(&self) -> Id<NSData>;
52
53        #[cfg(feature = "Foundation_NSData")]
54        #[method_id(@__retain_semantics Other metadataVersion)]
55        pub unsafe fn metadataVersion(&self) -> Id<NSData>;
56    }
57);
58
59extern_methods!(
60    /// Methods declared on superclass `NSObject`
61    #[cfg(feature = "FileProvider_NSFileProviderItemVersion")]
62    unsafe impl NSFileProviderItemVersion {
63        #[method_id(@__retain_semantics Init init)]
64        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
65
66        #[method_id(@__retain_semantics New new)]
67        pub unsafe fn new() -> Id<Self>;
68    }
69);
70
71extern_static!(NSFileProviderFavoriteRankUnranked: c_ulonglong);
72
73ns_options!(
74    #[underlying(NSUInteger)]
75    pub enum NSFileProviderItemCapabilities {
76        NSFileProviderItemCapabilitiesAllowsReading = 1 << 0,
77        NSFileProviderItemCapabilitiesAllowsWriting = 1 << 1,
78        NSFileProviderItemCapabilitiesAllowsReparenting = 1 << 2,
79        NSFileProviderItemCapabilitiesAllowsRenaming = 1 << 3,
80        NSFileProviderItemCapabilitiesAllowsTrashing = 1 << 4,
81        NSFileProviderItemCapabilitiesAllowsDeleting = 1 << 5,
82        #[deprecated = "use NSFileProviderContentPolicy instead"]
83        NSFileProviderItemCapabilitiesAllowsEvicting = 1 << 6,
84        NSFileProviderItemCapabilitiesAllowsExcludingFromSync = 1 << 7,
85        NSFileProviderItemCapabilitiesAllowsAddingSubItems =
86            NSFileProviderItemCapabilitiesAllowsWriting,
87        NSFileProviderItemCapabilitiesAllowsContentEnumerating =
88            NSFileProviderItemCapabilitiesAllowsReading,
89        #[deprecated = "This capability is no longer supported, and does not contain all capabilities. Please migrate to directly specifying each of the individual capabilities that should be allowed for the item."]
90        NSFileProviderItemCapabilitiesAllowsAll = NSFileProviderItemCapabilitiesAllowsReading
91            | NSFileProviderItemCapabilitiesAllowsWriting
92            | NSFileProviderItemCapabilitiesAllowsReparenting
93            | NSFileProviderItemCapabilitiesAllowsRenaming
94            | NSFileProviderItemCapabilitiesAllowsTrashing
95            | NSFileProviderItemCapabilitiesAllowsDeleting,
96    }
97);
98
99ns_options!(
100    #[underlying(NSUInteger)]
101    pub enum NSFileProviderItemFields {
102        NSFileProviderItemContents = 1 << 0,
103        NSFileProviderItemFilename = 1 << 1,
104        NSFileProviderItemParentItemIdentifier = 1 << 2,
105        NSFileProviderItemLastUsedDate = 1 << 3,
106        NSFileProviderItemTagData = 1 << 4,
107        NSFileProviderItemFavoriteRank = 1 << 5,
108        NSFileProviderItemCreationDate = 1 << 6,
109        NSFileProviderItemContentModificationDate = 1 << 7,
110        NSFileProviderItemFileSystemFlags = 1 << 8,
111        NSFileProviderItemExtendedAttributes = 1 << 9,
112        NSFileProviderItemTypeAndCreator = 1 << 10,
113    }
114);
115
116ns_options!(
117    #[underlying(NSUInteger)]
118    pub enum NSFileProviderFileSystemFlags {
119        NSFileProviderFileSystemUserExecutable = 1 << 0,
120        NSFileProviderFileSystemUserReadable = 1 << 1,
121        NSFileProviderFileSystemUserWritable = 1 << 2,
122        NSFileProviderFileSystemHidden = 1 << 3,
123        NSFileProviderFileSystemPathExtensionHidden = 1 << 4,
124    }
125);
126
127extern_struct!(
128    pub struct NSFileProviderTypeAndCreator {
129        pub r#type: OSType,
130        pub creator: OSType,
131    }
132);
133
134ns_enum!(
135    #[underlying(NSInteger)]
136    pub enum NSFileProviderContentPolicy {
137        NSFileProviderContentPolicyInherited = 0,
138        NSFileProviderContentPolicyDownloadLazily = 1,
139        NSFileProviderContentPolicyDownloadLazilyAndEvictOnRemoteUpdate = 2,
140        NSFileProviderContentPolicyDownloadEagerlyAndKeepDownloaded = 3,
141    }
142);
143
144extern_protocol!(
145    pub unsafe trait NSFileProviderItemProtocol: NSObjectProtocol {
146        #[method_id(@__retain_semantics Other itemIdentifier)]
147        unsafe fn itemIdentifier(&self) -> Id<NSFileProviderItemIdentifier>;
148
149        #[method_id(@__retain_semantics Other parentItemIdentifier)]
150        unsafe fn parentItemIdentifier(&self) -> Id<NSFileProviderItemIdentifier>;
151
152        #[cfg(feature = "Foundation_NSString")]
153        #[method_id(@__retain_semantics Other filename)]
154        unsafe fn filename(&self) -> Id<NSString>;
155
156        #[cfg(feature = "UniformTypeIdentifiers_UTType")]
157        #[optional]
158        #[method_id(@__retain_semantics Other contentType)]
159        unsafe fn contentType(&self) -> Id<UTType>;
160
161        #[cfg(feature = "Foundation_NSString")]
162        #[deprecated]
163        #[optional]
164        #[method_id(@__retain_semantics Other typeIdentifier)]
165        unsafe fn typeIdentifier(&self) -> Id<NSString>;
166
167        #[optional]
168        #[method(typeAndCreator)]
169        unsafe fn typeAndCreator(&self) -> NSFileProviderTypeAndCreator;
170
171        #[optional]
172        #[method(capabilities)]
173        unsafe fn capabilities(&self) -> NSFileProviderItemCapabilities;
174
175        #[optional]
176        #[method(fileSystemFlags)]
177        unsafe fn fileSystemFlags(&self) -> NSFileProviderFileSystemFlags;
178
179        #[cfg(feature = "Foundation_NSNumber")]
180        #[optional]
181        #[method_id(@__retain_semantics Other documentSize)]
182        unsafe fn documentSize(&self) -> Option<Id<NSNumber>>;
183
184        #[cfg(feature = "Foundation_NSNumber")]
185        #[optional]
186        #[method_id(@__retain_semantics Other childItemCount)]
187        unsafe fn childItemCount(&self) -> Option<Id<NSNumber>>;
188
189        #[cfg(feature = "Foundation_NSDate")]
190        #[optional]
191        #[method_id(@__retain_semantics Other creationDate)]
192        unsafe fn creationDate(&self) -> Option<Id<NSDate>>;
193
194        #[cfg(feature = "Foundation_NSDate")]
195        #[optional]
196        #[method_id(@__retain_semantics Other contentModificationDate)]
197        unsafe fn contentModificationDate(&self) -> Option<Id<NSDate>>;
198
199        #[cfg(all(
200            feature = "Foundation_NSData",
201            feature = "Foundation_NSDictionary",
202            feature = "Foundation_NSString"
203        ))]
204        #[optional]
205        #[method_id(@__retain_semantics Other extendedAttributes)]
206        unsafe fn extendedAttributes(&self) -> Id<NSDictionary<NSString, NSData>>;
207
208        #[cfg(feature = "Foundation_NSDate")]
209        #[optional]
210        #[method_id(@__retain_semantics Other lastUsedDate)]
211        unsafe fn lastUsedDate(&self) -> Option<Id<NSDate>>;
212
213        #[cfg(feature = "Foundation_NSData")]
214        #[optional]
215        #[method_id(@__retain_semantics Other tagData)]
216        unsafe fn tagData(&self) -> Option<Id<NSData>>;
217
218        #[cfg(feature = "Foundation_NSNumber")]
219        #[optional]
220        #[method_id(@__retain_semantics Other favoriteRank)]
221        unsafe fn favoriteRank(&self) -> Option<Id<NSNumber>>;
222
223        #[optional]
224        #[method(isTrashed)]
225        unsafe fn isTrashed(&self) -> bool;
226
227        #[optional]
228        #[method(isUploaded)]
229        unsafe fn isUploaded(&self) -> bool;
230
231        #[optional]
232        #[method(isUploading)]
233        unsafe fn isUploading(&self) -> bool;
234
235        #[cfg(feature = "Foundation_NSError")]
236        #[optional]
237        #[method_id(@__retain_semantics Other uploadingError)]
238        unsafe fn uploadingError(&self) -> Option<Id<NSError>>;
239
240        #[optional]
241        #[method(isDownloaded)]
242        unsafe fn isDownloaded(&self) -> bool;
243
244        #[optional]
245        #[method(isDownloading)]
246        unsafe fn isDownloading(&self) -> bool;
247
248        #[cfg(feature = "Foundation_NSError")]
249        #[optional]
250        #[method_id(@__retain_semantics Other downloadingError)]
251        unsafe fn downloadingError(&self) -> Option<Id<NSError>>;
252
253        #[optional]
254        #[method(isMostRecentVersionDownloaded)]
255        unsafe fn isMostRecentVersionDownloaded(&self) -> bool;
256
257        #[optional]
258        #[method(isShared)]
259        unsafe fn isShared(&self) -> bool;
260
261        #[optional]
262        #[method(isSharedByCurrentUser)]
263        unsafe fn isSharedByCurrentUser(&self) -> bool;
264
265        #[cfg(feature = "Foundation_NSPersonNameComponents")]
266        #[optional]
267        #[method_id(@__retain_semantics Other ownerNameComponents)]
268        unsafe fn ownerNameComponents(&self) -> Option<Id<NSPersonNameComponents>>;
269
270        #[cfg(feature = "Foundation_NSPersonNameComponents")]
271        #[optional]
272        #[method_id(@__retain_semantics Other mostRecentEditorNameComponents)]
273        unsafe fn mostRecentEditorNameComponents(&self) -> Option<Id<NSPersonNameComponents>>;
274
275        #[cfg(feature = "Foundation_NSData")]
276        #[optional]
277        #[method_id(@__retain_semantics Other versionIdentifier)]
278        unsafe fn versionIdentifier(&self) -> Option<Id<NSData>>;
279
280        #[cfg(feature = "FileProvider_NSFileProviderItemVersion")]
281        #[optional]
282        #[method_id(@__retain_semantics Other itemVersion)]
283        unsafe fn itemVersion(&self) -> Id<NSFileProviderItemVersion>;
284
285        #[cfg(feature = "Foundation_NSString")]
286        #[optional]
287        #[method_id(@__retain_semantics Other symlinkTargetPath)]
288        unsafe fn symlinkTargetPath(&self) -> Option<Id<NSString>>;
289
290        #[cfg(feature = "Foundation_NSDictionary")]
291        #[optional]
292        #[method_id(@__retain_semantics Other userInfo)]
293        unsafe fn userInfo(&self) -> Option<Id<NSDictionary>>;
294
295        #[optional]
296        #[method(contentPolicy)]
297        unsafe fn contentPolicy(&self) -> NSFileProviderContentPolicy;
298    }
299
300    unsafe impl ProtocolType for dyn NSFileProviderItemProtocol {
301        const NAME: &'static str = "NSFileProviderItem";
302    }
303);
304
305pub type NSFileProviderItem = ProtocolObject<dyn NSFileProviderItemProtocol>;