objc2_io_bluetooth/generated/objc2/IOBluetoothSDPServiceAttribute.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::*;
5#[cfg(feature = "objc2-foundation")]
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 /// IOBluetoothSDPServiceAttribute represents a single SDP service attribute.
12 ///
13 /// A service attribute contains two components: an attribute ID and a data element.
14 ///
15 /// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothsdpserviceattribute?language=objc)
16 #[unsafe(super(NSObject))]
17 #[derive(Debug, PartialEq, Eq, Hash)]
18 pub struct IOBluetoothSDPServiceAttribute;
19);
20
21#[cfg(feature = "objc2-foundation")]
22extern_conformance!(
23 unsafe impl NSCoding for IOBluetoothSDPServiceAttribute {}
24);
25
26extern_conformance!(
27 unsafe impl NSObjectProtocol for IOBluetoothSDPServiceAttribute {}
28);
29
30#[cfg(feature = "objc2-foundation")]
31extern_conformance!(
32 unsafe impl NSSecureCoding for IOBluetoothSDPServiceAttribute {}
33);
34
35impl IOBluetoothSDPServiceAttribute {
36 extern_methods!(
37 #[cfg(feature = "Bluetooth")]
38 /// Creates a new service attribute with the given ID and element value.
39 ///
40 /// See +[IOBluetoothSDPDataElement withElementValue:] for a description of the types that
41 /// may be passed in as the attributeElementValue.
42 ///
43 /// Parameter `attributeID`: The attribute ID of the new service attribute.
44 ///
45 /// Parameter `attributeElementValue`: The data element value of the new service attribute
46 ///
47 /// Returns: Returns the newly allocated service attribute object. Returns nil if there was an error parsing the element value. The returned IOBluetoothSDPDataElement object has been autoreleased, so it is not
48 /// necessary for the caller to release it. If the object is to be referenced and kept around, retain
49 /// should be called.
50 #[unsafe(method(withID:attributeElementValue:))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn withID_attributeElementValue(
53 new_attribute_id: BluetoothSDPServiceAttributeID,
54 attribute_element_value: Option<&NSObject>,
55 ) -> Option<Retained<Self>>;
56
57 #[cfg(all(feature = "Bluetooth", feature = "IOBluetoothSDPDataElement"))]
58 /// Creates a new service attribute with the given ID and data element.
59 ///
60 /// Parameter `attributeID`: The attribute ID of the new service attribute.
61 ///
62 /// Parameter `attributeElement`: The data element of the new service attribute.
63 ///
64 /// Returns: Returns the newly allocated service attribute object. Returns nil if there was an error.
65 /// The returned IOBluetoothSDPDataElement object has been autoreleased, so it is not
66 /// necessary for the caller to release it. If the object is to be referenced and kept around, retain
67 /// should be called.
68 #[unsafe(method(withID:attributeElement:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn withID_attributeElement(
71 new_attribute_id: BluetoothSDPServiceAttributeID,
72 attribute_element: Option<&IOBluetoothSDPDataElement>,
73 ) -> Option<Retained<Self>>;
74
75 #[cfg(feature = "Bluetooth")]
76 /// Initializes a new service attribute with the given ID and element value.
77 ///
78 /// See +[IOBluetoothSDPDataElement withElementValue:] for a description of the types that
79 /// may be passed in as the attributeElementValue.
80 ///
81 /// Parameter `attributeID`: The attribute ID of the new service attribute.
82 ///
83 /// Parameter `attributeElementValue`: The data element value of the new service attribute
84 ///
85 /// Returns: Returns self if successful. Returns nil if there was an error parsing the element value.
86 #[unsafe(method(initWithID:attributeElementValue:))]
87 #[unsafe(method_family = init)]
88 pub unsafe fn initWithID_attributeElementValue(
89 this: Allocated<Self>,
90 new_attribute_id: BluetoothSDPServiceAttributeID,
91 attribute_element_value: Option<&NSObject>,
92 ) -> Option<Retained<Self>>;
93
94 #[cfg(all(feature = "Bluetooth", feature = "IOBluetoothSDPDataElement"))]
95 /// Initializes a new service attribute with the given ID and data element.
96 ///
97 /// Parameter `attributeID`: The attribute ID of the new service attribute.
98 ///
99 /// Parameter `attributeElement`: The data element of the new service attribute.
100 ///
101 /// Returns: Returns self if successful. Returns nil if there was an error.
102 #[unsafe(method(initWithID:attributeElement:))]
103 #[unsafe(method_family = init)]
104 pub unsafe fn initWithID_attributeElement(
105 this: Allocated<Self>,
106 new_attribute_id: BluetoothSDPServiceAttributeID,
107 attribute_element: Option<&IOBluetoothSDPDataElement>,
108 ) -> Option<Retained<Self>>;
109
110 #[cfg(feature = "Bluetooth")]
111 /// Returns the attribute ID for the target service attribute.
112 ///
113 /// Returns: Returns the attribute ID for the target service attribute.
114 #[unsafe(method(getAttributeID))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn getAttributeID(&self) -> BluetoothSDPServiceAttributeID;
117
118 #[cfg(feature = "IOBluetoothSDPDataElement")]
119 /// Returns the data element for the target service attribute.
120 ///
121 /// Returns: Returns the data element for the target service attribute.
122 #[unsafe(method(getDataElement))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn getDataElement(&self) -> Option<Retained<IOBluetoothSDPDataElement>>;
125
126 #[cfg(feature = "IOBluetoothSDPDataElement")]
127 /// Returns the data element representing the attribute ID for the target service attribute.
128 ///
129 /// Returns: Returns the data element representing the attribute ID for the target service attribute.
130 #[unsafe(method(getIDDataElement))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn getIDDataElement(&self) -> Option<Retained<IOBluetoothSDPDataElement>>;
133 );
134}
135
136/// Methods declared on superclass `NSObject`.
137impl IOBluetoothSDPServiceAttribute {
138 extern_methods!(
139 #[unsafe(method(init))]
140 #[unsafe(method_family = init)]
141 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
142
143 #[unsafe(method(new))]
144 #[unsafe(method_family = new)]
145 pub unsafe fn new() -> Retained<Self>;
146 );
147}