objc2_intents/generated/
INDefaultCardTemplate.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    /// A template for customizing the display of relevant shortcuts.
12    ///
13    /// See also: INRelevantShortcut
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/indefaultcardtemplate?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct INDefaultCardTemplate;
19);
20
21extern_conformance!(
22    unsafe impl NSCoding for INDefaultCardTemplate {}
23);
24
25extern_conformance!(
26    unsafe impl NSCopying for INDefaultCardTemplate {}
27);
28
29unsafe impl CopyingHelper for INDefaultCardTemplate {
30    type Result = Self;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for INDefaultCardTemplate {}
35);
36
37extern_conformance!(
38    unsafe impl NSSecureCoding for INDefaultCardTemplate {}
39);
40
41impl INDefaultCardTemplate {
42    extern_methods!(
43        /// The title used when displaying the relevant shortcut.
44        #[unsafe(method(title))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn title(&self) -> Retained<NSString>;
47
48        /// Setter for [`title`][Self::title].
49        ///
50        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
51        #[unsafe(method(setTitle:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn setTitle(&self, title: &NSString);
54
55        /// The subtitle used when displaying the relevant shortcut.
56        #[unsafe(method(subtitle))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
59
60        /// Setter for [`subtitle`][Self::subtitle].
61        ///
62        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
63        #[unsafe(method(setSubtitle:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
66
67        #[cfg(feature = "INImage")]
68        /// The image used when displaying the relevant shortcut.
69        #[unsafe(method(image))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn image(&self) -> Option<Retained<INImage>>;
72
73        #[cfg(feature = "INImage")]
74        /// Setter for [`image`][Self::image].
75        ///
76        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
77        #[unsafe(method(setImage:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn setImage(&self, image: Option<&INImage>);
80
81        /// Initializes a default card template with the provided title.
82        #[unsafe(method(initWithTitle:))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn initWithTitle(this: Allocated<Self>, title: &NSString) -> Retained<Self>;
85
86        /// Note: Must be initilaized with a title, using those initializers.
87        #[unsafe(method(init))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
90    );
91}
92
93/// Methods declared on superclass `NSObject`.
94impl INDefaultCardTemplate {
95    extern_methods!(
96        #[unsafe(method(new))]
97        #[unsafe(method_family = new)]
98        pub unsafe fn new() -> Retained<Self>;
99    );
100}