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")]
20unsafe impl NSCopying for EKParticipant {}
21
22#[cfg(feature = "EKObject")]
23unsafe impl CopyingHelper for EKParticipant {
24    type Result = Self;
25}
26
27#[cfg(feature = "EKObject")]
28unsafe impl NSObjectProtocol for EKParticipant {}
29
30#[cfg(feature = "EKObject")]
31impl EKParticipant {
32    extern_methods!(
33        /// URL representing this participant.
34        #[unsafe(method(URL))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn URL(&self) -> Retained<NSURL>;
37
38        /// Name of this participant.
39        #[unsafe(method(name))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
42
43        #[cfg(feature = "EKTypes")]
44        /// The status of the attendee.
45        ///
46        /// Returns the status of the attendee as a EKParticipantStatus value.
47        #[unsafe(method(participantStatus))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn participantStatus(&self) -> EKParticipantStatus;
50
51        #[cfg(feature = "EKTypes")]
52        /// The role of the attendee.
53        ///
54        /// Returns the role of the attendee as a EKParticipantRole value.
55        #[unsafe(method(participantRole))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn participantRole(&self) -> EKParticipantRole;
58
59        #[cfg(feature = "EKTypes")]
60        /// The type of the attendee.
61        ///
62        /// Returns the type of the attendee as a EKParticipantType value.
63        #[unsafe(method(participantType))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn participantType(&self) -> EKParticipantType;
66
67        /// A boolean indicating whether this participant represents the
68        /// owner of this account.
69        #[unsafe(method(isCurrentUser))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn isCurrentUser(&self) -> bool;
72
73        /// Returns a predicate to use with Contacts.framework to retrieve the corresponding
74        /// CNContact instance.
75        ///
76        /// This method returns a predicate that can be used with a CNContactStore to fetch
77        /// a CNContact instance for this participant, if one exists.
78        #[unsafe(method(contactPredicate))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn contactPredicate(&self) -> Retained<NSPredicate>;
81    );
82}
83
84/// Methods declared on superclass `NSObject`.
85#[cfg(feature = "EKObject")]
86impl EKParticipant {
87    extern_methods!(
88        #[unsafe(method(init))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
91
92        #[unsafe(method(new))]
93        #[unsafe(method_family = new)]
94        pub unsafe fn new() -> Retained<Self>;
95    );
96}