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
55unsafe impl<Key: ?Sized, Element: ?Sized> NSFastEnumeration
56    for GCPhysicalInputElementCollection<Key, Element>
57{
58}
59
60unsafe impl<Key: ?Sized, Element: ?Sized> NSObjectProtocol
61    for GCPhysicalInputElementCollection<Key, Element>
62{
63}
64
65impl<Key: Message, Element: Message> GCPhysicalInputElementCollection<Key, Element> {
66    extern_methods!(
67        #[unsafe(method(new))]
68        #[unsafe(method_family = new)]
69        pub unsafe fn new() -> Retained<Self>;
70
71        #[unsafe(method(init))]
72        #[unsafe(method_family = init)]
73        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
74
75        /// The number of elements in the collection.
76        #[unsafe(method(count))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn count(&self) -> NSUInteger;
79
80        /// Returns the element associated with a given alias.
81        ///
82        ///
83        /// Parameter `alias`: The alias for which to return the corresponding element.  Typically, you
84        /// pass one of the constants defined in
85        /// `GCInputNames.h.`
86        /// Returns: The element associated with
87        /// _alias,_or nil if no element is associated
88        /// with
89        /// _alias._
90        #[unsafe(method(elementForAlias:))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn elementForAlias(&self, alias: &Key) -> Option<Retained<Element>>;
93
94        #[unsafe(method(objectForKeyedSubscript:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn objectForKeyedSubscript(&self, key: &Key) -> Option<Retained<Element>>;
97
98        #[unsafe(method(elementEnumerator))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn elementEnumerator(&self) -> Retained<NSEnumerator<Element>>;
101    );
102}