objc2_game_controller/generated/
GCDevice.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "dispatch2")]
6use dispatch2::*;
7use objc2::__framework_prelude::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_protocol!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcdevice?language=objc)
14    pub unsafe trait GCDevice: NSObjectProtocol {
15        #[cfg(feature = "dispatch2")]
16        /// The dispatch queue that element value change handlers are submitted on. The default queue is main, and setting this to any
17        /// other queue will make value change handlers dispatch async on the given queue. This is useful if the main game loop
18        /// of the application is not on main, or if input logic is handled on another thread from the main game loop.
19        ///
20        ///
21        /// See: GCControllerAxisInput.valueChangedHandler
22        ///
23        /// See: GCControllerButtonInput.valueChangedHandler
24        ///
25        /// See: GCControllerButtonInput.pressedChangedHandler
26        ///
27        /// See: GCControllerDirectionPad.valueChangedHandler
28        ///
29        /// See: GCMotion.valueChangedHandler
30        #[unsafe(method(handlerQueue))]
31        #[unsafe(method_family = none)]
32        unsafe fn handlerQueue(&self) -> Retained<DispatchQueue>;
33
34        #[cfg(feature = "dispatch2")]
35        /// Setter for [`handlerQueue`][Self::handlerQueue].
36        #[unsafe(method(setHandlerQueue:))]
37        #[unsafe(method_family = none)]
38        unsafe fn setHandlerQueue(&self, handler_queue: &DispatchQueue);
39
40        /// A vendor supplied name. May be nil, and is not guaranteed to be unique. This should not be used as a key in a dictionary,
41        /// but simply as a way to present some basic information about the device in testing or to the user.
42        #[unsafe(method(vendorName))]
43        #[unsafe(method_family = none)]
44        unsafe fn vendorName(&self) -> Option<Retained<NSString>>;
45
46        /// The product category the device belongs to. This is useful for setting appropriate UI elements based on what type of device is connected.
47        ///
48        ///
49        /// See: GCProductCategories.h
50        #[unsafe(method(productCategory))]
51        #[unsafe(method_family = none)]
52        unsafe fn productCategory(&self) -> Retained<NSString>;
53
54        #[cfg(feature = "GCPhysicalInputProfile")]
55        /// Gets the physical input profile for the device.
56        ///
57        ///
58        /// Note: This is equivalent to the controller's gamepad, microGamepad, or extendedGamepad instance.
59        ///
60        /// See: GCController.microGamepad
61        ///
62        /// See: GCController.extendedGamepad
63        #[deprecated = "Use the physicalInputProfile property on GCController instead.  For GCKeyboard, use the keyboardInput property.  For GCMouse, use the mouseInput property."]
64        #[unsafe(method(physicalInputProfile))]
65        #[unsafe(method_family = none)]
66        unsafe fn physicalInputProfile(&self) -> Retained<GCPhysicalInputProfile>;
67    }
68);