objc2_car_play/generated/
CPMessageComposeBarButton.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#[cfg(feature = "objc2-ui-kit")]
8use objc2_ui_kit::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpmessagecomposebarbutton?language=objc)
14    #[unsafe(super(CPBarButton, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "CPBarButton")]
17    pub struct CPMessageComposeBarButton;
18);
19
20#[cfg(feature = "CPBarButton")]
21extern_conformance!(
22    unsafe impl NSCoding for CPMessageComposeBarButton {}
23);
24
25#[cfg(feature = "CPBarButton")]
26extern_conformance!(
27    unsafe impl NSObjectProtocol for CPMessageComposeBarButton {}
28);
29
30#[cfg(feature = "CPBarButton")]
31extern_conformance!(
32    unsafe impl NSSecureCoding for CPMessageComposeBarButton {}
33);
34
35#[cfg(feature = "CPBarButton")]
36impl CPMessageComposeBarButton {
37    extern_methods!(
38        /// Convenience initializer that creates a message compose button with a system-provided image.
39        ///
40        /// Note: This button type does not use a handler. Instead, tapping this button will activate Siri
41        /// and launch into a compose message flow.
42        #[unsafe(method(init))]
43        #[unsafe(method_family = init)]
44        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
45
46        #[unsafe(method(new))]
47        #[unsafe(method_family = new)]
48        pub unsafe fn new() -> Retained<Self>;
49
50        #[cfg(feature = "objc2-ui-kit")]
51        /// Convenience initializer that creates a message compose button with a custom image.
52        ///
53        ///
54        /// Note: This button type does not use a handler. Instead, tapping this button will activate Siri
55        /// and launch into a compose message flow.
56        #[unsafe(method(initWithImage:))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn initWithImage(this: Allocated<Self>, image: &UIImage) -> Retained<Self>;
59
60        #[unsafe(method(title))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
63
64        /// Setter for [`title`][Self::title].
65        ///
66        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
67        #[unsafe(method(setTitle:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn setTitle(&self, title: Option<&NSString>);
70
71        #[cfg(all(feature = "block2", feature = "objc2-ui-kit"))]
72        /// # Safety
73        ///
74        /// `handler` must be a valid pointer or null.
75        #[unsafe(method(initWithImage:handler:))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn initWithImage_handler(
78            this: Allocated<Self>,
79            image: &UIImage,
80            handler: CPBarButtonHandler,
81        ) -> Retained<Self>;
82
83        #[cfg(feature = "block2")]
84        /// # Safety
85        ///
86        /// `handler` must be a valid pointer or null.
87        #[unsafe(method(initWithTitle:handler:))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn initWithTitle_handler(
90            this: Allocated<Self>,
91            title: &NSString,
92            handler: CPBarButtonHandler,
93        ) -> Retained<Self>;
94    );
95}
96
97/// Methods declared on superclass `CPBarButton`.
98#[cfg(feature = "CPBarButton")]
99impl CPMessageComposeBarButton {
100    extern_methods!(
101        #[cfg(feature = "block2")]
102        /// # Safety
103        ///
104        /// `handler` must be a valid pointer or null.
105        #[deprecated]
106        #[unsafe(method(initWithType:handler:))]
107        #[unsafe(method_family = init)]
108        pub unsafe fn initWithType_handler(
109            this: Allocated<Self>,
110            r#type: CPBarButtonType,
111            handler: CPBarButtonHandler,
112        ) -> Retained<Self>;
113    );
114}