objc2_game_controller/generated/
GCButtonElement.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern_protocol!(
9    /// An object conforming to
10    /// `GCButtonElement`represents a momentary switch,
11    /// such as a push button.  A button's input only asserts while the user is
12    /// interacting with it, and then returns to a preferred state (not pressed, not
13    /// touched).
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcbuttonelement?language=objc)
16    #[cfg(feature = "GCPhysicalInputElement")]
17    pub unsafe trait GCButtonElement: GCPhysicalInputElement {
18        #[cfg(all(feature = "GCLinearInput", feature = "GCPressedStateInput"))]
19        /// Get the input containing the pressed state of the button.
20        #[unsafe(method(pressedInput))]
21        #[unsafe(method_family = none)]
22        unsafe fn pressedInput(
23            &self,
24        ) -> Retained<AnyObject /* GCPressedStateInput+ GCLinearInput */>;
25
26        #[cfg(feature = "GCTouchedStateInput")]
27        /// Get the input containing the touched state of the button.
28        ///
29        /// Some buttons feature capacitive touch capabilities where the user can touch the
30        /// button without pressing it.
31        #[unsafe(method(touchedInput))]
32        #[unsafe(method_family = none)]
33        unsafe fn touchedInput(&self) -> Option<Retained<ProtocolObject<dyn GCTouchedStateInput>>>;
34    }
35);