//! 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/nsportnameserver?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "Use NSXPCConnection instead"]
    pub struct NSPortNameServer;
);

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

impl NSPortNameServer {
    extern_methods!(
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(systemDefaultPortNameServer))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemDefaultPortNameServer() -> Retained<NSPortNameServer>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(portForName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(portForName:host:))]
        #[unsafe(method_family = none)]
        pub unsafe fn portForName_host(
            &self,
            name: &NSString,
            host: Option<&NSString>,
        ) -> Option<Retained<NSPort>>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(registerPort:name:))]
        #[unsafe(method_family = none)]
        pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool;

        #[cfg(feature = "NSString")]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(removePortForName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removePortForName(&self, name: &NSString) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSPortNameServer {
    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>;
    );
}

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

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

impl NSMachBootstrapServer {
    extern_methods!(
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(sharedInstance))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedInstance() -> Retained<AnyObject>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(portForName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(portForName:host:))]
        #[unsafe(method_family = none)]
        pub unsafe fn portForName_host(
            &self,
            name: &NSString,
            host: Option<&NSString>,
        ) -> Option<Retained<NSPort>>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(registerPort:name:))]
        #[unsafe(method_family = none)]
        pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[unsafe(method(servicePortWithName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn servicePortWithName(&self, name: &NSString) -> Option<Retained<NSPort>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSMachBootstrapServer {
    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>;
    );
}

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

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

impl NSMessagePortNameServer {
    extern_methods!(
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(sharedInstance))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedInstance() -> Retained<AnyObject>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(portForName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(portForName:host:))]
        #[unsafe(method_family = none)]
        pub unsafe fn portForName_host(
            &self,
            name: &NSString,
            host: Option<&NSString>,
        ) -> Option<Retained<NSPort>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSMessagePortNameServer {
    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>;
    );
}

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

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

impl NSSocketPortNameServer {
    extern_methods!(
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(sharedInstance))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedInstance() -> Retained<AnyObject>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(portForName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(portForName:host:))]
        #[unsafe(method_family = none)]
        pub unsafe fn portForName_host(
            &self,
            name: &NSString,
            host: Option<&NSString>,
        ) -> Option<Retained<NSPort>>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(registerPort:name:))]
        #[unsafe(method_family = none)]
        pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool;

        #[cfg(feature = "NSString")]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(removePortForName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removePortForName(&self, name: &NSString) -> bool;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(portForName:host:nameServerPortNumber:))]
        #[unsafe(method_family = none)]
        pub unsafe fn portForName_host_nameServerPortNumber(
            &self,
            name: &NSString,
            host: Option<&NSString>,
            port_number: u16,
        ) -> Option<Retained<NSPort>>;

        #[cfg(all(feature = "NSPort", feature = "NSString"))]
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(registerPort:name:nameServerPortNumber:))]
        #[unsafe(method_family = none)]
        pub unsafe fn registerPort_name_nameServerPortNumber(
            &self,
            port: &NSPort,
            name: &NSString,
            port_number: u16,
        ) -> bool;

        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(defaultNameServerPortNumber))]
        #[unsafe(method_family = none)]
        pub unsafe fn defaultNameServerPortNumber(&self) -> u16;

        /// Setter for [`defaultNameServerPortNumber`][Self::defaultNameServerPortNumber].
        #[deprecated = "Use NSXPCConnection instead"]
        #[unsafe(method(setDefaultNameServerPortNumber:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDefaultNameServerPortNumber(&self, default_name_server_port_number: u16);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSSocketPortNameServer {
    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>;
    );
}
