objc2_intents/generated/
INVoiceShortcutCenter.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    /// Lets you access shortcuts that have been added to Siri
12    ///
13    /// See also: INVoiceShortcut
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/invoiceshortcutcenter?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct INVoiceShortcutCenter;
19);
20
21extern_conformance!(
22    unsafe impl NSObjectProtocol for INVoiceShortcutCenter {}
23);
24
25impl INVoiceShortcutCenter {
26    extern_methods!(
27        #[unsafe(method(sharedCenter))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn sharedCenter() -> Retained<INVoiceShortcutCenter>;
30
31        /// Note: Use the
32        /// `sharedCenter`singleton.
33        #[unsafe(method(new))]
34        #[unsafe(method_family = new)]
35        pub unsafe fn new() -> Retained<Self>;
36
37        /// Note: Use the
38        /// `sharedCenter`singleton.
39        #[unsafe(method(init))]
40        #[unsafe(method_family = init)]
41        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
42
43        #[cfg(all(feature = "INVoiceShortcut", feature = "block2"))]
44        /// Get all of the shortcuts associated with this app that have been added to Siri.
45        /// These could have either been added with `INUIAddVoiceShortcutViewController`, or separately by the user in the Shortcuts app.
46        #[unsafe(method(getAllVoiceShortcutsWithCompletion:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn getAllVoiceShortcutsWithCompletion(
49            &self,
50            completion_handler: &block2::DynBlock<
51                dyn Fn(*mut NSArray<INVoiceShortcut>, *mut NSError),
52            >,
53        );
54
55        #[cfg(all(feature = "INVoiceShortcut", feature = "block2"))]
56        /// Get a single shortcut (associated with this app) that has been added to Siri, by its identifier.
57        #[unsafe(method(getVoiceShortcutWithIdentifier:completion:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn getVoiceShortcutWithIdentifier_completion(
60            &self,
61            identifier: &NSUUID,
62            completion_handler: &block2::DynBlock<dyn Fn(*mut INVoiceShortcut, *mut NSError)>,
63        );
64
65        #[cfg(feature = "INShortcut")]
66        /// Set some shortcuts that should be suggested to the user to add to Siri.
67        ///
68        /// These suggestions are shown to the user in the Shortcuts app.
69        #[unsafe(method(setShortcutSuggestions:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn setShortcutSuggestions(&self, suggestions: &NSArray<INShortcut>);
72    );
73}