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

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnibname?language=objc)
pub type NSNibName = NSString;

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

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

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

impl NSNib {
    extern_methods!(
        #[unsafe(method(initWithNibNamed:bundle:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNibNamed_bundle(
            this: Allocated<Self>,
            nib_name: &NSNibName,
            bundle: Option<&NSBundle>,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(initWithNibData:bundle:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNibData_bundle(
            this: Allocated<Self>,
            nib_data: &NSData,
            bundle: Option<&NSBundle>,
        ) -> Retained<Self>;
    );
}

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

/// NSDeprecated.
impl NSNib {
    extern_methods!(
        #[deprecated]
        #[unsafe(method(initWithContentsOfURL:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithContentsOfURL(
            this: Allocated<Self>,
            nib_file_url: Option<&NSURL>,
        ) -> Option<Retained<Self>>;

        #[deprecated]
        #[unsafe(method(instantiateNibWithExternalNameTable:))]
        #[unsafe(method_family = none)]
        pub unsafe fn instantiateNibWithExternalNameTable(
            &self,
            external_name_table: Option<&NSDictionary>,
        ) -> bool;

        #[deprecated]
        #[unsafe(method(instantiateNibWithOwner:topLevelObjects:))]
        #[unsafe(method_family = none)]
        pub unsafe fn instantiateNibWithOwner_topLevelObjects(
            &self,
            owner: Option<&AnyObject>,
            top_level_objects: Option<&mut Option<Retained<NSArray>>>,
        ) -> bool;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnibowner?language=objc)
    pub static NSNibOwner: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnibtoplevelobjects?language=objc)
    pub static NSNibTopLevelObjects: &'static NSString;
}
