objc2-foundation 0.3.2

Bindings to the Foundation 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 crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdistantobject?language=objc)
    #[unsafe(super(NSProxy))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSProxy")]
    #[deprecated = "Use NSXPCConnection instead"]
    pub struct NSDistantObject;
);

#[cfg(all(feature = "NSObject", feature = "NSProxy"))]
extern_conformance!(
    unsafe impl NSCoding for NSDistantObject {}
);

#[cfg(feature = "NSProxy")]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSDistantObject {}
);

#[cfg(feature = "NSProxy")]
impl NSDistantObject {
    extern_methods!(
        #[cfg(feature = "NSConnection")]
        /// # Safety
        ///
        /// `target` should be of the correct type.
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(proxyWithTarget:connection:))]
        #[unsafe(method_family = none)]
        pub unsafe fn proxyWithTarget_connection(
            target: &AnyObject,
            connection: &NSConnection,
        ) -> Option<Retained<AnyObject>>;

        #[cfg(feature = "NSConnection")]
        /// # Safety
        ///
        /// `target` should be of the correct type.
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(initWithTarget:connection:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTarget_connection(
            this: Allocated<Self>,
            target: &AnyObject,
            connection: &NSConnection,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "NSConnection")]
        /// # Safety
        ///
        /// `target` should be of the correct type.
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(proxyWithLocal:connection:))]
        #[unsafe(method_family = none)]
        pub unsafe fn proxyWithLocal_connection(
            target: &AnyObject,
            connection: &NSConnection,
        ) -> Retained<AnyObject>;

        #[cfg(feature = "NSConnection")]
        /// # Safety
        ///
        /// `target` should be of the correct type.
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(initWithLocal:connection:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLocal_connection(
            this: Allocated<Self>,
            target: &AnyObject,
            connection: &NSConnection,
        ) -> Retained<Self>;

        #[cfg(feature = "NSCoder")]
        /// # Safety
        ///
        /// `in_coder` possibly has further requirements.
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            in_coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        /// # Safety
        ///
        /// `proto` possibly has further requirements.
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(setProtocolForProxy:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setProtocolForProxy(&self, proto: Option<&AnyProtocol>);

        #[cfg(feature = "NSConnection")]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(connectionForProxy))]
        #[unsafe(method_family = none)]
        pub fn connectionForProxy(&self) -> Retained<NSConnection>;
    );
}