objc2_game_controller/generated/
GCPhysicalInputElement.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_protocol!(
10    /// The
11    /// `GCPhysicalInputElement`protocol is a base protocol for specific types
12    /// of elements that represent controls on a device.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcphysicalinputelement?language=objc)
15    pub unsafe trait GCPhysicalInputElement: NSObjectProtocol {
16        /// The set of aliases that can be used to access this element with keyed subscript
17        /// notation.
18        #[unsafe(method(aliases))]
19        #[unsafe(method_family = none)]
20        unsafe fn aliases(&self) -> Retained<NSSet<NSString>>;
21
22        /// The element's localized display name.
23        ///
24        /// This is the string that your app should display in any on-screen messages
25        /// instructing the user to interact with the control.  For example:
26        ///
27        /// "Press \(buttonA.localizedName) to jump!"
28        ///
29        /// Do not cache this value - it can change when the user remaps controls.
30        #[unsafe(method(localizedName))]
31        #[unsafe(method_family = none)]
32        unsafe fn localizedName(&self) -> Option<Retained<NSString>>;
33
34        /// The SF Symbols name for the element.
35        #[unsafe(method(sfSymbolsName))]
36        #[unsafe(method_family = none)]
37        unsafe fn sfSymbolsName(&self) -> Option<Retained<NSString>>;
38    }
39);
40
41extern_class!(
42    /// An instance of
43    /// `GCPhysicalInputElementCollection`contains the collection of
44    /// input elements found in a device's physical input profile.
45    ///
46    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcphysicalinputelementcollection?language=objc)
47    #[unsafe(super(NSObject))]
48    #[derive(Debug, PartialEq, Eq, Hash)]
49    pub struct GCPhysicalInputElementCollection<
50        Key: ?Sized = AnyObject,
51        Element: ?Sized = AnyObject,
52    >;
53);
54
55extern_conformance!(
56    unsafe impl<Key: ?Sized, Element: ?Sized> NSFastEnumeration
57        for GCPhysicalInputElementCollection<Key, Element>
58    {
59    }
60);
61
62extern_conformance!(
63    unsafe impl<Key: ?Sized, Element: ?Sized> NSObjectProtocol
64        for GCPhysicalInputElementCollection<Key, Element>
65    {
66    }
67);
68
69impl<Key: Message, Element: Message> GCPhysicalInputElementCollection<Key, Element> {
70    extern_methods!(
71        #[unsafe(method(new))]
72        #[unsafe(method_family = new)]
73        pub unsafe fn new() -> Retained<Self>;
74
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        /// The number of elements in the collection.
80        #[unsafe(method(count))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn count(&self) -> NSUInteger;
83
84        /// Returns the element associated with a given alias.
85        ///
86        ///
87        /// Parameter `alias`: The alias for which to return the corresponding element.  Typically, you
88        /// pass one of the constants defined in
89        /// `GCInputNames.h.`
90        /// Returns: The element associated with
91        /// _alias,_or nil if no element is associated
92        /// with
93        /// _alias._
94        #[unsafe(method(elementForAlias:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn elementForAlias(&self, alias: &Key) -> Option<Retained<Element>>;
97
98        #[unsafe(method(objectForKeyedSubscript:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn objectForKeyedSubscript(&self, key: &Key) -> Option<Retained<Element>>;
101
102        #[unsafe(method(elementEnumerator))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn elementEnumerator(&self) -> Retained<NSEnumerator<Element>>;
105    );
106}