objc2_call_kit/generated/
CXCallObserver.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_protocol!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxcallobserverdelegate?language=objc)
14    pub unsafe trait CXCallObserverDelegate: NSObjectProtocol {
15        #[cfg(feature = "CXCall")]
16        #[unsafe(method(callObserver:callChanged:))]
17        #[unsafe(method_family = none)]
18        unsafe fn callObserver_callChanged(&self, call_observer: &CXCallObserver, call: &CXCall);
19    }
20);
21
22extern_class!(
23    /// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxcallobserver?language=objc)
24    #[unsafe(super(NSObject))]
25    #[derive(Debug, PartialEq, Eq, Hash)]
26    pub struct CXCallObserver;
27);
28
29extern_conformance!(
30    unsafe impl NSObjectProtocol for CXCallObserver {}
31);
32
33impl CXCallObserver {
34    extern_methods!(
35        #[cfg(feature = "CXCall")]
36        /// Retrieve the current call list, blocking on initial state retrieval if necessary
37        #[unsafe(method(calls))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn calls(&self) -> Retained<NSArray<CXCall>>;
40
41        #[cfg(feature = "dispatch2")]
42        /// Set delegate and optional queue for delegate callbacks to be performed on.
43        /// A nil queue implies that delegate callbacks should happen on the main queue. The delegate is stored weakly
44        ///
45        /// # Safety
46        ///
47        /// `queue` possibly has additional threading requirements.
48        #[unsafe(method(setDelegate:queue:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn setDelegate_queue(
51            &self,
52            delegate: Option<&ProtocolObject<dyn CXCallObserverDelegate>>,
53            queue: Option<&DispatchQueue>,
54        );
55    );
56}
57
58/// Methods declared on superclass `NSObject`.
59impl CXCallObserver {
60    extern_methods!(
61        #[unsafe(method(init))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
64
65        #[unsafe(method(new))]
66        #[unsafe(method_family = new)]
67        pub unsafe fn new() -> Retained<Self>;
68    );
69}