Thu, 30 Jun 2022 20:24:09 -0500
Create and add notifications for account errors.
Adjust the NotificationManager API a bit to be easier to use and map better to
GListStore which the manager is now using internally.
Testing Done:
Ran the unit tests and forced a connection error and verified no issues (used gdb to verify that item was added).
Bugs closed: PIDGIN-17639
Reviewed at https://reviews.imfreedom.org/r/1509/
|
41433
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * This library is free software; you can redistribute it and/or |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * modify it under the terms of the GNU Lesser General Public |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * License as published by the Free Software Foundation; either |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * version 2 of the License, or (at your option) any later version. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * This library is distributed in the hope that it will be useful, |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * Lesser General Public License for more details. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU Lesser General Public |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * License along with this library; if not, see <https://www.gnu.org/licenses/>. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | # error "only <purple.h> may be included directly" |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | #endif |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #ifndef PURPLE_NOTIFICATION_H |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | #define PURPLE_NOTIFICATION_H |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | #include <glib.h> |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #include <glib-object.h> |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | #include "account.h" |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | G_BEGIN_DECLS |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | * PurpleNotificationType: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | * Since: 3.0.0. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | typedef enum { |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | PURPLE_NOTIFICATION_TYPE_UNKNOWN, |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | PURPLE_NOTIFICATION_TYPE_GENERIC, |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | PURPLE_NOTIFICATION_TYPE_CONNECTION_ERROR, |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | PURPLE_NOTIFICATION_TYPE_CONTACT_AUTHORIZATION, |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | PURPLE_NOTIFICATION_TYPE_FILE_TRANSFER, |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | PURPLE_NOTIFICATION_TYPE_CHAT_INVITE, |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | PURPLE_NOTIFICATION_TYPE_MENTION, |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | PURPLE_NOTIFICATION_TYPE_REACTION, |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | } PurpleNotificationType; |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | * PurpleNotification: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | * An object that represents a notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | #define PURPLE_TYPE_NOTIFICATION (purple_notification_get_type()) |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | G_DECLARE_FINAL_TYPE(PurpleNotification, purple_notification, PURPLE, |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | NOTIFICATION, GObject) |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | * purple_notification_new: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | * @type: The [enum@NotificationType] of the notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | * @account: (nullable): The [class@Account] that created the notification if |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | * applicable. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | * @data: The data for the notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | * @data_destroy_func: A GDestroyNotify to call to free @data. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | * Creates a new notification with the given properties. @account is optional. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | * Once the notification is prepared, it should be added to a |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | * [class@NotificationManager] to be presented to the user. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | * Returns: (transfer full): The new notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | PurpleNotification *purple_notification_new(PurpleNotificationType type, PurpleAccount *account, gpointer data, GDestroyNotify data_destroy_func); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | * purple_notification_get_id: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | * Gets the identifier of @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | * Returns: The identifier of @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | const gchar *purple_notification_get_id(PurpleNotification *notification); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | * purple_notification_get_notification_type: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | * Gets the [enum@NotificationType] of @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | * Returns: The type of @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | PurpleNotificationType purple_notification_get_notification_type(PurpleNotification *notification); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | * purple_notification_get_account: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 | * Gets the [class@Account] of @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | * Returns: (transfer none): The account of @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
114 | PurpleAccount *purple_notification_get_account(PurpleNotification *notification); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
117 | * purple_notification_get_created_timestamp: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | * Gets the created time of @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | * Returns: (transfer none): The creation time of @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
126 | GDateTime *purple_notification_get_created_timestamp(PurpleNotification *notification); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
127 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
129 | * purple_notification_set_created_timestamp: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
130 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
131 | * @timestamp: (transfer none): The new timestamp. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
132 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
133 | * Sets the created timestamp of @notification to @timestamp. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
135 | * Timestamp is internally converted to UTC so you don't need to do that ahead |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
136 | * of time. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 | * |
|
41438
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
138 | * If @timestamp is %NULL, the current time will be used. |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
139 | * |
|
41433
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | void purple_notification_set_created_timestamp(PurpleNotification *notification, GDateTime *timestamp); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | * purple_notification_get_title: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | * Gets the title of @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
150 | * Returns: The title of @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
154 | const gchar *purple_notification_get_title(PurpleNotification *notification); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
157 | * purple_notification_set_title: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
158 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 | * @title: (nullable): The new title. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
160 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
161 | * Sets the title of @notification to @title. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
162 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
163 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
164 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
165 | void purple_notification_set_title(PurpleNotification *notification, const gchar *title); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
166 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
167 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
168 | * purple_notification_get_icon_name: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
169 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
170 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
171 | * Gets the named icon for @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
172 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
173 | * Returns: The named icon for @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
174 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
175 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
176 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
177 | const gchar *purple_notification_get_icon_name(PurpleNotification *notification); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
178 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
179 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
180 | * purple_notification_set_icon_name: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
181 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
182 | * @icon_name: (nullable): The icon name. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
183 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
184 | * Sets the named icon for @notification to @icon_name. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
185 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
186 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
187 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
188 | void purple_notification_set_icon_name(PurpleNotification *notification, const gchar *icon_name); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
189 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
190 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
191 | * purple_notification_get_read: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
192 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
193 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
194 | * Gets whether or not @notification has been read. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
195 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
196 | * Returns: %TRUE if @notification has been read, %FALSE otherwise. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
197 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
198 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
199 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
200 | gboolean purple_notification_get_read(PurpleNotification *notification); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
201 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
202 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
203 | * purple_notification_set_read: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
204 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
205 | * @read: Whether or not the notification has been read. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
206 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
207 | * Sets @notification's read state to @read. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
208 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
209 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
210 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
211 | void purple_notification_set_read(PurpleNotification *notification, gboolean read); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
212 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
213 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
214 | * purple_notification_get_interactive: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
215 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
216 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
217 | * Gets whether or not @notification can be interacted with. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
218 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
219 | * Returns: %TRUE if @notification can be interacted with, %FALSE otherwise. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
220 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
221 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
222 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
223 | gboolean purple_notification_get_interactive(PurpleNotification *notification); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
224 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
225 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
226 | * purple_notification_set_interactive: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
227 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
228 | * @interactive: Whether or not the notification can be interacted with. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
229 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
230 | * Sets @notification's interactive state to @interactive. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
231 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
232 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
233 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
234 | void purple_notification_set_interactive(PurpleNotification *notification, gboolean interactive); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
235 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
236 | /** |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
237 | * purple_notification_get_data: |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
238 | * @notification: The instance. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
239 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
240 | * Gets the data that @notification was created with. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
241 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
242 | * Returns: (transfer none): The data for @notification. |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
243 | * |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
244 | * Since: 3.0.0 |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
245 | */ |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
246 | gpointer purple_notification_get_data(PurpleNotification *notification); |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
247 | |
|
41438
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
248 | /** |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
249 | * purple_notification_compare: |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
250 | * @a: The first notification to compare. |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
251 | * @b: The second notification to compare. |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
252 | * |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
253 | * A comparison function for PurpleNotification that is suitable as a |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
254 | * GCompareFunc. |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
255 | * |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
256 | * Returns: -1 if @a's created timestamp occurred before @b, 0 if they were |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
257 | * created at the same time, or 1 if @b was created before @a. |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
258 | * |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
259 | * Since: 3.0.0 |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
260 | */ |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
261 | gint purple_notification_compare(gconstpointer a, gconstpointer b); |
|
86beaec0fa35
Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents:
41433
diff
changeset
|
262 | |
|
41433
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
263 | G_END_DECLS |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
264 | |
|
d563b345a096
Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
265 | #endif /* PURPLE_NOTIFICATION */ |