objc2_cloud_kit/generated/
CKAcceptSharesOperation.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/ckacceptsharesoperation?language=objc)
12    #[unsafe(super(CKOperation, NSOperation, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "CKOperation")]
15    pub struct CKAcceptSharesOperation;
16);
17
18#[cfg(feature = "CKOperation")]
19extern_conformance!(
20    unsafe impl NSObjectProtocol for CKAcceptSharesOperation {}
21);
22
23#[cfg(feature = "CKOperation")]
24impl CKAcceptSharesOperation {
25    extern_methods!(
26        #[unsafe(method(init))]
27        #[unsafe(method_family = init)]
28        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
29
30        #[cfg(feature = "CKShareMetadata")]
31        #[unsafe(method(initWithShareMetadatas:))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn initWithShareMetadatas(
34            this: Allocated<Self>,
35            share_metadatas: &NSArray<CKShareMetadata>,
36        ) -> Retained<Self>;
37
38        #[cfg(feature = "CKShareMetadata")]
39        #[unsafe(method(shareMetadatas))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn shareMetadatas(&self) -> Option<Retained<NSArray<CKShareMetadata>>>;
42
43        #[cfg(feature = "CKShareMetadata")]
44        /// Setter for [`shareMetadatas`][Self::shareMetadatas].
45        #[unsafe(method(setShareMetadatas:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn setShareMetadatas(&self, share_metadatas: Option<&NSArray<CKShareMetadata>>);
48
49        #[cfg(all(
50            feature = "CKRecord",
51            feature = "CKShare",
52            feature = "CKShareMetadata",
53            feature = "block2"
54        ))]
55        /// Called once for each share metadata that the server processed
56        ///
57        ///
58        /// If error is nil then the share was successfully accepted.
59        /// Each
60        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
61        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
62        /// should not be concurrently used outside of blocks assigned to this operation.
63        #[unsafe(method(perShareCompletionBlock))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn perShareCompletionBlock(
66            &self,
67        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKShareMetadata>, *mut CKShare, *mut NSError)>;
68
69        #[cfg(all(
70            feature = "CKRecord",
71            feature = "CKShare",
72            feature = "CKShareMetadata",
73            feature = "block2"
74        ))]
75        /// Setter for [`perShareCompletionBlock`][Self::perShareCompletionBlock].
76        #[unsafe(method(setPerShareCompletionBlock:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setPerShareCompletionBlock(
79            &self,
80            per_share_completion_block: Option<
81                &block2::DynBlock<dyn Fn(NonNull<CKShareMetadata>, *mut CKShare, *mut NSError)>,
82            >,
83        );
84
85        #[cfg(feature = "block2")]
86        /// This block is called when the operation completes.
87        ///
88        ///
89        /// The
90        ///
91        /// ```text
92        ///  -[NSOperation completionBlock]
93        /// ```
94        ///
95        /// will also be called if both are set.
96        /// If the error is
97        /// `CKErrorPartialFailure,`the error's userInfo dictionary contains a dictionary of shareURLs to errors keyed off of
98        /// `CKPartialErrorsByItemIDKey.`These errors are repeats of those sent back in previous
99        /// `perShareCompletionBlock`invocations
100        /// Each
101        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
102        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
103        /// should not be concurrently used outside of blocks assigned to this operation.
104        #[unsafe(method(acceptSharesCompletionBlock))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn acceptSharesCompletionBlock(
107            &self,
108        ) -> *mut block2::DynBlock<dyn Fn(*mut NSError)>;
109
110        #[cfg(feature = "block2")]
111        /// Setter for [`acceptSharesCompletionBlock`][Self::acceptSharesCompletionBlock].
112        #[unsafe(method(setAcceptSharesCompletionBlock:))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn setAcceptSharesCompletionBlock(
115            &self,
116            accept_shares_completion_block: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
117        );
118    );
119}
120
121/// Methods declared on superclass `NSObject`.
122#[cfg(feature = "CKOperation")]
123impl CKAcceptSharesOperation {
124    extern_methods!(
125        #[unsafe(method(new))]
126        #[unsafe(method_family = new)]
127        pub unsafe fn new() -> Retained<Self>;
128    );
129}