objc2_app_kit/generated/
NSSpeechRecognizer.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 pub struct NSSpeechRecognizer;
15);
16
17extern_conformance!(
18 unsafe impl NSObjectProtocol for NSSpeechRecognizer {}
19);
20
21impl NSSpeechRecognizer {
22 extern_methods!(
23 #[unsafe(method(init))]
24 #[unsafe(method_family = init)]
25 pub unsafe fn init(this: Allocated<Self>) -> Option<Retained<Self>>;
26
27 #[unsafe(method(startListening))]
28 #[unsafe(method_family = none)]
29 pub unsafe fn startListening(&self);
30
31 #[unsafe(method(stopListening))]
32 #[unsafe(method_family = none)]
33 pub unsafe fn stopListening(&self);
34
35 #[unsafe(method(delegate))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn delegate(
38 &self,
39 mtm: MainThreadMarker,
40 ) -> Option<Retained<ProtocolObject<dyn NSSpeechRecognizerDelegate>>>;
41
42 #[unsafe(method(setDelegate:))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn setDelegate(
47 &self,
48 delegate: Option<&ProtocolObject<dyn NSSpeechRecognizerDelegate>>,
49 );
50
51 #[unsafe(method(commands))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn commands(&self) -> Option<Retained<NSArray<NSString>>>;
54
55 #[unsafe(method(setCommands:))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn setCommands(&self, commands: Option<&NSArray<NSString>>);
59
60 #[unsafe(method(displayedCommandsTitle))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn displayedCommandsTitle(&self) -> Option<Retained<NSString>>;
63
64 #[unsafe(method(setDisplayedCommandsTitle:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn setDisplayedCommandsTitle(&self, displayed_commands_title: Option<&NSString>);
68
69 #[unsafe(method(listensInForegroundOnly))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn listensInForegroundOnly(&self) -> bool;
72
73 #[unsafe(method(setListensInForegroundOnly:))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn setListensInForegroundOnly(&self, listens_in_foreground_only: bool);
77
78 #[unsafe(method(blocksOtherRecognizers))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn blocksOtherRecognizers(&self) -> bool;
81
82 #[unsafe(method(setBlocksOtherRecognizers:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn setBlocksOtherRecognizers(&self, blocks_other_recognizers: bool);
86 );
87}
88
89impl NSSpeechRecognizer {
91 extern_methods!(
92 #[unsafe(method(new))]
93 #[unsafe(method_family = new)]
94 pub unsafe fn new() -> Retained<Self>;
95 );
96}
97
98extern_protocol!(
99 pub unsafe trait NSSpeechRecognizerDelegate: NSObjectProtocol + MainThreadOnly {
101 #[optional]
102 #[unsafe(method(speechRecognizer:didRecognizeCommand:))]
103 #[unsafe(method_family = none)]
104 unsafe fn speechRecognizer_didRecognizeCommand(
105 &self,
106 sender: &NSSpeechRecognizer,
107 command: &NSString,
108 );
109 }
110);