objc2-call-kit 0.3.2

Bindings to the CallKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxcallupdate?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CXCallUpdate;
);

extern_conformance!(
    unsafe impl NSCopying for CXCallUpdate {}
);

unsafe impl CopyingHelper for CXCallUpdate {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CXCallUpdate {}
);

impl CXCallUpdate {
    extern_methods!(
        #[cfg(feature = "CXHandle")]
        /// Handle for the remote party (for an incoming call, the caller; for an outgoing call, the callee).
        #[unsafe(method(remoteHandle))]
        #[unsafe(method_family = none)]
        pub unsafe fn remoteHandle(&self) -> Option<Retained<CXHandle>>;

        #[cfg(feature = "CXHandle")]
        /// Setter for [`remoteHandle`][Self::remoteHandle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setRemoteHandle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRemoteHandle(&self, remote_handle: Option<&CXHandle>);

        /// Override the computed caller name to a provider-defined value.
        /// Normally the system will determine the appropriate caller name to display (e.g. using the user's contacts) based on the supplied caller identifier. Set this property to customize.
        #[unsafe(method(localizedCallerName))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedCallerName(&self) -> Option<Retained<NSString>>;

        /// Setter for [`localizedCallerName`][Self::localizedCallerName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLocalizedCallerName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLocalizedCallerName(&self, localized_caller_name: Option<&NSString>);

        /// Whether the call can be held on its own or swapped with another call
        #[unsafe(method(supportsHolding))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsHolding(&self) -> bool;

        /// Setter for [`supportsHolding`][Self::supportsHolding].
        #[unsafe(method(setSupportsHolding:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSupportsHolding(&self, supports_holding: bool);

        /// Whether the call can be grouped (merged) with other calls when it is ungrouped
        #[unsafe(method(supportsGrouping))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsGrouping(&self) -> bool;

        /// Setter for [`supportsGrouping`][Self::supportsGrouping].
        #[unsafe(method(setSupportsGrouping:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSupportsGrouping(&self, supports_grouping: bool);

        /// The call can be ungrouped (taken private) when it is grouped
        #[unsafe(method(supportsUngrouping))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsUngrouping(&self) -> bool;

        /// Setter for [`supportsUngrouping`][Self::supportsUngrouping].
        #[unsafe(method(setSupportsUngrouping:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSupportsUngrouping(&self, supports_ungrouping: bool);

        /// The call can send DTMF tones via hard pause digits or in-call keypad entries
        #[unsafe(method(supportsDTMF))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsDTMF(&self) -> bool;

        /// Setter for [`supportsDTMF`][Self::supportsDTMF].
        #[unsafe(method(setSupportsDTMF:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSupportsDTMF(&self, supports_dtmf: bool);

        /// The call includes video in addition to audio.
        #[unsafe(method(hasVideo))]
        #[unsafe(method_family = none)]
        pub unsafe fn hasVideo(&self) -> bool;

        /// Setter for [`hasVideo`][Self::hasVideo].
        #[unsafe(method(setHasVideo:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHasVideo(&self, has_video: bool);
    );
}

/// Methods declared on superclass `NSObject`.
impl CXCallUpdate {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}