objc2_foundation/generated/
NSScriptClassDescription.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::*;
5
6use crate::*;
7
8extern_class!(
9    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsscriptclassdescription?language=objc)
10    #[unsafe(super(NSClassDescription, NSObject))]
11    #[derive(Debug, PartialEq, Eq, Hash)]
12    #[cfg(feature = "NSClassDescription")]
13    pub struct NSScriptClassDescription;
14);
15
16#[cfg(feature = "NSClassDescription")]
17extern_conformance!(
18    unsafe impl NSObjectProtocol for NSScriptClassDescription {}
19);
20
21#[cfg(feature = "NSClassDescription")]
22impl NSScriptClassDescription {
23    extern_methods!(
24        /// # Safety
25        ///
26        /// `a_class` probably has further requirements.
27        #[unsafe(method(classDescriptionForClass:))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn classDescriptionForClass(
30            a_class: &AnyClass,
31        ) -> Option<Retained<NSScriptClassDescription>>;
32
33        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
34        /// # Safety
35        ///
36        /// `class_declaration` generic should be of the correct type.
37        #[unsafe(method(initWithSuiteName:className:dictionary:))]
38        #[unsafe(method_family = init)]
39        pub unsafe fn initWithSuiteName_className_dictionary(
40            this: Allocated<Self>,
41            suite_name: &NSString,
42            class_name: &NSString,
43            class_declaration: Option<&NSDictionary>,
44        ) -> Option<Retained<Self>>;
45
46        #[cfg(feature = "NSString")]
47        #[unsafe(method(suiteName))]
48        #[unsafe(method_family = none)]
49        pub fn suiteName(&self) -> Option<Retained<NSString>>;
50
51        #[cfg(feature = "NSString")]
52        #[unsafe(method(className))]
53        #[unsafe(method_family = none)]
54        pub fn className(&self) -> Option<Retained<NSString>>;
55
56        #[cfg(feature = "NSString")]
57        #[unsafe(method(implementationClassName))]
58        #[unsafe(method_family = none)]
59        pub fn implementationClassName(&self) -> Option<Retained<NSString>>;
60
61        #[unsafe(method(superclassDescription))]
62        #[unsafe(method_family = none)]
63        pub fn superclassDescription(&self) -> Option<Retained<NSScriptClassDescription>>;
64
65        #[unsafe(method(appleEventCode))]
66        #[unsafe(method_family = none)]
67        pub fn appleEventCode(&self) -> FourCharCode;
68
69        #[unsafe(method(matchesAppleEventCode:))]
70        #[unsafe(method_family = none)]
71        pub fn matchesAppleEventCode(&self, apple_event_code: FourCharCode) -> bool;
72
73        #[cfg(feature = "NSScriptCommandDescription")]
74        #[unsafe(method(supportsCommand:))]
75        #[unsafe(method_family = none)]
76        pub fn supportsCommand(&self, command_description: &NSScriptCommandDescription) -> bool;
77
78        #[cfg(feature = "NSScriptCommandDescription")]
79        #[unsafe(method(selectorForCommand:))]
80        #[unsafe(method_family = none)]
81        pub fn selectorForCommand(
82            &self,
83            command_description: &NSScriptCommandDescription,
84        ) -> Option<Sel>;
85
86        #[cfg(feature = "NSString")]
87        #[unsafe(method(typeForKey:))]
88        #[unsafe(method_family = none)]
89        pub fn typeForKey(&self, key: &NSString) -> Option<Retained<NSString>>;
90
91        #[cfg(feature = "NSString")]
92        #[unsafe(method(classDescriptionForKey:))]
93        #[unsafe(method_family = none)]
94        pub fn classDescriptionForKey(
95            &self,
96            key: &NSString,
97        ) -> Option<Retained<NSScriptClassDescription>>;
98
99        #[cfg(feature = "NSString")]
100        #[unsafe(method(appleEventCodeForKey:))]
101        #[unsafe(method_family = none)]
102        pub fn appleEventCodeForKey(&self, key: &NSString) -> FourCharCode;
103
104        #[cfg(feature = "NSString")]
105        #[unsafe(method(keyWithAppleEventCode:))]
106        #[unsafe(method_family = none)]
107        pub fn keyWithAppleEventCode(
108            &self,
109            apple_event_code: FourCharCode,
110        ) -> Option<Retained<NSString>>;
111
112        #[cfg(feature = "NSString")]
113        #[unsafe(method(defaultSubcontainerAttributeKey))]
114        #[unsafe(method_family = none)]
115        pub fn defaultSubcontainerAttributeKey(&self) -> Option<Retained<NSString>>;
116
117        #[cfg(feature = "NSString")]
118        #[unsafe(method(isLocationRequiredToCreateForKey:))]
119        #[unsafe(method_family = none)]
120        pub fn isLocationRequiredToCreateForKey(&self, to_many_relationship_key: &NSString)
121            -> bool;
122
123        #[cfg(feature = "NSString")]
124        #[unsafe(method(hasPropertyForKey:))]
125        #[unsafe(method_family = none)]
126        pub fn hasPropertyForKey(&self, key: &NSString) -> bool;
127
128        #[cfg(feature = "NSString")]
129        #[unsafe(method(hasOrderedToManyRelationshipForKey:))]
130        #[unsafe(method_family = none)]
131        pub fn hasOrderedToManyRelationshipForKey(&self, key: &NSString) -> bool;
132
133        #[cfg(feature = "NSString")]
134        #[unsafe(method(hasReadablePropertyForKey:))]
135        #[unsafe(method_family = none)]
136        pub fn hasReadablePropertyForKey(&self, key: &NSString) -> bool;
137
138        #[cfg(feature = "NSString")]
139        #[unsafe(method(hasWritablePropertyForKey:))]
140        #[unsafe(method_family = none)]
141        pub fn hasWritablePropertyForKey(&self, key: &NSString) -> bool;
142    );
143}
144
145/// Methods declared on superclass `NSObject`.
146#[cfg(feature = "NSClassDescription")]
147impl NSScriptClassDescription {
148    extern_methods!(
149        #[unsafe(method(init))]
150        #[unsafe(method_family = init)]
151        pub fn init(this: Allocated<Self>) -> Retained<Self>;
152
153        #[unsafe(method(new))]
154        #[unsafe(method_family = new)]
155        pub fn new() -> Retained<Self>;
156    );
157}
158
159#[cfg(feature = "NSClassDescription")]
160impl DefaultRetained for NSScriptClassDescription {
161    #[inline]
162    fn default_retained() -> Retained<Self> {
163        Self::new()
164    }
165}
166
167/// NSDeprecated.
168#[cfg(feature = "NSClassDescription")]
169impl NSScriptClassDescription {
170    extern_methods!(
171        #[cfg(feature = "NSString")]
172        #[deprecated]
173        #[unsafe(method(isReadOnlyKey:))]
174        #[unsafe(method_family = none)]
175        pub fn isReadOnlyKey(&self, key: &NSString) -> bool;
176    );
177}
178
179mod private_NSObjectNSScriptClassDescription {
180    pub trait Sealed {}
181}
182
183/// Category "NSScriptClassDescription" on [`NSObject`].
184#[doc(alias = "NSScriptClassDescription")]
185pub unsafe trait NSObjectNSScriptClassDescription:
186    ClassType + Sized + private_NSObjectNSScriptClassDescription::Sealed
187{
188    extern_methods!(
189        #[unsafe(method(classCode))]
190        #[unsafe(method_family = none)]
191        fn classCode(&self) -> FourCharCode;
192
193        #[cfg(feature = "NSString")]
194        #[unsafe(method(className))]
195        #[unsafe(method_family = none)]
196        fn className(&self) -> Retained<NSString>;
197    );
198}
199
200impl private_NSObjectNSScriptClassDescription::Sealed for NSObject {}
201unsafe impl NSObjectNSScriptClassDescription for NSObject {}