finch/gntrequest.h

Mon, 22 Aug 2022 22:05:55 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 22 Aug 2022 22:05:55 -0500
changeset 41514
a96768bacb59
parent 41123
089c8a3a9ff4
child 42128
118067ca0367
permissions
-rw-r--r--

Create PurpleAuthorizationRequest and use it for notifications.

This replaces the old internal representation of authorization requests as well
as the UI's implementation of their own objects. Everything is now controlled
via PurpleAuthorizationRequest and the UI's display the notification for
interaction.

Testing Done:
Verified the notification and actions work in both finch and pidgin.

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

39887
9c8f874c74a0 Clean up all of the license headers
Gary Kramlich <grim@reaperworld.com>
parents: 39885
diff changeset
1 /*
9c8f874c74a0 Clean up all of the license headers
Gary Kramlich <grim@reaperworld.com>
parents: 39885
diff changeset
2 * finch
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
3 *
15931
716b5fac1895 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents: 15906
diff changeset
4 * Finch is the legal property of its developers, whose names are too numerous
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
6 * source distribution.
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
7 *
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
8 * This program is free software; you can redistribute it and/or modify
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
9 * it under the terms of the GNU General Public License as published by
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
11 * (at your option) any later version.
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
12 *
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
13 * This program is distributed in the hope that it will be useful,
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
16 * GNU General Public License for more details.
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
17 *
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
18 * You should have received a copy of the GNU General Public License
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
19 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 16383
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
21 */
35487
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35486
diff changeset
22
40508
2ebcb8eb5c01 create a global header for finch
Gary Kramlich <grim@reaperworld.com>
parents: 40359
diff changeset
23 #if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION)
2ebcb8eb5c01 create a global header for finch
Gary Kramlich <grim@reaperworld.com>
parents: 40359
diff changeset
24 # error "only <finch.h> may be included directly"
2ebcb8eb5c01 create a global header for finch
Gary Kramlich <grim@reaperworld.com>
parents: 40359
diff changeset
25 #endif
2ebcb8eb5c01 create a global header for finch
Gary Kramlich <grim@reaperworld.com>
parents: 40359
diff changeset
26
39885
b1b266896ec1 Fix the header guards for finch
Gary Kramlich <grim@reaperworld.com>
parents: 39881
diff changeset
27 #ifndef FINCH_REQUEST_H
b1b266896ec1 Fix the header guards for finch
Gary Kramlich <grim@reaperworld.com>
parents: 39881
diff changeset
28 #define FINCH_REQUEST_H
39881
746ceb1d6966 A few random finch doc cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 37100
diff changeset
29
40359
ca141ea93b83 Make all of finch use purple.h
Gary Kramlich <grim@reaperworld.com>
parents: 39887
diff changeset
30 #include <purple.h>
ca141ea93b83 Make all of finch use purple.h
Gary Kramlich <grim@reaperworld.com>
parents: 39887
diff changeset
31
22135
f593e34a0e8e Add a function to get a widget for a request field.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20147
diff changeset
32 #include "gnt.h"
14045
12b8c2bfd3fb [gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
33
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
34 /**********************************************************************
35472
474e26199560 Removed @name
Ankit Vani <a@nevitus.org>
parents: 35449
diff changeset
35 * GNT Request API
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
36 **********************************************************************/
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
37
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
38 /**
35410
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
39 * finch_request_get_ui_ops:
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
40 *
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
41 * Get the ui-functions.
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
42 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32438
diff changeset
43 * Returns: The PurpleRequestUiOps structure populated with the appropriate functions.
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
44 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15878
diff changeset
45 PurpleRequestUiOps *finch_request_get_ui_ops(void);
14260
a21577fbb4d2 [gaim-migrate @ 16870]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14045
diff changeset
46
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
47 /**
35410
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
48 * finch_request_init:
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
49 *
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
50 * Perform necessary initializations.
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
51 */
15878
f52832b611fe renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents: 14620
diff changeset
52 void finch_request_init(void);
14045
12b8c2bfd3fb [gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
53
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
54 /**
35410
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
55 * finch_request_uninit:
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
56 *
14620
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
57 * Perform necessary uninitializations.
90d599495d65 [gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14260
diff changeset
58 */
15878
f52832b611fe renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents: 14620
diff changeset
59 void finch_request_uninit(void);
14045
12b8c2bfd3fb [gaim-migrate @ 16552]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
60
16383
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16255
diff changeset
61 /**
35410
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
62 * finch_request_save_in_prefs:
39881
746ceb1d6966 A few random finch doc cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 37100
diff changeset
63 * @data: No longer used, set to %NULL.
746ceb1d6966 A few random finch doc cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 37100
diff changeset
64 * @fields: The #PurpleRequestFields to save.
35410
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
65 *
16383
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16255
diff changeset
66 * Save the request fields in preferences where the id attribute of each field is the
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16255
diff changeset
67 * id of a preference.
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16255
diff changeset
68 */
39881
746ceb1d6966 A few random finch doc cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 37100
diff changeset
69 void finch_request_save_in_prefs(gpointer data, PurpleRequestFields *fields);
16383
af8d75120347 Implement the plugin-pref ui using the request api. The preferences for the core plugins can now be modified from Finch. And no new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16255
diff changeset
70
22135
f593e34a0e8e Add a function to get a widget for a request field.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20147
diff changeset
71 /**
35410
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
72 * finch_request_field_get_widget:
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
73 * @field: The request field.
22135
f593e34a0e8e Add a function to get a widget for a request field.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20147
diff changeset
74 *
35410
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
75 * Create a widget field for a request-field.
22135
f593e34a0e8e Add a function to get a widget for a request field.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20147
diff changeset
76 *
35496
a28ece02876c Fix some annotation warnings in finch
Ankit Vani <a@nevitus.org>
parents: 35487
diff changeset
77 * Returns: (transfer full): A GntWidget for the request field.
22135
f593e34a0e8e Add a function to get a widget for a request field.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20147
diff changeset
78 */
f593e34a0e8e Add a function to get a widget for a request field.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20147
diff changeset
79 GntWidget *finch_request_field_get_widget(PurpleRequestField *field);
35410
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
80
39885
b1b266896ec1 Fix the header guards for finch
Gary Kramlich <grim@reaperworld.com>
parents: 39881
diff changeset
81 #endif /* FINCH_REQUEST_H */
b1b266896ec1 Fix the header guards for finch
Gary Kramlich <grim@reaperworld.com>
parents: 39881
diff changeset
82

mercurial