libpurple/purplenotificationauthorizationrequest.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 42929
e9cc6fc1f717
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/

42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * any later version.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * more details.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License along with
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 # error "only <purple.h> may be included directly"
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #endif
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
27 #ifndef PURPLE_NOTIFICATION_AUTHORIZATION_REQUEST_H
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
28 #define PURPLE_NOTIFICATION_AUTHORIZATION_REQUEST_H
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <glib.h>
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #include <glib-object.h>
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 #include "purpleauthorizationrequest.h"
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 #include "purplenotification.h"
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 #include "purpleversion.h"
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 G_BEGIN_DECLS
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 /**
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
40 * PurpleNotificationAuthorizationRequest:
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 * A [class@Notification] for [class@AuthorizationRequest]s.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 * Since: 3.0
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 */
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
47 #define PURPLE_TYPE_NOTIFICATION_AUTHORIZATION_REQUEST (purple_notification_authorization_request_get_type())
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 PURPLE_AVAILABLE_IN_3_0
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
50 G_DECLARE_FINAL_TYPE(PurpleNotificationAuthorizationRequest,
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
51 purple_notification_authorization_request,
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
52 PURPLE, NOTIFICATION_AUTHORIZATION_REQUEST,
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 PurpleNotification)
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 /**
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
56 * purple_notification_authorization_request_new:
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
57 * @id: (nullable): An identifier for the notification.
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 * @request: The authorization request instance.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 * Creates a new [class@Notification] for @request.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 *
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
62 * Since [class@AuthorizationRequest] has a [class@Account],
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
63 * [property@Notification:account] will automatically be set to that.
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
64 *
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 * Returns: The new notification.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 * Since: 3.0
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 */
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 PURPLE_AVAILABLE_IN_3_0
42929
e9cc6fc1f717 Update Purple.NotificationAuthorizationRequest to take an id and auto populate account
Gary Kramlich <grim@reaperworld.com>
parents: 42835
diff changeset
70 PurpleNotification *purple_notification_authorization_request_new(const char *id, PurpleAuthorizationRequest *request);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 /**
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
73 * purple_notification_authorization_request_get_request:
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 * @notification: The instance.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 * Gets the [class@AuthorizationRequest] for @notification.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 * Returns: (transfer none): The authorization request.
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 *
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 * Since: 3.0
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 */
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 PURPLE_AVAILABLE_IN_3_0
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
83 PurpleAuthorizationRequest *purple_notification_authorization_request_get_request(PurpleNotificationAuthorizationRequest *notification);
42651
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 G_END_DECLS
5ad29b5bf1c7 Create PurpleAuthorizationRequestNotification
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86
42835
3144fbeba349 Rename AuthorizationRequestNotification to NotificationAuthorizationRequest
Gary Kramlich <grim@reaperworld.com>
parents: 42651
diff changeset
87 #endif /* PURPLE_NOTIFICATION_AUTHORIZATION_REQUEST_H */

mercurial