libpurple/purplenotificationconnectionerror.h

Tue, 15 Oct 2024 00:47:42 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 15 Oct 2024 00:47:42 -0500
changeset 43011
ce3144e2bc33
parent 43008
d46e90e0757a
child 43176
04f562dc0ff2
permissions
-rw-r--r--

Port prefs to AdwSwitchRow

Now that we depend on Adwaita 1.4, we can flip the switch on using these (pun intended).

This also simplifies some extra tracking we needed to do for activations and focus, since the Adwaita widgets do that for us.

Testing Done:
Opened prefs, confirmed all the switches were there, and toggled them all without any warnings.

Also used the mnemonics to toggle the switches from the keyboard.

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

42985
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * any later version.
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * more details.
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License along with
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 # error "only <purple.h> may be included directly"
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #endif
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #ifndef PURPLE_NOTIFICATION_CONNECTION_ERROR_H
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 #define PURPLE_NOTIFICATION_CONNECTION_ERROR_H
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <glib.h>
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #include <glib-object.h>
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 #include "purplenotification.h"
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 #include "purpleversion.h"
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 G_BEGIN_DECLS
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 /**
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 * PurpleNotificationConnectionError:
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 *
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 * A [class@Notification] for connection errors on [class@Account].
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 *
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 * Since: 3.0
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 */
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 #define PURPLE_TYPE_NOTIFICATION_CONNECTION_ERROR (purple_notification_connection_error_get_type())
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 PURPLE_AVAILABLE_IN_3_0
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 G_DECLARE_FINAL_TYPE(PurpleNotificationConnectionError,
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 purple_notification_connection_error, PURPLE,
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 NOTIFICATION_CONNECTION_ERROR, PurpleNotification)
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 #include "purpleaccount.h"
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 /**
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 * purple_notification_connection_error_new:
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 * @id: (nullable): An identifier for this notification.
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 * @account: The account.
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 *
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 * Creates a new [class@Notification] for a connection error on @account.
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 *
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 * Returns: (nullable): The new notification.
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 *
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 * Since: 3.0
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 */
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 PURPLE_AVAILABLE_IN_3_0
43004
06521648500e Update Purple.Account:error to be a GLib.Error
Gary Kramlich <grim@reaperworld.com>
parents: 42985
diff changeset
67 PurpleNotification *purple_notification_connection_error_new(const char *id, PurpleAccount *account);
42985
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 G_END_DECLS
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70
66ad6fc11879 Create Purple.NotificationConnectionError
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 #endif /* PURPLE_NOTIFICATION_CONNECTION_ERROR_H */

mercurial