objc2_core_telephony/generated/
CTCallCenter.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/coretelephony/ctcallcenter?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct CTCallCenter;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for CTCallCenter {}
19);
20
21impl CTCallCenter {
22    extern_methods!(
23        #[cfg(feature = "CTCall")]
24        #[unsafe(method(currentCalls))]
25        #[unsafe(method_family = none)]
26        pub unsafe fn currentCalls(&self) -> Option<Retained<NSSet<CTCall>>>;
27
28        #[cfg(all(feature = "CTCall", feature = "block2"))]
29        /// # Safety
30        ///
31        /// The returned block's argument must be a valid pointer.
32        #[unsafe(method(callEventHandler))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn callEventHandler(&self) -> *mut block2::DynBlock<dyn Fn(NonNull<CTCall>)>;
35
36        #[cfg(all(feature = "CTCall", feature = "block2"))]
37        /// Setter for [`callEventHandler`][Self::callEventHandler].
38        ///
39        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
40        #[unsafe(method(setCallEventHandler:))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn setCallEventHandler(
43            &self,
44            call_event_handler: Option<&block2::DynBlock<dyn Fn(NonNull<CTCall>)>>,
45        );
46    );
47}
48
49/// Methods declared on superclass `NSObject`.
50impl CTCallCenter {
51    extern_methods!(
52        #[unsafe(method(init))]
53        #[unsafe(method_family = init)]
54        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
55
56        #[unsafe(method(new))]
57        #[unsafe(method_family = new)]
58        pub unsafe fn new() -> Retained<Self>;
59    );
60}