objc2_app_kit/generated/
NSNib.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnibname?language=objc)
10pub type NSNibName = NSString;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnib?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct NSNib;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for NSNib {}
21);
22
23extern_conformance!(
24    unsafe impl NSObjectProtocol for NSNib {}
25);
26
27impl NSNib {
28    extern_methods!(
29        #[unsafe(method(initWithNibNamed:bundle:))]
30        #[unsafe(method_family = init)]
31        pub fn initWithNibNamed_bundle(
32            this: Allocated<Self>,
33            nib_name: &NSNibName,
34            bundle: Option<&NSBundle>,
35        ) -> Option<Retained<Self>>;
36
37        #[unsafe(method(initWithNibData:bundle:))]
38        #[unsafe(method_family = init)]
39        pub fn initWithNibData_bundle(
40            this: Allocated<Self>,
41            nib_data: &NSData,
42            bundle: Option<&NSBundle>,
43        ) -> Retained<Self>;
44    );
45}
46
47/// Methods declared on superclass `NSObject`.
48impl NSNib {
49    extern_methods!(
50        #[unsafe(method(init))]
51        #[unsafe(method_family = init)]
52        pub fn init(this: Allocated<Self>) -> Retained<Self>;
53
54        #[unsafe(method(new))]
55        #[unsafe(method_family = new)]
56        pub fn new() -> Retained<Self>;
57    );
58}
59
60impl DefaultRetained for NSNib {
61    #[inline]
62    fn default_retained() -> Retained<Self> {
63        Self::new()
64    }
65}
66
67/// NSDeprecated.
68impl NSNib {
69    extern_methods!(
70        /// # Safety
71        ///
72        /// `nib_file_url` might not allow `None`.
73        #[deprecated]
74        #[unsafe(method(initWithContentsOfURL:))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn initWithContentsOfURL(
77            this: Allocated<Self>,
78            nib_file_url: Option<&NSURL>,
79        ) -> Option<Retained<Self>>;
80
81        /// # Safety
82        ///
83        /// - `external_name_table` generic should be of the correct type.
84        /// - `external_name_table` might not allow `None`.
85        #[deprecated]
86        #[unsafe(method(instantiateNibWithExternalNameTable:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn instantiateNibWithExternalNameTable(
89            &self,
90            external_name_table: Option<&NSDictionary>,
91        ) -> bool;
92
93        /// # Safety
94        ///
95        /// - `owner` should be of the correct type.
96        /// - `owner` might not allow `None`.
97        /// - `top_level_objects` generic should be of the correct type.
98        /// - `top_level_objects` might not allow `None`.
99        #[deprecated]
100        #[unsafe(method(instantiateNibWithOwner:topLevelObjects:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn instantiateNibWithOwner_topLevelObjects(
103            &self,
104            owner: Option<&AnyObject>,
105            top_level_objects: Option<&mut Option<Retained<NSArray>>>,
106        ) -> bool;
107    );
108}
109
110extern "C" {
111    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnibowner?language=objc)
112    #[deprecated]
113    pub static NSNibOwner: &'static NSString;
114}
115
116extern "C" {
117    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnibtoplevelobjects?language=objc)
118    #[deprecated]
119    pub static NSNibTopLevelObjects: &'static NSString;
120}