objc2_call_kit/generated/CXCallController.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "dispatch2")]
6use dispatch2::*;
7use objc2::__framework_prelude::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 /// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxcallcontroller?language=objc)
14 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct CXCallController;
17);
18
19extern_conformance!(
20 unsafe impl NSObjectProtocol for CXCallController {}
21);
22
23impl CXCallController {
24 extern_methods!(
25 /// Initialize call controller with a private, serial queue.
26 #[unsafe(method(init))]
27 #[unsafe(method_family = init)]
28 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
29
30 #[cfg(feature = "dispatch2")]
31 /// Initialize call controller with specified queue, which is used for calling completion blocks.
32 ///
33 /// # Safety
34 ///
35 /// `queue` possibly has additional threading requirements.
36 #[unsafe(method(initWithQueue:))]
37 #[unsafe(method_family = init)]
38 pub unsafe fn initWithQueue(this: Allocated<Self>, queue: &DispatchQueue)
39 -> Retained<Self>;
40
41 #[cfg(feature = "CXCallObserver")]
42 #[unsafe(method(callObserver))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn callObserver(&self) -> Retained<CXCallObserver>;
45
46 #[cfg(all(feature = "CXTransaction", feature = "block2"))]
47 /// Request a transaction to be performed by the in-app provider.
48 ///
49 /// If the completion block is called with a nil error, then the transaction will be passed to the CXProvider's -provider:executeTransaction: delegate callback.
50 /// A non-nil error indicates that the requested transaction could not be executed.
51 ///
52 /// Completion block is performed on the queue supplied to designated initializer.
53 #[unsafe(method(requestTransaction:completion:))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn requestTransaction_completion(
56 &self,
57 transaction: &CXTransaction,
58 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
59 );
60
61 #[cfg(all(feature = "CXAction", feature = "block2"))]
62 /// Request a transaction containing the specified actions to be performed by the in-app provider.
63 ///
64 /// If the completion block is called with a nil error, then the transaction will be passed to the CXProvider's -provider:executeTransaction: delegate callback.
65 /// A non-nil error indicates that the requested transaction could not be executed.
66 ///
67 /// Completion block is performed on the queue supplied to designated initializer.
68 #[unsafe(method(requestTransactionWithActions:completion:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn requestTransactionWithActions_completion(
71 &self,
72 actions: &NSArray<CXAction>,
73 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
74 );
75
76 #[cfg(all(feature = "CXAction", feature = "block2"))]
77 /// Request a transaction containing the specified action to be performed by the in-app provider.
78 ///
79 /// If the completion block is called with a nil error, then the transaction will be passed to the CXProvider's -provider:executeTransaction: delegate callback.
80 /// A non-nil error indicates that the requested transaction could not be executed.
81 ///
82 /// Completion block is performed on the queue supplied to designated initializer.
83 #[unsafe(method(requestTransactionWithAction:completion:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn requestTransactionWithAction_completion(
86 &self,
87 action: &CXAction,
88 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
89 );
90 );
91}
92
93/// Methods declared on superclass `NSObject`.
94impl CXCallController {
95 extern_methods!(
96 #[unsafe(method(new))]
97 #[unsafe(method_family = new)]
98 pub unsafe fn new() -> Retained<Self>;
99 );
100}