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 ///
60 /// # Safety
61 ///
62 /// - The returned block's argument 1 must be a valid pointer.
63 /// - The returned block's argument 2 must be a valid pointer or null.
64 /// - The returned block's argument 3 must be a valid pointer or null.
65 #[unsafe(method(systemSharingUIDidSaveShareBlock))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn systemSharingUIDidSaveShareBlock(
68 &self,
69 ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordID>, *mut CKShare, *mut NSError)>;
70
71 #[cfg(all(
72 feature = "CKRecord",
73 feature = "CKRecordID",
74 feature = "CKShare",
75 feature = "block2"
76 ))]
77 /// Setter for [`systemSharingUIDidSaveShareBlock`][Self::systemSharingUIDidSaveShareBlock].
78 ///
79 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
80 #[unsafe(method(setSystemSharingUIDidSaveShareBlock:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn setSystemSharingUIDidSaveShareBlock(
83 &self,
84 system_sharing_ui_did_save_share_block: Option<
85 &block2::DynBlock<dyn Fn(NonNull<CKRecordID>, *mut CKShare, *mut NSError)>,
86 >,
87 );
88
89 #[cfg(all(feature = "CKRecordID", feature = "block2"))]
90 /// Called on success or failure of a
91 /// `CKShare`delete when the user decides to stop sharing via the system sharing UI
92 ///
93 ///
94 /// Each
95 /// `CKSystemSharingUIObserver`instance has a private serial queue. This queue is used for all callback block invocations.
96 ///
97 /// # Safety
98 ///
99 /// - The returned block's argument 1 must be a valid pointer.
100 /// - The returned block's argument 2 must be a valid pointer or null.
101 #[unsafe(method(systemSharingUIDidStopSharingBlock))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn systemSharingUIDidStopSharingBlock(
104 &self,
105 ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordID>, *mut NSError)>;
106
107 #[cfg(all(feature = "CKRecordID", feature = "block2"))]
108 /// Setter for [`systemSharingUIDidStopSharingBlock`][Self::systemSharingUIDidStopSharingBlock].
109 ///
110 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
111 #[unsafe(method(setSystemSharingUIDidStopSharingBlock:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setSystemSharingUIDidStopSharingBlock(
114 &self,
115 system_sharing_ui_did_stop_sharing_block: Option<
116 &block2::DynBlock<dyn Fn(NonNull<CKRecordID>, *mut NSError)>,
117 >,
118 );
119 );
120}