objc2_event_kit/generated/EKVirtualConferenceProvider.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 /// Provides virtual conferences to Calendar.
12 ///
13 /// Subclass this class in your extension and override the below two methods.
14 ///
15 /// See also [Apple's documentation](https://developer.apple.com/documentation/eventkit/ekvirtualconferenceprovider?language=objc)
16 #[unsafe(super(NSObject))]
17 #[derive(Debug, PartialEq, Eq, Hash)]
18 pub struct EKVirtualConferenceProvider;
19);
20
21unsafe impl NSExtensionRequestHandling for EKVirtualConferenceProvider {}
22
23unsafe impl NSObjectProtocol for EKVirtualConferenceProvider {}
24
25impl EKVirtualConferenceProvider {
26 extern_methods!(
27 #[cfg(all(feature = "EKVirtualConferenceDescriptor", feature = "block2"))]
28 /// Called to determine the available virtual conference room types that the user can add to a calendar event.
29 ///
30 /// Your extension must override this method in order to present virtual conference options in Calendar's UI.
31 /// When your extension has finished determining what room types are available, call the completion handler with
32 /// an array of EKVirtualConferenceRoomTypeDescriptors. Most extensions will only need to provide one room type.
33 ///
34 /// Parameter `completionHandler`: A block to call when your extension has finished retrieving available room types. If
35 /// your extension is unable to provide any room types at this time, call this block with nil
36 /// for the first argument and an appropriate NSError object for the second argument. Do not
37 /// call this block with nil for both arguments. Similarly, do not call this block with both
38 /// a non-nil array and a non-nil NSError. This block must be called when your extension has
39 /// finished its work.
40 #[unsafe(method(fetchAvailableRoomTypesWithCompletionHandler:))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn fetchAvailableRoomTypesWithCompletionHandler(
43 &self,
44 completion_handler: &block2::Block<
45 dyn Fn(*mut NSArray<EKVirtualConferenceRoomTypeDescriptor>, *mut NSError),
46 >,
47 );
48
49 #[cfg(all(feature = "EKVirtualConferenceDescriptor", feature = "block2"))]
50 /// Called to fetch the specific virtual conference details to add to an event.
51 ///
52 /// Your extension must override this method in order to add virtual conferences to calendar events.
53 /// When your extension has finished retrieving the requested virtual conference details, create an
54 /// EKVirtualConferenceDescriptor object containing the virtual conference details and call the completion handler
55 /// with the EKVirtualConferenceDescriptor object as the first argument.
56 ///
57 /// Parameter `identifier`: Represents the room type that the user chose. This is the same identifier that your extension
58 /// chose for this EKVirtualConferenceRoomTypeDescriptor in an earlier call to
59 /// fetchAvailableRoomTypesWithCompletionHandler:.
60 ///
61 /// Parameter `completionHandler`: A block to call when your extension has finished retrieving the virtual conference details.
62 /// If your extension is unable to retrieve virtual conference details at this time (for example,
63 /// because network access is not available), call this block with nil for the first argument and
64 /// an appropriate NSError object for the second argument. Do not call this block with nil for
65 /// both arguments. Similarly, do not call this block with both a non-nil
66 /// EKVirtualConferenceDescriptor and a non-nil NSError. This block must be called when your
67 /// extension has finished its work.
68 #[unsafe(method(fetchVirtualConferenceForIdentifier:completionHandler:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn fetchVirtualConferenceForIdentifier_completionHandler(
71 &self,
72 identifier: &EKVirtualConferenceRoomTypeIdentifier,
73 completion_handler: &block2::Block<
74 dyn Fn(*mut EKVirtualConferenceDescriptor, *mut NSError),
75 >,
76 );
77 );
78}
79
80/// Methods declared on superclass `NSObject`.
81impl EKVirtualConferenceProvider {
82 extern_methods!(
83 #[unsafe(method(init))]
84 #[unsafe(method_family = init)]
85 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
86
87 #[unsafe(method(new))]
88 #[unsafe(method_family = new)]
89 pub unsafe fn new() -> Retained<Self>;
90 );
91}