libpurple/purplenotificationmanager.h

Thu, 25 Aug 2022 22:45:58 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Thu, 25 Aug 2022 22:45:58 -0500
branch
gtk4
changeset 41596
2f0fec76cfbc
parent 41511
2036d450fd18
child 41817
91f9ce89468b
permissions
-rw-r--r--

Handle delete event in more dialogs (probably all, but can't be too sure.)

Testing Done:
Compile only.

Reviewed at https://reviews.imfreedom.org/r/1652/

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 program is free software; you can redistribute it and/or modify
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * (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 program 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
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * GNU 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 General Public License
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * along with this program; 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_MANAGER_H
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #define PURPLE_NOTIFICATION_MANAGER_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 #include <purplenotification.h>
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 G_BEGIN_DECLS
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 #define PURPLE_TYPE_NOTIFICATION_MANAGER (purple_notification_manager_get_type())
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 G_DECLARE_FINAL_TYPE(PurpleNotificationManager, purple_notification_manager,
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 PURPLE, NOTIFICATION_MANAGER, GObject)
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 /**
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 * PurpleNotificationManager:
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 *
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 * Purple Notification Manager manages all notifications between protocols and
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 * plugins and how the user interface interacts with them.
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 *
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 * Since: 3.0.0
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 */
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 /**
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 * purple_notification_manager_get_default:
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 * Gets the default [class@NotificationManager] instance.
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 * Returns: (transfer none): The default instance.
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 PurpleNotificationManager *purple_notification_manager_get_default(void);
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 /**
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 * purple_notification_manager_add:
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 * @manager: The instance.
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 * @notification: (transfer full): The [class@Notification] to add.
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 *
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 * Adds @notification into @manager.
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 *
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 * Since: 3.0.0
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 */
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 void purple_notification_manager_add(PurpleNotificationManager *manager, PurpleNotification *notification);
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 /**
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 * purple_notification_manager_remove:
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 * @manager: The instance.
41438
86beaec0fa35 Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents: 41433
diff changeset
72 * @notification: The notification to remove.
41433
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 * Removes @notification from @manager.
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 */
41438
86beaec0fa35 Create and add notifications for account errors.
Gary Kramlich <grim@reaperworld.com>
parents: 41433
diff changeset
78 void purple_notification_manager_remove(PurpleNotificationManager *manager, PurpleNotification *notification);
41433
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 /**
41511
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
81 * purple_notification_manager_remove_with_account:
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
82 * @manager: The instance.
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
83 * @account: The [class@Account] whose notifications to remove.
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
84 *
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
85 * Removes all notifications with @account from @manager.
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
86 *
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
87 * Since: 3.0.0
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
88 */
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
89 void purple_notification_manager_remove_with_account(PurpleNotificationManager *manager, PurpleAccount *account);
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
90
2036d450fd18 Add purple_notification_manager_remove_with_account.
Gary Kramlich <grim@reaperworld.com>
parents: 41441
diff changeset
91 /**
41433
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 * purple_notification_manager_get_unread_count:
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 * @manager: The instance.
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 *
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 * Gets the number of currently unread notifications.
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 *
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 * Returns: The number of unread notifications.
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 *
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 * Since: 3.0.0
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 */
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 guint purple_notification_manager_get_unread_count(PurpleNotificationManager *manager);
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102
41441
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
103 /**
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
104 * purple_notification_manager_get_model:
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
105 * @manager: The instance.
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
106 *
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
107 * Gets a [iface@Gio.ListModel] of all the [class@Notification]'s in
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
108 * @manager.
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
109 *
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
110 * Returns: (transfer full): The model.
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
111 *
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
112 * Since: 3.0.0
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
113 */
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
114 GListModel *purple_notification_manager_get_model(PurpleNotificationManager *manager);
e114ed471a1e Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents: 41438
diff changeset
115
41433
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 G_END_DECLS
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117
d563b345a096 Phase 1 of the Notifications API
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 #endif /* PURPLE_NOTIFICATION_MANAGER_H */

mercurial