objc2_av_foundation/generated/
AVMetadataItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-media")]
7use objc2_core_media::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct AVMetadataItem;
17);
18
19#[cfg(feature = "AVAsynchronousKeyValueLoading")]
20unsafe impl AVAsynchronousKeyValueLoading for AVMetadataItem {}
21
22unsafe impl NSCopying for AVMetadataItem {}
23
24unsafe impl CopyingHelper for AVMetadataItem {
25 type Result = Self;
26}
27
28unsafe impl NSMutableCopying for AVMetadataItem {}
29
30unsafe impl MutableCopyingHelper for AVMetadataItem {
31 type Result = AVMutableMetadataItem;
32}
33
34unsafe impl NSObjectProtocol for AVMetadataItem {}
35
36impl AVMetadataItem {
37 extern_methods!(
38 #[cfg(feature = "AVMetadataIdentifiers")]
39 #[unsafe(method(identifier))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn identifier(&self) -> Option<Retained<AVMetadataIdentifier>>;
42
43 #[unsafe(method(extendedLanguageTag))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn extendedLanguageTag(&self) -> Option<Retained<NSString>>;
46
47 #[unsafe(method(locale))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn locale(&self) -> Option<Retained<NSLocale>>;
50
51 #[cfg(feature = "objc2-core-media")]
52 #[unsafe(method(time))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn time(&self) -> CMTime;
55
56 #[cfg(feature = "objc2-core-media")]
57 #[unsafe(method(duration))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn duration(&self) -> CMTime;
60
61 #[unsafe(method(dataType))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn dataType(&self) -> Option<Retained<NSString>>;
64
65 #[unsafe(method(value))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn value(&self)
68 -> Option<Retained<AnyObject >>;
69
70 #[cfg(feature = "AVMetadataFormat")]
71 #[unsafe(method(extraAttributes))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn extraAttributes(
74 &self,
75 ) -> Option<Retained<NSDictionary<AVMetadataExtraAttributeKey, AnyObject>>>;
76 );
77}
78
79impl AVMetadataItem {
81 extern_methods!(
82 #[unsafe(method(init))]
83 #[unsafe(method_family = init)]
84 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
85
86 #[unsafe(method(new))]
87 #[unsafe(method_family = new)]
88 pub unsafe fn new() -> Retained<Self>;
89 );
90}
91
92impl AVMetadataItem {
94 extern_methods!(
95 #[unsafe(method(startDate))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn startDate(&self) -> Option<Retained<NSDate>>;
98 );
99}
100
101impl AVMetadataItem {
103 extern_methods!(
104 #[unsafe(method(stringValue))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
107
108 #[unsafe(method(numberValue))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn numberValue(&self) -> Option<Retained<NSNumber>>;
111
112 #[unsafe(method(dateValue))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn dateValue(&self) -> Option<Retained<NSDate>>;
115
116 #[unsafe(method(dataValue))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn dataValue(&self) -> Option<Retained<NSData>>;
119 );
120}
121
122impl AVMetadataItem {
124 extern_methods!(
125 #[cfg(feature = "block2")]
126 #[unsafe(method(loadValuesAsynchronouslyForKeys:completionHandler:))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn loadValuesAsynchronouslyForKeys_completionHandler(
129 &self,
130 keys: &NSArray<NSString>,
131 handler: Option<&block2::Block<dyn Fn()>>,
132 );
133 );
134}
135
136impl AVMetadataItem {
138 extern_methods!(
139 #[unsafe(method(metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn metadataItemsFromArray_filteredAndSortedAccordingToPreferredLanguages(
149 metadata_items: &NSArray<AVMetadataItem>,
150 preferred_languages: &NSArray<NSString>,
151 ) -> Retained<NSArray<AVMetadataItem>>;
152
153 #[cfg(feature = "AVMetadataIdentifiers")]
154 #[unsafe(method(metadataItemsFromArray:filteredByIdentifier:))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn metadataItemsFromArray_filteredByIdentifier(
164 metadata_items: &NSArray<AVMetadataItem>,
165 identifier: &AVMetadataIdentifier,
166 ) -> Retained<NSArray<AVMetadataItem>>;
167
168 #[unsafe(method(metadataItemsFromArray:filteredByMetadataItemFilter:))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn metadataItemsFromArray_filteredByMetadataItemFilter(
178 metadata_items: &NSArray<AVMetadataItem>,
179 metadata_item_filter: &AVMetadataItemFilter,
180 ) -> Retained<NSArray<AVMetadataItem>>;
181 );
182}
183
184impl AVMetadataItem {
186 extern_methods!(
187 #[cfg(all(feature = "AVMetadataFormat", feature = "AVMetadataIdentifiers"))]
188 #[unsafe(method(identifierForKey:keySpace:))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn identifierForKey_keySpace(
202 key: &AnyObject,
203 key_space: &AVMetadataKeySpace,
204 ) -> Option<Retained<AVMetadataIdentifier>>;
205
206 #[cfg(all(feature = "AVMetadataFormat", feature = "AVMetadataIdentifiers"))]
207 #[unsafe(method(keySpaceForIdentifier:))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn keySpaceForIdentifier(
210 identifier: &AVMetadataIdentifier,
211 ) -> Option<Retained<AVMetadataKeySpace>>;
212
213 #[cfg(feature = "AVMetadataIdentifiers")]
214 #[unsafe(method(keyForIdentifier:))]
215 #[unsafe(method_family = none)]
216 pub unsafe fn keyForIdentifier(
217 identifier: &AVMetadataIdentifier,
218 ) -> Option<Retained<AnyObject>>;
219
220 #[unsafe(method(key))]
221 #[unsafe(method_family = none)]
222 pub unsafe fn key(&self) -> Option<Retained<AnyObject >>;
223
224 #[cfg(feature = "AVMetadataFormat")]
225 #[unsafe(method(commonKey))]
226 #[unsafe(method_family = none)]
227 pub unsafe fn commonKey(&self) -> Option<Retained<AVMetadataKey>>;
228
229 #[cfg(feature = "AVMetadataFormat")]
230 #[unsafe(method(keySpace))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn keySpace(&self) -> Option<Retained<AVMetadataKeySpace>>;
233 );
234}
235
236extern_class!(
237 #[unsafe(super(AVMetadataItem, NSObject))]
239 #[derive(Debug, PartialEq, Eq, Hash)]
240 pub struct AVMutableMetadataItem;
241);
242
243#[cfg(feature = "AVAsynchronousKeyValueLoading")]
244unsafe impl AVAsynchronousKeyValueLoading for AVMutableMetadataItem {}
245
246unsafe impl NSCopying for AVMutableMetadataItem {}
247
248unsafe impl CopyingHelper for AVMutableMetadataItem {
249 type Result = AVMetadataItem;
250}
251
252unsafe impl NSMutableCopying for AVMutableMetadataItem {}
253
254unsafe impl MutableCopyingHelper for AVMutableMetadataItem {
255 type Result = Self;
256}
257
258unsafe impl NSObjectProtocol for AVMutableMetadataItem {}
259
260impl AVMutableMetadataItem {
261 extern_methods!(
262 #[cfg(feature = "AVMetadataIdentifiers")]
263 #[unsafe(method(identifier))]
264 #[unsafe(method_family = none)]
265 pub unsafe fn identifier(&self) -> Option<Retained<AVMetadataIdentifier>>;
266
267 #[cfg(feature = "AVMetadataIdentifiers")]
268 #[unsafe(method(setIdentifier:))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn setIdentifier(&self, identifier: Option<&AVMetadataIdentifier>);
272
273 #[unsafe(method(extendedLanguageTag))]
274 #[unsafe(method_family = none)]
275 pub unsafe fn extendedLanguageTag(&self) -> Option<Retained<NSString>>;
276
277 #[unsafe(method(setExtendedLanguageTag:))]
279 #[unsafe(method_family = none)]
280 pub unsafe fn setExtendedLanguageTag(&self, extended_language_tag: Option<&NSString>);
281
282 #[unsafe(method(locale))]
283 #[unsafe(method_family = none)]
284 pub unsafe fn locale(&self) -> Option<Retained<NSLocale>>;
285
286 #[unsafe(method(setLocale:))]
288 #[unsafe(method_family = none)]
289 pub unsafe fn setLocale(&self, locale: Option<&NSLocale>);
290
291 #[cfg(feature = "objc2-core-media")]
292 #[unsafe(method(time))]
293 #[unsafe(method_family = none)]
294 pub unsafe fn time(&self) -> CMTime;
295
296 #[cfg(feature = "objc2-core-media")]
297 #[unsafe(method(setTime:))]
299 #[unsafe(method_family = none)]
300 pub unsafe fn setTime(&self, time: CMTime);
301
302 #[cfg(feature = "objc2-core-media")]
303 #[unsafe(method(duration))]
304 #[unsafe(method_family = none)]
305 pub unsafe fn duration(&self) -> CMTime;
306
307 #[cfg(feature = "objc2-core-media")]
308 #[unsafe(method(setDuration:))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn setDuration(&self, duration: CMTime);
312
313 #[unsafe(method(dataType))]
314 #[unsafe(method_family = none)]
315 pub unsafe fn dataType(&self) -> Option<Retained<NSString>>;
316
317 #[unsafe(method(setDataType:))]
319 #[unsafe(method_family = none)]
320 pub unsafe fn setDataType(&self, data_type: Option<&NSString>);
321
322 #[unsafe(method(value))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn value(&self)
325 -> Option<Retained<AnyObject >>;
326
327 #[unsafe(method(setValue:))]
329 #[unsafe(method_family = none)]
330 pub unsafe fn setValue(&self, value: Option<&AnyObject >);
331
332 #[cfg(feature = "AVMetadataFormat")]
333 #[unsafe(method(extraAttributes))]
334 #[unsafe(method_family = none)]
335 pub unsafe fn extraAttributes(
336 &self,
337 ) -> Option<Retained<NSDictionary<AVMetadataExtraAttributeKey, AnyObject>>>;
338
339 #[cfg(feature = "AVMetadataFormat")]
340 #[unsafe(method(setExtraAttributes:))]
342 #[unsafe(method_family = none)]
343 pub unsafe fn setExtraAttributes(
344 &self,
345 extra_attributes: Option<&NSDictionary<AVMetadataExtraAttributeKey, AnyObject>>,
346 );
347
348 #[unsafe(method(metadataItem))]
350 #[unsafe(method_family = none)]
351 pub unsafe fn metadataItem() -> Retained<AVMutableMetadataItem>;
352 );
353}
354
355impl AVMutableMetadataItem {
357 extern_methods!(
358 #[unsafe(method(init))]
359 #[unsafe(method_family = init)]
360 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
361
362 #[unsafe(method(new))]
363 #[unsafe(method_family = new)]
364 pub unsafe fn new() -> Retained<Self>;
365 );
366}
367
368impl AVMutableMetadataItem {
370 extern_methods!(
371 #[unsafe(method(startDate))]
372 #[unsafe(method_family = none)]
373 pub unsafe fn startDate(&self) -> Option<Retained<NSDate>>;
374
375 #[unsafe(method(setStartDate:))]
377 #[unsafe(method_family = none)]
378 pub unsafe fn setStartDate(&self, start_date: Option<&NSDate>);
379 );
380}
381
382impl AVMutableMetadataItem {
384 extern_methods!(
385 #[cfg(feature = "AVMetadataFormat")]
386 #[unsafe(method(keySpace))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn keySpace(&self) -> Option<Retained<AVMetadataKeySpace>>;
389
390 #[cfg(feature = "AVMetadataFormat")]
391 #[unsafe(method(setKeySpace:))]
393 #[unsafe(method_family = none)]
394 pub unsafe fn setKeySpace(&self, key_space: Option<&AVMetadataKeySpace>);
395
396 #[unsafe(method(key))]
397 #[unsafe(method_family = none)]
398 pub unsafe fn key(&self) -> Option<Retained<AnyObject >>;
399
400 #[unsafe(method(setKey:))]
402 #[unsafe(method_family = none)]
403 pub unsafe fn setKey(&self, key: Option<&AnyObject >);
404 );
405}
406
407impl AVMetadataItem {
409 extern_methods!(
410 #[cfg(feature = "block2")]
411 #[unsafe(method(metadataItemWithPropertiesOfMetadataItem:valueLoadingHandler:))]
424 #[unsafe(method_family = none)]
425 pub unsafe fn metadataItemWithPropertiesOfMetadataItem_valueLoadingHandler(
426 metadata_item: &AVMetadataItem,
427 handler: &block2::Block<dyn Fn(NonNull<AVMetadataItemValueRequest>)>,
428 ) -> Retained<AVMetadataItem>;
429 );
430}
431
432extern_class!(
433 #[unsafe(super(NSObject))]
435 #[derive(Debug, PartialEq, Eq, Hash)]
436 pub struct AVMetadataItemValueRequest;
437);
438
439unsafe impl NSObjectProtocol for AVMetadataItemValueRequest {}
440
441impl AVMetadataItemValueRequest {
442 extern_methods!(
443 #[unsafe(method(metadataItem))]
444 #[unsafe(method_family = none)]
445 pub unsafe fn metadataItem(&self) -> Option<Retained<AVMetadataItem>>;
446
447 #[unsafe(method(respondWithValue:))]
451 #[unsafe(method_family = none)]
452 pub unsafe fn respondWithValue(
453 &self,
454 value: &AnyObject, );
456
457 #[unsafe(method(respondWithError:))]
461 #[unsafe(method_family = none)]
462 pub unsafe fn respondWithError(&self, error: &NSError);
463 );
464}
465
466impl AVMetadataItemValueRequest {
468 extern_methods!(
469 #[unsafe(method(init))]
470 #[unsafe(method_family = init)]
471 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
472
473 #[unsafe(method(new))]
474 #[unsafe(method_family = new)]
475 pub unsafe fn new() -> Retained<Self>;
476 );
477}
478
479extern_class!(
480 #[unsafe(super(NSObject))]
486 #[derive(Debug, PartialEq, Eq, Hash)]
487 pub struct AVMetadataItemFilter;
488);
489
490unsafe impl Send for AVMetadataItemFilter {}
491
492unsafe impl Sync for AVMetadataItemFilter {}
493
494unsafe impl NSObjectProtocol for AVMetadataItemFilter {}
495
496impl AVMetadataItemFilter {
497 extern_methods!(
498 #[unsafe(method(metadataItemFilterForSharing))]
499 #[unsafe(method_family = none)]
500 pub unsafe fn metadataItemFilterForSharing() -> Retained<AVMetadataItemFilter>;
501 );
502}
503
504impl AVMetadataItemFilter {
506 extern_methods!(
507 #[unsafe(method(init))]
508 #[unsafe(method_family = init)]
509 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
510
511 #[unsafe(method(new))]
512 #[unsafe(method_family = new)]
513 pub unsafe fn new() -> Retained<Self>;
514 );
515}
516
517impl AVMetadataItem {
519 extern_methods!(
520 #[unsafe(method(metadataItemsFromArray:withLocale:))]
522 #[unsafe(method_family = none)]
523 pub unsafe fn metadataItemsFromArray_withLocale(
524 metadata_items: &NSArray<AVMetadataItem>,
525 locale: &NSLocale,
526 ) -> Retained<NSArray<AVMetadataItem>>;
527
528 #[cfg(feature = "AVMetadataFormat")]
529 #[unsafe(method(metadataItemsFromArray:withKey:keySpace:))]
531 #[unsafe(method_family = none)]
532 pub unsafe fn metadataItemsFromArray_withKey_keySpace(
533 metadata_items: &NSArray<AVMetadataItem>,
534 key: Option<&AnyObject>,
535 key_space: Option<&AVMetadataKeySpace>,
536 ) -> Retained<NSArray<AVMetadataItem>>;
537 );
538}
539
540impl AVMutableMetadataItem {
545 extern_methods!();
546}