objc2_osa_kit/generated/
OSALanguage.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/osakit/osalanguagefeatures?language=objc)
11// NS_OPTIONS
12#[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    /// [Apple's documentation](https://developer.apple.com/documentation/osakit/osalanguage?language=objc)
46    #[unsafe(super(NSObject))]
47    #[derive(Debug, PartialEq, Eq, Hash)]
48    pub struct OSALanguage;
49);
50
51extern_conformance!(
52    unsafe impl NSObjectProtocol for OSALanguage {}
53);
54
55impl OSALanguage {
56    extern_methods!(
57        #[unsafe(method(availableLanguages))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn availableLanguages() -> Retained<NSArray<OSALanguage>>;
60
61        #[unsafe(method(languageForName:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn languageForName(name: &NSString) -> Option<Retained<OSALanguage>>;
64
65        #[unsafe(method(languageForScriptDataDescriptor:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn languageForScriptDataDescriptor(
68            descriptor: &NSAppleEventDescriptor,
69        ) -> Option<Retained<OSALanguage>>;
70
71        #[unsafe(method(defaultLanguage))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn defaultLanguage() -> Option<Retained<OSALanguage>>;
74
75        #[unsafe(method(setDefaultLanguage:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn setDefaultLanguage(default_language: &OSALanguage);
78
79        #[cfg(feature = "OSALanguageInstance")]
80        #[unsafe(method(sharedLanguageInstance))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn sharedLanguageInstance(&self) -> Retained<OSALanguageInstance>;
83
84        #[unsafe(method(name))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
87
88        #[unsafe(method(info))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn info(&self) -> Option<Retained<NSString>>;
91
92        #[unsafe(method(version))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn version(&self) -> Option<Retained<NSString>>;
95
96        #[unsafe(method(type))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn r#type(&self) -> OSType;
99
100        #[unsafe(method(subType))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn subType(&self) -> OSType;
103
104        #[unsafe(method(manufacturer))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn manufacturer(&self) -> OSType;
107
108        #[unsafe(method(features))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn features(&self) -> OSALanguageFeatures;
111
112        #[unsafe(method(isThreadSafe))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn isThreadSafe(&self) -> bool;
115    );
116}
117
118/// Methods declared on superclass `NSObject`.
119impl OSALanguage {
120    extern_methods!(
121        #[unsafe(method(init))]
122        #[unsafe(method_family = init)]
123        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
124
125        #[unsafe(method(new))]
126        #[unsafe(method_family = new)]
127        pub unsafe fn new() -> Retained<Self>;
128    );
129}