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
16unsafe impl NSObjectProtocol for NSFileProviderRequest {}
17
18impl NSFileProviderRequest {
19    extern_methods!(
20        /// The request was made by the sync system, e.g. to update a file to its latest version after a remote update was pushed.
21        ///
22        /// This is only valid for NSFileProviderRequest objects passed to these methods:
23        /// - [NSFileProviderEnumerating enumeratorForContainerItemIdentifier:]
24        /// - [NSFileProviderReplicatedExtension fetchContentsForItemWithIdentifier:]
25        ///
26        /// For sync up methods (createItem/modifyItem/deleteItem), the system does not know which actor made the
27        /// modifications to the file, so it cannot supply this information.
28        #[unsafe(method(isSystemRequest))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn isSystemRequest(&self) -> bool;
31
32        /// The request was made by Finder or one of its helpers.
33        ///
34        /// This is only valid for NSFileProviderRequest objects passed to these methods:
35        /// - [NSFileProviderEnumerating enumeratorForContainerItemIdentifier:]
36        /// - [NSFileProviderReplicatedExtension fetchContentsForItemWithIdentifier:]
37        ///
38        /// For sync up methods (createItem/modifyItem/deleteItem), the system does not know which actor made the
39        /// modifications to the file, so it cannot supply this information.
40        #[unsafe(method(isFileViewerRequest))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn isFileViewerRequest(&self) -> bool;
43
44        /// The URL of the requesting executable. This will always be nil unless both an MDM profile key is set, and the
45        /// provider's application is installed by an MDM profile.
46        #[unsafe(method(requestingExecutable))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn requestingExecutable(&self) -> Option<Retained<NSURL>>;
49
50        #[cfg(feature = "NSFileProviderDomain")]
51        /// The version of the domain when the event that triggered the request was observed.
52        ///
53        /// If the extension doesn't implement the NSFileProviderDomainState protocol, this will be nil.
54        #[unsafe(method(domainVersion))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn domainVersion(&self) -> Option<Retained<NSFileProviderDomainVersion>>;
57    );
58}
59
60/// Methods declared on superclass `NSObject`.
61impl NSFileProviderRequest {
62    extern_methods!(
63        #[unsafe(method(init))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
66
67        #[unsafe(method(new))]
68        #[unsafe(method_family = new)]
69        pub unsafe fn new() -> Retained<Self>;
70    );
71}