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