objc2_intents_ui/generated/
INUIEditVoiceShortcutViewController.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::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10#[cfg(feature = "objc2-intents")]
11use objc2_intents::*;
12
13use crate::*;
14
15extern_class!(
16    /// A view controller that shows the details of a voice shortcut, and lets the user edit the phrase.
17    ///
18    /// To have the user edit a voice shortcut, create an
19    /// `INUIEditVoiceShortcutViewController`object with the
20    /// `INVoiceShortcut`that they wish to edit, and set its delegate. Then, present the view controller modally from another view controller in your app. Your delegate must dismiss the view controller when the user finishes editing.
21    ///
22    /// See also [Apple's documentation](https://developer.apple.com/documentation/intentsui/inuieditvoiceshortcutviewcontroller?language=objc)
23    #[unsafe(super(NSViewController, NSResponder, NSObject))]
24    #[derive(Debug, PartialEq, Eq, Hash)]
25    #[cfg(feature = "objc2-app-kit")]
26    #[cfg(target_os = "macos")]
27    pub struct INUIEditVoiceShortcutViewController;
28);
29
30#[cfg(feature = "objc2-app-kit")]
31#[cfg(target_os = "macos")]
32extern_conformance!(
33    unsafe impl NSCoding for INUIEditVoiceShortcutViewController {}
34);
35
36#[cfg(feature = "objc2-app-kit")]
37#[cfg(target_os = "macos")]
38extern_conformance!(
39    unsafe impl NSEditor for INUIEditVoiceShortcutViewController {}
40);
41
42#[cfg(feature = "objc2-app-kit")]
43#[cfg(target_os = "macos")]
44extern_conformance!(
45    unsafe impl NSObjectProtocol for INUIEditVoiceShortcutViewController {}
46);
47
48#[cfg(feature = "objc2-app-kit")]
49#[cfg(target_os = "macos")]
50extern_conformance!(
51    unsafe impl NSSeguePerforming for INUIEditVoiceShortcutViewController {}
52);
53
54#[cfg(feature = "objc2-app-kit")]
55#[cfg(target_os = "macos")]
56extern_conformance!(
57    unsafe impl NSUserInterfaceItemIdentification for INUIEditVoiceShortcutViewController {}
58);
59
60#[cfg(feature = "objc2-app-kit")]
61#[cfg(target_os = "macos")]
62impl INUIEditVoiceShortcutViewController {
63    extern_methods!(
64        #[unsafe(method(delegate))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn delegate(
67            &self,
68        ) -> Option<Retained<ProtocolObject<dyn INUIEditVoiceShortcutViewControllerDelegate>>>;
69
70        /// This is a [weak property][objc2::topics::weak_property].
71        /// Setter for [`delegate`][Self::delegate].
72        #[unsafe(method(setDelegate:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setDelegate(
75            &self,
76            delegate: Option<&ProtocolObject<dyn INUIEditVoiceShortcutViewControllerDelegate>>,
77        );
78
79        #[cfg(feature = "objc2-intents")]
80        /// Parameter `voiceShortcut`: The voice shortcut to be edited.
81        #[unsafe(method(initWithVoiceShortcut:))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn initWithVoiceShortcut(
84            this: Allocated<Self>,
85            voice_shortcut: &INVoiceShortcut,
86        ) -> Retained<Self>;
87
88        #[unsafe(method(init))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
91
92        #[unsafe(method(initWithNibName:bundle:))]
93        #[unsafe(method_family = init)]
94        pub unsafe fn initWithNibName_bundle(
95            this: Allocated<Self>,
96            nib_name_or_nil: Option<&NSString>,
97            nib_bundle_or_nil: Option<&NSBundle>,
98        ) -> Retained<Self>;
99    );
100}
101
102/// Methods declared on superclass `NSViewController`.
103#[cfg(feature = "objc2-app-kit")]
104#[cfg(target_os = "macos")]
105impl INUIEditVoiceShortcutViewController {
106    extern_methods!(
107        #[unsafe(method(initWithCoder:))]
108        #[unsafe(method_family = init)]
109        pub unsafe fn initWithCoder(
110            this: Allocated<Self>,
111            coder: &NSCoder,
112        ) -> Option<Retained<Self>>;
113    );
114}
115
116/// Methods declared on superclass `NSObject`.
117#[cfg(feature = "objc2-app-kit")]
118#[cfg(target_os = "macos")]
119impl INUIEditVoiceShortcutViewController {
120    extern_methods!(
121        #[unsafe(method(new))]
122        #[unsafe(method_family = new)]
123        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
124    );
125}
126
127extern_protocol!(
128    /// [Apple's documentation](https://developer.apple.com/documentation/intentsui/inuieditvoiceshortcutviewcontrollerdelegate?language=objc)
129    pub unsafe trait INUIEditVoiceShortcutViewControllerDelegate: NSObjectProtocol {
130        #[cfg(all(feature = "objc2-app-kit", feature = "objc2-intents"))]
131        #[cfg(target_os = "macos")]
132        /// Called if the user updates the voice shortcut, with either the successfully-updated voice shortcut, or an error.
133        ///
134        /// Your implementation of this method should dismiss the view controller.
135        #[unsafe(method(editVoiceShortcutViewController:didUpdateVoiceShortcut:error:))]
136        #[unsafe(method_family = none)]
137        unsafe fn editVoiceShortcutViewController_didUpdateVoiceShortcut_error(
138            &self,
139            controller: &INUIEditVoiceShortcutViewController,
140            voice_shortcut: Option<&INVoiceShortcut>,
141            error: Option<&NSError>,
142        );
143
144        #[cfg(feature = "objc2-app-kit")]
145        #[cfg(target_os = "macos")]
146        /// Called if the user deletes the voice shortcut.
147        ///
148        /// Your implementation of this method should dismiss the view controller.
149        #[unsafe(method(editVoiceShortcutViewController:didDeleteVoiceShortcutWithIdentifier:))]
150        #[unsafe(method_family = none)]
151        unsafe fn editVoiceShortcutViewController_didDeleteVoiceShortcutWithIdentifier(
152            &self,
153            controller: &INUIEditVoiceShortcutViewController,
154            deleted_voice_shortcut_identifier: &NSUUID,
155        );
156
157        #[cfg(feature = "objc2-app-kit")]
158        #[cfg(target_os = "macos")]
159        /// Called if the user cancelled; no changes were made to the voice shortcut.
160        ///
161        /// Your implementation of this method should dismiss the view controller.
162        #[unsafe(method(editVoiceShortcutViewControllerDidCancel:))]
163        #[unsafe(method_family = none)]
164        unsafe fn editVoiceShortcutViewControllerDidCancel(
165            &self,
166            controller: &INUIEditVoiceShortcutViewController,
167        );
168    }
169);