objc2_io_bluetooth/generated/objc2/
IOBluetoothHandsFreeAudioGateway.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-foundation")]
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// APIs for managing a hands free audio gateway
13    ///
14    /// (c) 2010 by Apple Inc. All rights reserved.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeaudiogateway?language=objc)
17    #[unsafe(super(IOBluetoothHandsFree, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "IOBluetoothHandsFree")]
20    pub struct IOBluetoothHandsFreeAudioGateway;
21);
22
23#[cfg(feature = "IOBluetoothHandsFree")]
24extern_conformance!(
25    unsafe impl NSObjectProtocol for IOBluetoothHandsFreeAudioGateway {}
26);
27
28#[cfg(feature = "IOBluetoothHandsFree")]
29impl IOBluetoothHandsFreeAudioGateway {
30    extern_methods!(
31        #[cfg(all(feature = "IOBluetoothDevice", feature = "IOBluetoothObject"))]
32        /// Create a new IOBluetoothHandsFreeAudioGateway to act as a hands free gateway
33        ///
34        /// This will register a listener for incoming connections.
35        ///
36        /// Parameter `device`: An IOBluetoothDevice
37        ///
38        /// Parameter `inDelegate`: An object to act as delegate
39        ///
40        /// Returns: A newly created IOBluetoothHandsFreeAudioGateway object on success, nil on failure
41        #[unsafe(method(initWithDevice:delegate:))]
42        #[unsafe(method_family = init)]
43        pub unsafe fn initWithDevice_delegate(
44            this: Allocated<Self>,
45            device: Option<&IOBluetoothDevice>,
46            in_delegate: Option<&AnyObject>,
47        ) -> Option<Retained<Self>>;
48
49        #[cfg(feature = "objc2-foundation")]
50        /// Create an indicator
51        ///
52        /// Creates an indicator with min and max values and sets the current value. The current value must be valid.
53        ///
54        /// Parameter `indicatorName`: See  �Hands free indicator constants," for standard indicator names.
55        ///
56        /// Parameter `minValue`: Minimum value allowed for the indicator
57        ///
58        /// Parameter `maxValue`: Maximum value allowed for the indicator
59        ///
60        /// Parameter `currentValue`: The current indicator value. Must be within the min and max values passed in or the indicator will not be created.
61        #[unsafe(method(createIndicator:min:max:currentValue:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn createIndicator_min_max_currentValue(
64            &self,
65            indicator_name: Option<&NSString>,
66            min_value: c_int,
67            max_value: c_int,
68            current_value: c_int,
69        );
70
71        #[cfg(feature = "objc2-foundation")]
72        /// Handles AT commands sent from the hands free device
73        ///
74        /// Implement this in a subclass if you wish to respond to additional AT commands or to change the default response.
75        ///
76        /// Parameter `atCommand`: The at command from the hands free device
77        #[unsafe(method(processATCommand:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn processATCommand(&self, at_command: Option<&NSString>);
80
81        /// Sends an OK response
82        ///
83        /// Use this to respond OK.
84        #[unsafe(method(sendOKResponse))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn sendOKResponse(&self);
87
88        #[cfg(feature = "objc2-foundation")]
89        /// Sends a response to the hands free device
90        ///
91        /// Use this to send a response followed by an OK. Equivalent to [sendResponse:response withOK:YES].
92        ///
93        /// Parameter `response`: The response to send to the hands free device
94        #[unsafe(method(sendResponse:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn sendResponse(&self, response: Option<&NSString>);
97
98        #[cfg(feature = "objc2-foundation")]
99        /// Sends a response to the hands free device
100        ///
101        /// Use this to send a response and optionally followed by an OK.
102        ///
103        /// Parameter `response`: The response to send to the hands free device
104        ///
105        /// Parameter `withOK`: If yes, an OK response will also be sent.
106        #[unsafe(method(sendResponse:withOK:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn sendResponse_withOK(&self, response: Option<&NSString>, with_ok: bool);
109    );
110}
111
112/// Methods declared on superclass `NSObject`.
113#[cfg(feature = "IOBluetoothHandsFree")]
114impl IOBluetoothHandsFreeAudioGateway {
115    extern_methods!(
116        #[unsafe(method(init))]
117        #[unsafe(method_family = init)]
118        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119
120        #[unsafe(method(new))]
121        #[unsafe(method_family = new)]
122        pub unsafe fn new() -> Retained<Self>;
123    );
124}
125
126extern_protocol!(
127    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeaudiogatewaydelegate?language=objc)
128    pub unsafe trait IOBluetoothHandsFreeAudioGatewayDelegate {
129        #[cfg(all(feature = "IOBluetoothHandsFree", feature = "objc2-foundation"))]
130        /// Tells the delegate that the device is sending a hangup.
131        ///
132        /// Parameter `device`: The IOBluetoothHandsFreeAudioGateway object
133        ///
134        /// Parameter `redial`: Always 1.
135        #[optional]
136        #[unsafe(method(handsFree:hangup:))]
137        #[unsafe(method_family = none)]
138        unsafe fn handsFree_hangup(
139            &self,
140            device: Option<&IOBluetoothHandsFreeAudioGateway>,
141            hangup: Option<&NSNumber>,
142        );
143
144        #[cfg(all(feature = "IOBluetoothHandsFree", feature = "objc2-foundation"))]
145        /// Tells the delegate that the device is trying to redial.
146        ///
147        /// Parameter `device`: The IOBluetoothHandsFreeAudioGateway object
148        ///
149        /// Parameter `redial`: Always 1.
150        #[optional]
151        #[unsafe(method(handsFree:redial:))]
152        #[unsafe(method_family = none)]
153        unsafe fn handsFree_redial(
154            &self,
155            device: Option<&IOBluetoothHandsFreeAudioGateway>,
156            redial: Option<&NSNumber>,
157        );
158    }
159);