objc2_game_controller/generated/
GCGearShifterElement.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_class!(
9    /// A
10    /// `GCGearShifterElement`object represents an attached gear shifter.  Both
11    /// pattern and sequential gear shifters are supported.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcgearshifterelement?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct GCGearShifterElement;
17);
18
19#[cfg(feature = "GCPhysicalInputElement")]
20extern_conformance!(
21    unsafe impl GCPhysicalInputElement for GCGearShifterElement {}
22);
23
24extern_conformance!(
25    unsafe impl NSObjectProtocol for GCGearShifterElement {}
26);
27
28impl GCGearShifterElement {
29    extern_methods!(
30        #[cfg(feature = "GCSwitchPositionInput")]
31        /// Get the input reporting the position of the pattern gear shifter.  If this
32        /// property is
33        /// `nil,`the gear shifter is not a pattern gear shifter.
34        ///
35        /// In the returned input, a position of
36        /// `-1`corresponds to the "reverse gear".
37        /// A position of
38        /// `0`corresponds to the neutral gear.
39        #[unsafe(method(patternInput))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn patternInput(
42            &self,
43        ) -> Option<Retained<ProtocolObject<dyn GCSwitchPositionInput>>>;
44
45        #[cfg(feature = "GCRelativeInput")]
46        /// Get the input reporting changes to the sequential gear shifter.  If this
47        /// property is
48        /// `nil,`the gear shifter is not a sequential gear shifter.
49        #[unsafe(method(sequentialInput))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn sequentialInput(
52            &self,
53        ) -> Option<Retained<ProtocolObject<dyn GCRelativeInput>>>;
54    );
55}
56
57/// Methods declared on superclass `NSObject`.
58impl GCGearShifterElement {
59    extern_methods!(
60        #[unsafe(method(init))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
63
64        #[unsafe(method(new))]
65        #[unsafe(method_family = new)]
66        pub unsafe fn new() -> Retained<Self>;
67    );
68}