objc2_osa_kit/generated/
OSALanguageInstance.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
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/osakit/osalanguageinstance?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct OSALanguageInstance;
15);
16
17unsafe impl NSObjectProtocol for OSALanguageInstance {}
18
19impl OSALanguageInstance {
20    extern_methods!(
21        #[cfg(feature = "OSALanguage")]
22        #[unsafe(method(languageInstanceWithLanguage:))]
23        #[unsafe(method_family = none)]
24        pub unsafe fn languageInstanceWithLanguage(language: &OSALanguage) -> Retained<Self>;
25
26        #[cfg(feature = "OSALanguage")]
27        #[unsafe(method(initWithLanguage:))]
28        #[unsafe(method_family = init)]
29        pub unsafe fn initWithLanguage(
30            this: Allocated<Self>,
31            language: &OSALanguage,
32        ) -> Retained<Self>;
33
34        #[cfg(feature = "OSALanguage")]
35        #[unsafe(method(language))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn language(&self) -> Retained<OSALanguage>;
38
39        #[unsafe(method(defaultTarget))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn defaultTarget(&self) -> Option<Retained<NSAppleEventDescriptor>>;
42
43        /// Setter for [`defaultTarget`][Self::defaultTarget].
44        #[unsafe(method(setDefaultTarget:))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn setDefaultTarget(&self, default_target: Option<&NSAppleEventDescriptor>);
47
48        #[unsafe(method(richTextFromDescriptor:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn richTextFromDescriptor(
51            &self,
52            descriptor: &NSAppleEventDescriptor,
53        ) -> Option<Retained<NSAttributedString>>;
54    );
55}
56
57/// Methods declared on superclass `NSObject`.
58impl OSALanguageInstance {
59    extern_methods!(
60        #[unsafe(method(init))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
63
64        #[unsafe(method(new))]
65        #[unsafe(method_family = new)]
66        pub unsafe fn new() -> Retained<Self>;
67    );
68}