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")]
20unsafe impl GCPhysicalInputElement for GCGearShifterElement {}
21
22unsafe impl NSObjectProtocol for GCGearShifterElement {}
23
24impl GCGearShifterElement {
25    extern_methods!(
26        #[cfg(feature = "GCSwitchPositionInput")]
27        /// Get the input reporting the position of the pattern gear shifter.  If this
28        /// property is
29        /// `nil,`the gear shifter is not a pattern gear shifter.
30        ///
31        /// In the returned input, a position of
32        /// `-1`corresponds to the "reverse gear".
33        /// A position of
34        /// `0`corresponds to the neutral gear.
35        #[unsafe(method(patternInput))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn patternInput(
38            &self,
39        ) -> Option<Retained<ProtocolObject<dyn GCSwitchPositionInput>>>;
40
41        #[cfg(feature = "GCRelativeInput")]
42        /// Get the input reporting changes to the sequential gear shifter.  If this
43        /// property is
44        /// `nil,`the gear shifter is not a sequential gear shifter.
45        #[unsafe(method(sequentialInput))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn sequentialInput(
48            &self,
49        ) -> Option<Retained<ProtocolObject<dyn GCRelativeInput>>>;
50    );
51}
52
53/// Methods declared on superclass `NSObject`.
54impl GCGearShifterElement {
55    extern_methods!(
56        #[unsafe(method(init))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
59
60        #[unsafe(method(new))]
61        #[unsafe(method_family = new)]
62        pub unsafe fn new() -> Retained<Self>;
63    );
64}