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