objc2_cloud_kit/generated/
CKSystemSharingUIObserver.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cksystemsharinguiobserver?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct CKSystemSharingUIObserver;
15);
16
17unsafe impl NSObjectProtocol for CKSystemSharingUIObserver {}
18
19impl CKSystemSharingUIObserver {
20    extern_methods!(
21        #[unsafe(method(init))]
22        #[unsafe(method_family = init)]
23        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
24
25        #[unsafe(method(new))]
26        #[unsafe(method_family = new)]
27        pub unsafe fn new() -> Retained<Self>;
28
29        #[cfg(feature = "CKContainer")]
30        #[unsafe(method(initWithContainer:))]
31        #[unsafe(method_family = init)]
32        pub unsafe fn initWithContainer(
33            this: Allocated<Self>,
34            container: &CKContainer,
35        ) -> Retained<Self>;
36
37        #[cfg(all(
38            feature = "CKRecord",
39            feature = "CKRecordID",
40            feature = "CKShare",
41            feature = "block2"
42        ))]
43        /// Called on success or failure of a
44        /// `CKShare`save after user modifications via the system sharing UI
45        ///
46        ///
47        /// Following a successful share save by the system sharing UI in the provided
48        /// `CKContainer,`this callback will be invoked with a nonnull
49        /// `recordID,`a nonnull
50        /// `share,`and a nil
51        /// `error.`Following a save failure due to a per-item error (
52        /// `CKErrorServerRecordChanged,`for example), this callback will be invoked with a nonnull
53        /// `recordID,`a nil
54        /// `share,`and a nonnull
55        /// `error`Each
56        /// `CKSystemSharingUIObserver`instance has a private serial queue. This queue is used for all callback block invocations.
57        #[unsafe(method(systemSharingUIDidSaveShareBlock))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn systemSharingUIDidSaveShareBlock(
60            &self,
61        ) -> *mut block2::Block<dyn Fn(NonNull<CKRecordID>, *mut CKShare, *mut NSError)>;
62
63        #[cfg(all(
64            feature = "CKRecord",
65            feature = "CKRecordID",
66            feature = "CKShare",
67            feature = "block2"
68        ))]
69        /// Setter for [`systemSharingUIDidSaveShareBlock`][Self::systemSharingUIDidSaveShareBlock].
70        #[unsafe(method(setSystemSharingUIDidSaveShareBlock:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn setSystemSharingUIDidSaveShareBlock(
73            &self,
74            system_sharing_ui_did_save_share_block: Option<
75                &block2::Block<dyn Fn(NonNull<CKRecordID>, *mut CKShare, *mut NSError)>,
76            >,
77        );
78
79        #[cfg(all(feature = "CKRecordID", feature = "block2"))]
80        /// Called on success or failure of a
81        /// `CKShare`delete when the user decides to stop sharing via the system sharing UI
82        ///
83        ///
84        /// Each
85        /// `CKSystemSharingUIObserver`instance has a private serial queue. This queue is used for all callback block invocations.
86        #[unsafe(method(systemSharingUIDidStopSharingBlock))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn systemSharingUIDidStopSharingBlock(
89            &self,
90        ) -> *mut block2::Block<dyn Fn(NonNull<CKRecordID>, *mut NSError)>;
91
92        #[cfg(all(feature = "CKRecordID", feature = "block2"))]
93        /// Setter for [`systemSharingUIDidStopSharingBlock`][Self::systemSharingUIDidStopSharingBlock].
94        #[unsafe(method(setSystemSharingUIDidStopSharingBlock:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn setSystemSharingUIDidStopSharingBlock(
97            &self,
98            system_sharing_ui_did_stop_sharing_block: Option<
99                &block2::Block<dyn Fn(NonNull<CKRecordID>, *mut NSError)>,
100            >,
101        );
102    );
103}