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