objc2_event_kit/generated/
EKSource.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    /// [Apple's documentation](https://developer.apple.com/documentation/eventkit/eksource?language=objc)
11    #[unsafe(super(EKObject, NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    #[cfg(feature = "EKObject")]
14    pub struct EKSource;
15);
16
17#[cfg(feature = "EKObject")]
18unsafe impl NSObjectProtocol for EKSource {}
19
20#[cfg(feature = "EKObject")]
21impl EKSource {
22    extern_methods!(
23        #[unsafe(method(sourceIdentifier))]
24        #[unsafe(method_family = none)]
25        pub unsafe fn sourceIdentifier(&self) -> Retained<NSString>;
26
27        #[cfg(feature = "EKTypes")]
28        #[unsafe(method(sourceType))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn sourceType(&self) -> EKSourceType;
31
32        #[unsafe(method(title))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn title(&self) -> Retained<NSString>;
35
36        #[cfg(feature = "EKCalendar")]
37        /// This is now deprecated in favor of -[EKSource calendarsForEntityType:]
38        #[unsafe(method(calendars))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn calendars(&self) -> Retained<NSSet<EKCalendar>>;
41
42        #[cfg(all(feature = "EKCalendar", feature = "EKTypes"))]
43        /// Returns the calendars that belong to this source that
44        /// support a given entity type (reminders, events)
45        #[unsafe(method(calendarsForEntityType:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn calendarsForEntityType(
48            &self,
49            entity_type: EKEntityType,
50        ) -> Retained<NSSet<EKCalendar>>;
51
52        /// Returns YES if this EKSource represents an account delegated by another user.
53        #[unsafe(method(isDelegate))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn isDelegate(&self) -> bool;
56    );
57}
58
59/// Methods declared on superclass `NSObject`.
60#[cfg(feature = "EKObject")]
61impl EKSource {
62    extern_methods!(
63        #[unsafe(method(init))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
66
67        #[unsafe(method(new))]
68        #[unsafe(method_family = new)]
69        pub unsafe fn new() -> Retained<Self>;
70    );
71}