1 /*
2  * e-source-proxy.h
3  *
4  * This library is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library. If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17 
18 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
19 #define "Only <libedataserver/libedataserver.h> should be included directly."
20 #endif
21 
22 #ifndef E_SOURCE_PROXY_H
23 #define E_SOURCE_PROXY_H
24 
25 #include <libedataserver/e-source-enums.h>
26 #include <libedataserver/e-source-extension.h>
27 
28 /* Standard GObject macros */
29 #define E_TYPE_SOURCE_PROXY \
30 	(e_source_proxy_get_type ())
31 #define E_SOURCE_PROXY(obj) \
32 	(G_TYPE_CHECK_INSTANCE_CAST \
33 	((obj), E_TYPE_SOURCE_PROXY, ESourceProxy))
34 #define E_SOURCE_PROXY_CLASS(cls) \
35 	(G_TYPE_CHECK_CLASS_CAST \
36 	((cls), E_TYPE_SOURCE_PROXY, ESourceProxyClass))
37 #define E_IS_SOURCE_PROXY(obj) \
38 	(G_TYPE_CHECK_INSTANCE_TYPE \
39 	((obj), E_TYPE_SOURCE_PROXY))
40 #define E_IS_SOURCE_PROXY_CLASS(cls) \
41 	(G_TYPE_CHECK_CLASS_TYPE \
42 	((cls), E_TYPE_SOURCE_PROXY))
43 #define E_SOURCE_PROXY_GET_CLASS(obj) \
44 	(G_TYPE_INSTANCE_GET_CLASS \
45 	((obj), E_TYPE_SOURCE_PROXY, ESourceProxyClass))
46 
47 /**
48  * E_SOURCE_EXTENSION_PROXY:
49  *
50  * Pass this extension name to e_source_get_extension() to access
51  * #ESourceProxy.  This is also used as a group name in key files.
52  *
53  * Since: 3.12
54  **/
55 #define E_SOURCE_EXTENSION_PROXY "Proxy"
56 
57 G_BEGIN_DECLS
58 
59 typedef struct _ESourceProxy ESourceProxy;
60 typedef struct _ESourceProxyClass ESourceProxyClass;
61 typedef struct _ESourceProxyPrivate ESourceProxyPrivate;
62 
63 /**
64  * ESourceProxy:
65  *
66  * Contains only private data that should be read and manipulated using the
67  * functions below.
68  *
69  * Since: 3.12
70  **/
71 struct _ESourceProxy {
72 	/*< private >*/
73 	ESourceExtension parent;
74 	ESourceProxyPrivate *priv;
75 };
76 
77 struct _ESourceProxyClass {
78 	ESourceExtensionClass parent_class;
79 };
80 
81 GType		e_source_proxy_get_type		(void) G_GNUC_CONST;
82 EProxyMethod	e_source_proxy_get_method	(ESourceProxy *extension);
83 void		e_source_proxy_set_method	(ESourceProxy *extension,
84 						 EProxyMethod method);
85 const gchar *	e_source_proxy_get_autoconfig_url
86 						(ESourceProxy *extension);
87 gchar *		e_source_proxy_dup_autoconfig_url
88 						(ESourceProxy *extension);
89 void		e_source_proxy_set_autoconfig_url
90 						(ESourceProxy *extension,
91 						 const gchar *autoconfig_url);
92 const gchar * const *
93 		e_source_proxy_get_ignore_hosts	(ESourceProxy *extension);
94 gchar **	e_source_proxy_dup_ignore_hosts	(ESourceProxy *extension);
95 void		e_source_proxy_set_ignore_hosts	(ESourceProxy *extension,
96 						 const gchar * const *ignore_hosts);
97 const gchar *	e_source_proxy_get_ftp_host	(ESourceProxy *extension);
98 gchar *		e_source_proxy_dup_ftp_host	(ESourceProxy *extension);
99 void		e_source_proxy_set_ftp_host	(ESourceProxy *extension,
100 						 const gchar *ftp_host);
101 guint16		e_source_proxy_get_ftp_port	(ESourceProxy *extension);
102 void		e_source_proxy_set_ftp_port	(ESourceProxy *extension,
103 						 guint16 ftp_port);
104 const gchar *	e_source_proxy_get_http_host	(ESourceProxy *extension);
105 gchar *		e_source_proxy_dup_http_host	(ESourceProxy *extension);
106 void		e_source_proxy_set_http_host	(ESourceProxy *extension,
107 						 const gchar *http_host);
108 guint16		e_source_proxy_get_http_port	(ESourceProxy *extension);
109 void		e_source_proxy_set_http_port	(ESourceProxy *extension,
110 						 guint16 http_port);
111 gboolean	e_source_proxy_get_http_use_auth
112 						(ESourceProxy *extension);
113 void		e_source_proxy_set_http_use_auth
114 						(ESourceProxy *extension,
115 						 gboolean http_use_auth);
116 const gchar *	e_source_proxy_get_http_auth_user
117 						(ESourceProxy *extension);
118 gchar *		e_source_proxy_dup_http_auth_user
119 						(ESourceProxy *extension);
120 void		e_source_proxy_set_http_auth_user
121 						(ESourceProxy *extension,
122 						 const gchar *http_auth_user);
123 const gchar *	e_source_proxy_get_http_auth_password
124 						(ESourceProxy *extension);
125 gchar *		e_source_proxy_dup_http_auth_password
126 						(ESourceProxy *extension);
127 void		e_source_proxy_set_http_auth_password
128 						(ESourceProxy *extension,
129 						 const gchar *http_auth_password);
130 const gchar *	e_source_proxy_get_https_host	(ESourceProxy *extension);
131 gchar *		e_source_proxy_dup_https_host	(ESourceProxy *extension);
132 void		e_source_proxy_set_https_host	(ESourceProxy *extension,
133 						 const gchar *https_host);
134 guint16		e_source_proxy_get_https_port	(ESourceProxy *extension);
135 void		e_source_proxy_set_https_port	(ESourceProxy *extension,
136 						 guint16 https_port);
137 const gchar *	e_source_proxy_get_socks_host	(ESourceProxy *extension);
138 gchar *		e_source_proxy_dup_socks_host	(ESourceProxy *extension);
139 void		e_source_proxy_set_socks_host	(ESourceProxy *extension,
140 						 const gchar *socks_host);
141 guint16		e_source_proxy_get_socks_port	(ESourceProxy *extension);
142 void		e_source_proxy_set_socks_port	(ESourceProxy *extension,
143 						 guint16 socks_port);
144 
145 gchar **	e_source_proxy_lookup_sync	(ESource *source,
146 						 const gchar *uri,
147 						 GCancellable *cancellable,
148 						 GError **error);
149 void		e_source_proxy_lookup		(ESource *source,
150 						 const gchar *uri,
151 						 GCancellable *cancellable,
152 						 GAsyncReadyCallback callback,
153 						 gpointer user_data);
154 gchar **	e_source_proxy_lookup_finish	(ESource *source,
155 						 GAsyncResult *result,
156 						 GError **error);
157 
158 G_END_DECLS
159 
160 #endif /* E_SOURCE_PROXY_H */
161 
162