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 ///
37 /// # Safety
38 ///
39 /// `handler_queue` possibly has additional threading requirements.
40 #[unsafe(method(setHandlerQueue:))]
41 #[unsafe(method_family = none)]
42 unsafe fn setHandlerQueue(&self, handler_queue: &DispatchQueue);
43
44 /// 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,
45 /// but simply as a way to present some basic information about the device in testing or to the user.
46 #[unsafe(method(vendorName))]
47 #[unsafe(method_family = none)]
48 unsafe fn vendorName(&self) -> Option<Retained<NSString>>;
49
50 /// The product category the device belongs to. This is useful for setting appropriate UI elements based on what type of device is connected.
51 ///
52 ///
53 /// See: GCProductCategories.h
54 #[unsafe(method(productCategory))]
55 #[unsafe(method_family = none)]
56 unsafe fn productCategory(&self) -> Retained<NSString>;
57
58 #[cfg(feature = "GCPhysicalInputProfile")]
59 /// Gets the physical input profile for the device.
60 ///
61 ///
62 /// Note: This is equivalent to the controller's gamepad, microGamepad, or extendedGamepad instance.
63 ///
64 /// See: GCController.microGamepad
65 ///
66 /// See: GCController.extendedGamepad
67 #[deprecated = "Use the physicalInputProfile property on GCController instead. For GCKeyboard, use the keyboardInput property. For GCMouse, use the mouseInput property."]
68 #[unsafe(method(physicalInputProfile))]
69 #[unsafe(method_family = none)]
70 unsafe fn physicalInputProfile(&self) -> Retained<GCPhysicalInputProfile>;
71 }
72);