objc2_call_kit/generated/
CXCallDirectoryExtensionContext.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_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxcalldirectoryextensioncontextdelegate?language=objc)
12    pub unsafe trait CXCallDirectoryExtensionContextDelegate: NSObjectProtocol {
13        #[unsafe(method(requestFailedForExtensionContext:withError:))]
14        #[unsafe(method_family = none)]
15        unsafe fn requestFailedForExtensionContext_withError(
16            &self,
17            extension_context: &CXCallDirectoryExtensionContext,
18            error: &NSError,
19        );
20    }
21);
22
23extern_class!(
24    /// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxcalldirectoryextensioncontext?language=objc)
25    #[unsafe(super(NSExtensionContext, NSObject))]
26    #[derive(Debug, PartialEq, Eq, Hash)]
27    pub struct CXCallDirectoryExtensionContext;
28);
29
30extern_conformance!(
31    unsafe impl NSObjectProtocol for CXCallDirectoryExtensionContext {}
32);
33
34impl CXCallDirectoryExtensionContext {
35    extern_methods!(
36        #[unsafe(method(delegate))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn delegate(
39            &self,
40        ) -> Option<Retained<ProtocolObject<dyn CXCallDirectoryExtensionContextDelegate>>>;
41
42        /// Setter for [`delegate`][Self::delegate].
43        ///
44        /// This is a [weak property][objc2::topics::weak_property].
45        #[unsafe(method(setDelegate:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn setDelegate(
48            &self,
49            delegate: Option<&ProtocolObject<dyn CXCallDirectoryExtensionContextDelegate>>,
50        );
51
52        /// Whether the request should provide incremental data.
53        ///
54        /// If this is called at the beginning of the request (before any entries have been added or removed) and the result is YES,
55        /// then the request must only provide an "incremental" set of entries, i.e. only add or remove entries relative to the last time data
56        /// was loaded for the extension. Otherwise, if this method is not called OR is called and returns NO, then the request must provide
57        /// a "complete" set of entries, adding the full list of entries from scratch (and removing none), regardless of whether data has ever been
58        /// successfully loaded in the past.
59        #[unsafe(method(isIncremental))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn isIncremental(&self) -> bool;
62
63        #[cfg(feature = "CXCallDirectory")]
64        #[unsafe(method(addBlockingEntryWithNextSequentialPhoneNumber:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn addBlockingEntryWithNextSequentialPhoneNumber(
67            &self,
68            phone_number: CXCallDirectoryPhoneNumber,
69        );
70
71        #[cfg(feature = "CXCallDirectory")]
72        /// Remove blocking entry with the specified phone number.
73        ///
74        /// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
75        /// API to remove a previously-added blocking entry.
76        ///
77        ///
78        /// Parameter `phoneNumber`: The blocking entry phone number to remove.
79        #[unsafe(method(removeBlockingEntryWithPhoneNumber:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn removeBlockingEntryWithPhoneNumber(
82            &self,
83            phone_number: CXCallDirectoryPhoneNumber,
84        );
85
86        /// Remove all currently-stored blocking entries.
87        ///
88        /// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
89        /// API to remove all previously-added blocking entries.
90        #[unsafe(method(removeAllBlockingEntries))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn removeAllBlockingEntries(&self);
93
94        #[cfg(feature = "CXCallDirectory")]
95        #[unsafe(method(addIdentificationEntryWithNextSequentialPhoneNumber:label:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn addIdentificationEntryWithNextSequentialPhoneNumber_label(
98            &self,
99            phone_number: CXCallDirectoryPhoneNumber,
100            label: &NSString,
101        );
102
103        #[cfg(feature = "CXCallDirectory")]
104        /// Remove identification entry with the specified phone number.
105        ///
106        /// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
107        /// API to remove a previously-added identification entry. Removes all identification entries with the specified phone number, even if
108        /// multiple identification entries with different labels are present for a single phone number.
109        ///
110        ///
111        /// Parameter `phoneNumber`: The identification entry phone number to remove.
112        #[unsafe(method(removeIdentificationEntryWithPhoneNumber:))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn removeIdentificationEntryWithPhoneNumber(
115            &self,
116            phone_number: CXCallDirectoryPhoneNumber,
117        );
118
119        /// Remove all currently-stored identification entries.
120        ///
121        /// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
122        /// API to remove all previously-added identification entries.
123        #[unsafe(method(removeAllIdentificationEntries))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn removeAllIdentificationEntries(&self);
126
127        #[cfg(feature = "block2")]
128        #[unsafe(method(completeRequestWithCompletionHandler:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn completeRequestWithCompletionHandler(
131            &self,
132            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
133        );
134
135        #[cfg(feature = "block2")]
136        /// # Safety
137        ///
138        /// `items` generic should be of the correct type.
139        #[unsafe(method(completeRequestReturningItems:completionHandler:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn completeRequestReturningItems_completionHandler(
142            &self,
143            items: Option<&NSArray>,
144            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
145        );
146    );
147}
148
149/// Methods declared on superclass `NSObject`.
150impl CXCallDirectoryExtensionContext {
151    extern_methods!(
152        #[unsafe(method(init))]
153        #[unsafe(method_family = init)]
154        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
155
156        #[unsafe(method(new))]
157        #[unsafe(method_family = new)]
158        pub unsafe fn new() -> Retained<Self>;
159    );
160}