objc2_event_kit/generated/EKReminder.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 /// The EKReminder class represents a reminder (task/todo).
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/eventkit/ekreminder?language=objc)
14 #[unsafe(super(EKCalendarItem, EKObject, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(all(feature = "EKCalendarItem", feature = "EKObject"))]
17 pub struct EKReminder;
18);
19
20#[cfg(all(feature = "EKCalendarItem", feature = "EKObject"))]
21extern_conformance!(
22 unsafe impl NSObjectProtocol for EKReminder {}
23);
24
25#[cfg(all(feature = "EKCalendarItem", feature = "EKObject"))]
26impl EKReminder {
27 extern_methods!(
28 #[cfg(feature = "EKEventStore")]
29 /// Creates a new reminder in the given event store.
30 #[unsafe(method(reminderWithEventStore:))]
31 #[unsafe(method_family = none)]
32 pub unsafe fn reminderWithEventStore(event_store: &EKEventStore) -> Retained<EKReminder>;
33
34 /// The start date of the task, as date components.
35 ///
36 /// The use of date components allows the start date and its time zone to be represented in a single property.
37 /// A nil time zone represents a floating date. Setting a date component without a hour, minute and second component will set allDay to YES.
38 /// If you set this property, the calendar must be set to NSCalendarIdentifierGregorian. An exception is raised otherwise.
39 #[unsafe(method(startDateComponents))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn startDateComponents(&self) -> Option<Retained<NSDateComponents>>;
42
43 /// Setter for [`startDateComponents`][Self::startDateComponents].
44 ///
45 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
46 #[unsafe(method(setStartDateComponents:))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn setStartDateComponents(
49 &self,
50 start_date_components: Option<&NSDateComponents>,
51 );
52
53 /// The date by which this reminder should be completed.
54 ///
55 /// The use of date components allows the due date and its time zone to be represented in a single property.
56 /// A nil time zone represents a floating date. Setting a date component without a hour, minute and second component will set allDay to YES.
57 /// If you set this property, the calendar must be set to NSCalendarIdentifierGregorian. An exception is raised otherwise.
58 ///
59 /// On iOS, if you set the due date for a reminder, you must also set a start date, otherwise you will receive
60 /// an error (EKErrorNoStartDate) when attempting to save this reminder. This is not a requirement on OS X.
61 #[unsafe(method(dueDateComponents))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn dueDateComponents(&self) -> Option<Retained<NSDateComponents>>;
64
65 /// Setter for [`dueDateComponents`][Self::dueDateComponents].
66 ///
67 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
68 #[unsafe(method(setDueDateComponents:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn setDueDateComponents(&self, due_date_components: Option<&NSDateComponents>);
71
72 /// Whether or not the reminder is completed.
73 ///
74 /// Setting it to YES will set the completed date to the current date.
75 /// Setting it to NO will set the completed date to nil.
76 #[unsafe(method(isCompleted))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn isCompleted(&self) -> bool;
79
80 /// Setter for [`isCompleted`][Self::isCompleted].
81 #[unsafe(method(setCompleted:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn setCompleted(&self, completed: bool);
84
85 /// The date on which this reminder was completed.
86 #[unsafe(method(completionDate))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn completionDate(&self) -> Option<Retained<NSDate>>;
89
90 /// Setter for [`completionDate`][Self::completionDate].
91 ///
92 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
93 #[unsafe(method(setCompletionDate:))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn setCompletionDate(&self, completion_date: Option<&NSDate>);
96
97 /// The priority of the reminder.
98 ///
99 /// Priorities run from 1 (highest) to 9 (lowest). A priority of 0 means no priority.
100 /// Saving a reminder with any other priority will fail.
101 /// Per RFC 5545, priorities of 1-4 are considered "high," a priority of 5 is "medium," and priorities of 6-9 are "low."
102 #[unsafe(method(priority))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn priority(&self) -> NSUInteger;
105
106 /// Setter for [`priority`][Self::priority].
107 #[unsafe(method(setPriority:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setPriority(&self, priority: NSUInteger);
110 );
111}
112
113/// Methods declared on superclass `NSObject`.
114#[cfg(all(feature = "EKCalendarItem", feature = "EKObject"))]
115impl EKReminder {
116 extern_methods!(
117 #[unsafe(method(init))]
118 #[unsafe(method_family = init)]
119 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
120
121 #[unsafe(method(new))]
122 #[unsafe(method_family = new)]
123 pub unsafe fn new() -> Retained<Self>;
124 );
125}