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