objc2_file_provider/generated/NSFileProviderRequest.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileproviderrequest?language=objc)
11 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 pub struct NSFileProviderRequest;
14);
15
16extern_conformance!(
17 unsafe impl NSObjectProtocol for NSFileProviderRequest {}
18);
19
20impl NSFileProviderRequest {
21 extern_methods!(
22 /// The request was made by the sync system, e.g. to update a file to its latest version after a remote update was pushed.
23 ///
24 /// This is only valid for NSFileProviderRequest objects passed to these methods:
25 /// - [NSFileProviderEnumerating enumeratorForContainerItemIdentifier:]
26 /// - [NSFileProviderReplicatedExtension fetchContentsForItemWithIdentifier:]
27 ///
28 /// For sync up methods (createItem/modifyItem/deleteItem), the system does not know which actor made the
29 /// modifications to the file, so it cannot supply this information.
30 #[unsafe(method(isSystemRequest))]
31 #[unsafe(method_family = none)]
32 pub unsafe fn isSystemRequest(&self) -> bool;
33
34 /// The request was made by Finder or one of its helpers.
35 ///
36 /// This is only valid for NSFileProviderRequest objects passed to these methods:
37 /// - [NSFileProviderEnumerating enumeratorForContainerItemIdentifier:]
38 /// - [NSFileProviderReplicatedExtension fetchContentsForItemWithIdentifier:]
39 ///
40 /// For sync up methods (createItem/modifyItem/deleteItem), the system does not know which actor made the
41 /// modifications to the file, so it cannot supply this information.
42 #[unsafe(method(isFileViewerRequest))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn isFileViewerRequest(&self) -> bool;
45
46 /// The URL of the requesting executable. This will always be nil unless both an MDM profile key is set, and the
47 /// provider's application is installed by an MDM profile.
48 #[unsafe(method(requestingExecutable))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn requestingExecutable(&self) -> Option<Retained<NSURL>>;
51
52 #[cfg(feature = "NSFileProviderDomain")]
53 /// The version of the domain when the event that triggered the request was observed.
54 ///
55 /// If the extension doesn't implement the NSFileProviderDomainState protocol, this will be nil.
56 #[unsafe(method(domainVersion))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn domainVersion(&self) -> Option<Retained<NSFileProviderDomainVersion>>;
59 );
60}
61
62/// Methods declared on superclass `NSObject`.
63impl NSFileProviderRequest {
64 extern_methods!(
65 #[unsafe(method(init))]
66 #[unsafe(method_family = init)]
67 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
68
69 #[unsafe(method(new))]
70 #[unsafe(method_family = new)]
71 pub unsafe fn new() -> Retained<Self>;
72 );
73}