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