libpurple/proxy.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 42612
d905313bc732
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/

42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
1 /*
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
2 * Purple - Internet Messaging Library
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
1
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
8046
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 6720
diff changeset
7 * source distribution.
1
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
12 * any later version.
1
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
17 * more details.
1
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
19 * You should have received a copy of the GNU General Public License along with
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42557
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
1
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
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
40474
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
23 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
24 # error "only <purple.h> may be included directly"
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
25 #endif
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
26
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39386
diff changeset
27 #ifndef PURPLE_PROXY_H
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39386
diff changeset
28 #define PURPLE_PROXY_H
35440
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
29
2090
bab8b7e309db [gaim-migrate @ 2100]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 1881
diff changeset
30 #include <glib.h>
37532
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
31 #include <gio/gio.h>
42344
c51d37734155 Rename account.[ch] to purpleaccount.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 42038
diff changeset
32
c51d37734155 Rename account.[ch] to purpleaccount.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 42038
diff changeset
33 #include "purpleaccount.h"
41318
56092ffeae95 Move PurpleProxyInfo from a boxed type to a GObject
Gary Kramlich <grim@reaperworld.com>
parents: 41201
diff changeset
34 #include "purpleproxyinfo.h"
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42344
diff changeset
35 #include "purpleversion.h"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
36
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32604
diff changeset
37 G_BEGIN_DECLS
5944
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
38
5681
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
39 /**************************************************************************/
35472
474e26199560 Removed @name
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
40 /* Global Proxy API */
5681
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
41 /**************************************************************************/
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
42
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
43 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
44 * purple_global_proxy_get_info:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
45 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
46 * Returns purple's global proxy information.
5681
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
47 *
41753
316c1207f787 Fix various small documentation errors
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41318
diff changeset
48 * Returns: (transfer none): The global proxy information.
42421
2bb4c44ee967 Make sure all of the proxy API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42394
diff changeset
49 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
50 * Since: 2.0
5681
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
51 */
42421
2bb4c44ee967 Make sure all of the proxy API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42394
diff changeset
52 PURPLE_AVAILABLE_IN_ALL
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
53 PurpleProxyInfo *purple_global_proxy_get_info(void);
5681
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
54
25858
ec60fbe5a4ab Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents: 23449
diff changeset
55 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
56 * purple_global_proxy_set_info:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
57 * @info: The proxy information.
25858
ec60fbe5a4ab Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents: 23449
diff changeset
58 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
59 * Set purple's global proxy information.
42394
b3bc5ad00646 Export symbols and add Since tags for 2.6 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42391
diff changeset
60 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
61 * Since: 2.6
25858
ec60fbe5a4ab Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents: 23449
diff changeset
62 */
42394
b3bc5ad00646 Export symbols and add Since tags for 2.6 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42391
diff changeset
63 PURPLE_AVAILABLE_IN_2_6
25858
ec60fbe5a4ab Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents: 23449
diff changeset
64 void purple_global_proxy_set_info(PurpleProxyInfo *info);
ec60fbe5a4ab Patch from fqueze to add API for setting the global proxy settings. Fixes #7610.
Daniel Atallah <datallah@pidgin.im>
parents: 23449
diff changeset
65
5681
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
66 /**************************************************************************/
35472
474e26199560 Removed @name
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
67 /* Proxy API */
5681
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
68 /**************************************************************************/
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
69
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
70 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
71 * purple_proxy_init:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
72 *
5681
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
73 * Initializes the proxy subsystem.
42421
2bb4c44ee967 Make sure all of the proxy API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42394
diff changeset
74 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
75 * Since: 2.0
5681
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
76 */
42421
2bb4c44ee967 Make sure all of the proxy API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42394
diff changeset
77 PURPLE_AVAILABLE_IN_ALL
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
78 void purple_proxy_init(void);
5681
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
79
514fbc5374dc [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5572
diff changeset
80 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
81 * purple_proxy_uninit:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
82 *
14151
34427f138b1f [gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents: 13515
diff changeset
83 * Uninitializes the proxy subsystem.
42421
2bb4c44ee967 Make sure all of the proxy API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42394
diff changeset
84 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
85 * Since: 2.0
14151
34427f138b1f [gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents: 13515
diff changeset
86 */
42421
2bb4c44ee967 Make sure all of the proxy API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42394
diff changeset
87 PURPLE_AVAILABLE_IN_ALL
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
88 void purple_proxy_uninit(void);
14151
34427f138b1f [gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents: 13515
diff changeset
89
34427f138b1f [gaim-migrate @ 16712]
Mark Doliner <markdoliner@pidgin.im>
parents: 13515
diff changeset
90 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
91 * purple_proxy_get_setup:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
92 * @account: The account for which the configuration is needed.
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13314
diff changeset
93 *
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13314
diff changeset
94 * Returns configuration of a proxy.
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13314
diff changeset
95 *
41753
316c1207f787 Fix various small documentation errors
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41318
diff changeset
96 * Returns: (transfer none): The configuration of a proxy.
42421
2bb4c44ee967 Make sure all of the proxy API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42394
diff changeset
97 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
98 * Since: 2.0
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13314
diff changeset
99 */
42421
2bb4c44ee967 Make sure all of the proxy API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42394
diff changeset
100 PURPLE_AVAILABLE_IN_ALL
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
101 PurpleProxyInfo *purple_proxy_get_setup(PurpleAccount *account);
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13314
diff changeset
102
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13314
diff changeset
103 /**
37532
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
104 * purple_proxy_get_proxy_resolver:
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
105 * @account: The account for which to get the proxy resolver.
37965
b67fb3fb5f85 proxy: Add GError argument to purple_proxy_get_proxy_resolver()
Mike Ruprecht <cmaiku@gmail.com>
parents: 37536
diff changeset
106 * @error: Return location for a GError, or NULL.
37532
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
107 *
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
108 * Returns a #GProxyResolver capable of resolving which proxy
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
109 * to use for this account, if any. This object can be given to a
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
110 * #GSocketClient for automatic proxy handling or can be used
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
111 * directly if desired.
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
112 *
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
113 * Returns: (transfer full): NULL if there was an error with the
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
114 * account's (or system) proxy settings, or a reference to
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
115 * a #GProxyResolver on success.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42344
diff changeset
116 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
117 * Since: 3.0
37532
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
118 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42344
diff changeset
119 PURPLE_AVAILABLE_IN_3_0
37965
b67fb3fb5f85 proxy: Add GError argument to purple_proxy_get_proxy_resolver()
Mike Ruprecht <cmaiku@gmail.com>
parents: 37536
diff changeset
120 GProxyResolver *purple_proxy_get_proxy_resolver(PurpleAccount *account,
b67fb3fb5f85 proxy: Add GError argument to purple_proxy_get_proxy_resolver()
Mike Ruprecht <cmaiku@gmail.com>
parents: 37536
diff changeset
121 GError **error);
37532
5aaf2d93e7e3 Implement function to get a GProxyResolver with an account's settings
Mike Ruprecht <cmaiku@gmail.com>
parents: 37131
diff changeset
122
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32604
diff changeset
123 G_END_DECLS
5944
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
124
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39386
diff changeset
125 #endif /* PURPLE_PROXY_H */

mercurial