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 #[unsafe(method(initWithQueue:))]
33 #[unsafe(method_family = init)]
34 pub unsafe fn initWithQueue(this: Allocated<Self>, queue: &DispatchQueue)
35 -> Retained<Self>;
36
37 #[cfg(feature = "CXCallObserver")]
38 #[unsafe(method(callObserver))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn callObserver(&self) -> Retained<CXCallObserver>;
41
42 #[cfg(all(feature = "CXTransaction", feature = "block2"))]
43 /// Request a transaction to be performed by the in-app provider.
44 ///
45 /// If the completion block is called with a nil error, then the transaction will be passed to the CXProvider's -provider:executeTransaction: delegate callback.
46 /// A non-nil error indicates that the requested transaction could not be executed.
47 ///
48 /// Completion block is performed on the queue supplied to designated initializer.
49 #[unsafe(method(requestTransaction:completion:))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn requestTransaction_completion(
52 &self,
53 transaction: &CXTransaction,
54 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
55 );
56
57 #[cfg(all(feature = "CXAction", feature = "block2"))]
58 /// Request a transaction containing the specified actions to be performed by the in-app provider.
59 ///
60 /// If the completion block is called with a nil error, then the transaction will be passed to the CXProvider's -provider:executeTransaction: delegate callback.
61 /// A non-nil error indicates that the requested transaction could not be executed.
62 ///
63 /// Completion block is performed on the queue supplied to designated initializer.
64 #[unsafe(method(requestTransactionWithActions:completion:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn requestTransactionWithActions_completion(
67 &self,
68 actions: &NSArray<CXAction>,
69 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
70 );
71
72 #[cfg(all(feature = "CXAction", feature = "block2"))]
73 /// Request a transaction containing the specified action to be performed by the in-app provider.
74 ///
75 /// If the completion block is called with a nil error, then the transaction will be passed to the CXProvider's -provider:executeTransaction: delegate callback.
76 /// A non-nil error indicates that the requested transaction could not be executed.
77 ///
78 /// Completion block is performed on the queue supplied to designated initializer.
79 #[unsafe(method(requestTransactionWithAction:completion:))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn requestTransactionWithAction_completion(
82 &self,
83 action: &CXAction,
84 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
85 );
86 );
87}
88
89/// Methods declared on superclass `NSObject`.
90impl CXCallController {
91 extern_methods!(
92 #[unsafe(method(new))]
93 #[unsafe(method_family = new)]
94 pub unsafe fn new() -> Retained<Self>;
95 );
96}