objc2_event_kit/generated/
EKParticipant.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// Abstract class representing a participant attached to an event.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/eventkit/ekparticipant?language=objc)
13    #[unsafe(super(EKObject, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "EKObject")]
16    pub struct EKParticipant;
17);
18
19#[cfg(feature = "EKObject")]
20extern_conformance!(
21    unsafe impl NSCopying for EKParticipant {}
22);
23
24#[cfg(feature = "EKObject")]
25unsafe impl CopyingHelper for EKParticipant {
26    type Result = Self;
27}
28
29#[cfg(feature = "EKObject")]
30extern_conformance!(
31    unsafe impl NSObjectProtocol for EKParticipant {}
32);
33
34#[cfg(feature = "EKObject")]
35impl EKParticipant {
36    extern_methods!(
37        /// URL representing this participant.
38        #[unsafe(method(URL))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn URL(&self) -> Retained<NSURL>;
41
42        /// Name of this participant.
43        #[unsafe(method(name))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
46
47        #[cfg(feature = "EKTypes")]
48        /// The status of the attendee.
49        ///
50        /// Returns the status of the attendee as a EKParticipantStatus value.
51        #[unsafe(method(participantStatus))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn participantStatus(&self) -> EKParticipantStatus;
54
55        #[cfg(feature = "EKTypes")]
56        /// The role of the attendee.
57        ///
58        /// Returns the role of the attendee as a EKParticipantRole value.
59        #[unsafe(method(participantRole))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn participantRole(&self) -> EKParticipantRole;
62
63        #[cfg(feature = "EKTypes")]
64        /// The type of the attendee.
65        ///
66        /// Returns the type of the attendee as a EKParticipantType value.
67        #[unsafe(method(participantType))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn participantType(&self) -> EKParticipantType;
70
71        /// A boolean indicating whether this participant represents the
72        /// owner of this account.
73        #[unsafe(method(isCurrentUser))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn isCurrentUser(&self) -> bool;
76
77        /// Returns a predicate to use with Contacts.framework to retrieve the corresponding
78        /// CNContact instance.
79        ///
80        /// This method returns a predicate that can be used with a CNContactStore to fetch
81        /// a CNContact instance for this participant, if one exists.
82        #[unsafe(method(contactPredicate))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn contactPredicate(&self) -> Retained<NSPredicate>;
85    );
86}
87
88/// Methods declared on superclass `NSObject`.
89#[cfg(feature = "EKObject")]
90impl EKParticipant {
91    extern_methods!(
92        #[unsafe(method(init))]
93        #[unsafe(method_family = init)]
94        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
95
96        #[unsafe(method(new))]
97        #[unsafe(method_family = new)]
98        pub unsafe fn new() -> Retained<Self>;
99    );
100}