use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub type NSNibName = NSString;
extern_class!(
#[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 fn initWithNibNamed_bundle(
this: Allocated<Self>,
nib_name: &NSNibName,
bundle: Option<&NSBundle>,
) -> Option<Retained<Self>>;
#[unsafe(method(initWithNibData:bundle:))]
#[unsafe(method_family = init)]
pub fn initWithNibData_bundle(
this: Allocated<Self>,
nib_data: &NSData,
bundle: Option<&NSBundle>,
) -> Retained<Self>;
);
}
impl NSNib {
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 NSNib {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
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" {
#[deprecated]
pub static NSNibOwner: &'static NSString;
}
extern "C" {
#[deprecated]
pub static NSNibTopLevelObjects: &'static NSString;
}