rust_macios/user_notifications/
un_mutable_notification_content.rs1use libc::c_double;
2use objc::{msg_send, sel, sel_impl};
3use rust_macios_objective_c_runtime_proc_macros::interface_impl;
4
5use crate::{
6 foundation::{NSArray, NSDictionary, NSNumber, NSString, UInt},
7 object,
8 objective_c_runtime::id,
9};
10
11use super::{
12 IUNNotificationContent, UNNotificationAttachment, UNNotificationInterruptionLevel,
13 UNNotificationSound,
14};
15
16object! {
17 unsafe pub struct UNMutableNotificationContent;
19}
20
21impl IUNNotificationContent for UNMutableNotificationContent {}
22
23#[interface_impl(UNNotificationContent)]
24impl UNMutableNotificationContent {
25 #[property]
29 pub fn set_title(&mut self, title: NSString) {
30 unsafe { msg_send![self.m_self(), setTitle: title] }
31 }
32
33 #[property]
35 pub fn set_subtitle(&mut self, subtitle: NSString) {
36 unsafe { msg_send![self.m_self(), setSubtitle: subtitle] }
37 }
38
39 #[property]
41 pub fn set_body(&mut self, body: NSString) {
42 unsafe { msg_send![self.m_self(), setBody: body] }
43 }
44
45 #[property]
50 pub fn set_attachments(&mut self, attachments: NSArray<UNNotificationAttachment>) {
51 unsafe { msg_send![self.m_self(), setAttachments: attachments] }
52 }
53
54 #[property]
56 pub fn set_user_info(&mut self, user_info: NSDictionary<id, id>) {
57 unsafe { msg_send![self.m_self(), setUserInfo: user_info] }
58 }
59
60 #[property]
65 pub fn set_launch_image_name(&mut self, value: NSString) {
66 unsafe { msg_send![self.m_self(), setLaunchImageName: value] }
67 }
68
69 #[property]
71 pub fn set_badge(&mut self, badge: NSNumber) {
72 unsafe { msg_send![self.m_self(), setBadge: badge] }
73 }
74
75 #[property]
77 pub fn set_target_content_identifier(&mut self, value: NSString) {
78 unsafe { msg_send![self.m_self(), setTargetContentIdentifier: value] }
79 }
80
81 #[property]
86 pub fn set_sound(&mut self, value: UNNotificationSound) {
87 unsafe { msg_send![self.m_self(), setSound: value] }
88 }
89
90 #[property]
92 pub fn set_interruption_level(&mut self, value: UNNotificationInterruptionLevel) {
93 unsafe { msg_send![self.m_self(), setInterruptionLevel: value] }
94 }
95
96 #[property]
98 pub fn set_relevance_score(&mut self, value: c_double) {
99 unsafe { msg_send![self.m_self(), setRelevanceScore: value] }
100 }
101
102 #[property]
104 pub fn set_filter_criteria(&mut self, value: NSString) {
105 unsafe { msg_send![self.m_self(), setFilterCriteria: value] }
106 }
107
108 #[property]
113 pub fn set_thread_identifier(&mut self, value: NSString) {
114 unsafe { msg_send![self.m_self(), setThreadIdentifier: value] }
115 }
116
117 #[property]
119 pub fn set_category_identifier(&mut self, value: NSString) {
120 unsafe { msg_send![self.m_self(), setCategoryIdentifier: value] }
121 }
122
123 #[property]
125 pub fn set_summary_argument(&mut self, value: NSString) {
126 unsafe { msg_send![self.m_self(), setSummaryArgument: value] }
127 }
128
129 #[property]
131 pub fn set_summary_argument_count(&mut self, value: UInt) {
132 unsafe { msg_send![self.m_self(), setSummaryArgumentCount: value] }
133 }
134}