//! 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/appkit/nsnibconnector?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSNibConnector;
);

extern_conformance!(
    unsafe impl NSCoding for NSNibConnector {}
);

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

impl NSNibConnector {
    extern_methods!(
        #[unsafe(method(source))]
        #[unsafe(method_family = none)]
        pub fn source(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`source`][Self::source].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        ///
        /// # Safety
        ///
        /// `source` should be of the correct type.
        #[unsafe(method(setSource:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSource(&self, source: Option<&AnyObject>);

        #[unsafe(method(destination))]
        #[unsafe(method_family = none)]
        pub fn destination(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`destination`][Self::destination].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        ///
        /// # Safety
        ///
        /// `destination` should be of the correct type.
        #[unsafe(method(setDestination:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDestination(&self, destination: Option<&AnyObject>);

        #[unsafe(method(label))]
        #[unsafe(method_family = none)]
        pub fn label(&self) -> Retained<NSString>;

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

        /// # Safety
        ///
        /// - `old_object` should be of the correct type.
        /// - `new_object` should be of the correct type.
        #[unsafe(method(replaceObject:withObject:))]
        #[unsafe(method_family = none)]
        pub unsafe fn replaceObject_withObject(
            &self,
            old_object: &AnyObject,
            new_object: &AnyObject,
        );

        #[unsafe(method(establishConnection))]
        #[unsafe(method_family = none)]
        pub fn establishConnection(&self);
    );
}

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

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

impl DefaultRetained for NSNibConnector {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}
