objc2-intents 0.3.2

Bindings to the Intents framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Lets you access shortcuts that have been added to Siri
    ///
    /// See also: INVoiceShortcut
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/invoiceshortcutcenter?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct INVoiceShortcutCenter;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for INVoiceShortcutCenter {}
);

impl INVoiceShortcutCenter {
    extern_methods!(
        #[unsafe(method(sharedCenter))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedCenter() -> Retained<INVoiceShortcutCenter>;

        /// Note: Use the
        /// `sharedCenter`singleton.
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        /// Note: Use the
        /// `sharedCenter`singleton.
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(all(feature = "INVoiceShortcut", feature = "block2"))]
        /// Get all of the shortcuts associated with this app that have been added to Siri.
        /// These could have either been added with `INUIAddVoiceShortcutViewController`, or separately by the user in the Shortcuts app.
        #[unsafe(method(getAllVoiceShortcutsWithCompletion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getAllVoiceShortcutsWithCompletion(
            &self,
            completion_handler: &block2::DynBlock<
                dyn Fn(*mut NSArray<INVoiceShortcut>, *mut NSError),
            >,
        );

        #[cfg(all(feature = "INVoiceShortcut", feature = "block2"))]
        /// Get a single shortcut (associated with this app) that has been added to Siri, by its identifier.
        #[unsafe(method(getVoiceShortcutWithIdentifier:completion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getVoiceShortcutWithIdentifier_completion(
            &self,
            identifier: &NSUUID,
            completion_handler: &block2::DynBlock<dyn Fn(*mut INVoiceShortcut, *mut NSError)>,
        );

        #[cfg(feature = "INShortcut")]
        /// Set some shortcuts that should be suggested to the user to add to Siri.
        ///
        /// These suggestions are shown to the user in the Shortcuts app.
        #[unsafe(method(setShortcutSuggestions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShortcutSuggestions(&self, suggestions: &NSArray<INShortcut>);
    );
}