objc2_osa_kit/generated/
OSALanguage.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct OSALanguageFeatures(pub NSUInteger);
15bitflags::bitflags! {
16 impl OSALanguageFeatures: NSUInteger {
17 #[doc(alias = "OSASupportsCompiling")]
18 const SupportsCompiling = 0x0002;
19 #[doc(alias = "OSASupportsGetSource")]
20 const SupportsGetSource = 0x0004;
21 #[doc(alias = "OSASupportsAECoercion")]
22 const SupportsAECoercion = 0x0008;
23 #[doc(alias = "OSASupportsAESending")]
24 const SupportsAESending = 0x0010;
25 #[doc(alias = "OSASupportsRecording")]
26 const SupportsRecording = 0x0020;
27 #[doc(alias = "OSASupportsConvenience")]
28 const SupportsConvenience = 0x0040;
29 #[doc(alias = "OSASupportsDialects")]
30 const SupportsDialects = 0x0080;
31 #[doc(alias = "OSASupportsEventHandling")]
32 const SupportsEventHandling = 0x0100;
33 }
34}
35
36unsafe impl Encode for OSALanguageFeatures {
37 const ENCODING: Encoding = NSUInteger::ENCODING;
38}
39
40unsafe impl RefEncode for OSALanguageFeatures {
41 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
42}
43
44extern_class!(
45 #[unsafe(super(NSObject))]
47 #[derive(Debug, PartialEq, Eq, Hash)]
48 pub struct OSALanguage;
49);
50
51unsafe impl NSObjectProtocol for OSALanguage {}
52
53impl OSALanguage {
54 extern_methods!(
55 #[unsafe(method(availableLanguages))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn availableLanguages() -> Retained<NSArray<OSALanguage>>;
58
59 #[unsafe(method(languageForName:))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn languageForName(name: &NSString) -> Option<Retained<OSALanguage>>;
62
63 #[unsafe(method(languageForScriptDataDescriptor:))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn languageForScriptDataDescriptor(
66 descriptor: &NSAppleEventDescriptor,
67 ) -> Option<Retained<OSALanguage>>;
68
69 #[unsafe(method(defaultLanguage))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn defaultLanguage() -> Option<Retained<OSALanguage>>;
72
73 #[unsafe(method(setDefaultLanguage:))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn setDefaultLanguage(default_language: &OSALanguage);
76
77 #[cfg(feature = "OSALanguageInstance")]
78 #[unsafe(method(sharedLanguageInstance))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn sharedLanguageInstance(&self) -> Retained<OSALanguageInstance>;
81
82 #[unsafe(method(name))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn name(&self) -> Option<Retained<NSString>>;
85
86 #[unsafe(method(info))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn info(&self) -> Option<Retained<NSString>>;
89
90 #[unsafe(method(version))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn version(&self) -> Option<Retained<NSString>>;
93
94 #[unsafe(method(type))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn r#type(&self) -> OSType;
97
98 #[unsafe(method(subType))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn subType(&self) -> OSType;
101
102 #[unsafe(method(manufacturer))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn manufacturer(&self) -> OSType;
105
106 #[unsafe(method(features))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn features(&self) -> OSALanguageFeatures;
109
110 #[unsafe(method(isThreadSafe))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn isThreadSafe(&self) -> bool;
113 );
114}
115
116impl OSALanguage {
118 extern_methods!(
119 #[unsafe(method(init))]
120 #[unsafe(method_family = init)]
121 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
122
123 #[unsafe(method(new))]
124 #[unsafe(method_family = new)]
125 pub unsafe fn new() -> Retained<Self>;
126 );
127}