Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:58

0001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
0002 
0003 /* GIO - GLib Input, Output and Streaming Library
0004  *
0005  * Copyright (C) 2010 Collabora Ltd.
0006  *
0007  * SPDX-License-Identifier: LGPL-2.1-or-later
0008  *
0009  * This library is free software; you can redistribute it and/or
0010  * modify it under the terms of the GNU Lesser General Public
0011  * License as published by the Free Software Foundation; either
0012  * version 2.1 of the License, or (at your option) any later version.
0013  *
0014  * This library is distributed in the hope that it will be useful,
0015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017  * Lesser General Public License for more details.
0018  *
0019  * You should have received a copy of the GNU Lesser General
0020  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0021  *
0022  * Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
0023  */
0024 
0025 #ifndef __G_PROXY_H__
0026 #define __G_PROXY_H__
0027 
0028 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0029 #error "Only <gio/gio.h> can be included directly."
0030 #endif
0031 
0032 #include <gio/giotypes.h>
0033 
0034 G_BEGIN_DECLS
0035 
0036 #define G_TYPE_PROXY        (g_proxy_get_type ())
0037 #define G_PROXY(o)      (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY, GProxy))
0038 #define G_IS_PROXY(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY))
0039 #define G_PROXY_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_PROXY, GProxyInterface))
0040 
0041 /**
0042  * G_PROXY_EXTENSION_POINT_NAME:
0043  *
0044  * Extension point for proxy functionality.
0045  * See [Extending GIO][extending-gio].
0046  *
0047  * Since: 2.26
0048  */
0049 #define G_PROXY_EXTENSION_POINT_NAME "gio-proxy"
0050 
0051 typedef struct _GProxyInterface GProxyInterface;
0052 
0053 /**
0054  * GProxyInterface:
0055  * @g_iface: The parent interface.
0056  * @connect: Connect to proxy server and wrap (if required) the #connection
0057  *           to handle payload.
0058  * @connect_async: Same as connect() but asynchronous.
0059  * @connect_finish: Returns the result of connect_async()
0060  * @supports_hostname: Returns whether the proxy supports hostname lookups.
0061  *
0062  * Provides an interface for handling proxy connection and payload.
0063  *
0064  * Since: 2.26
0065  */
0066 struct _GProxyInterface
0067 {
0068   GTypeInterface g_iface;
0069 
0070   /* Virtual Table */
0071 
0072   GIOStream * (* connect)           (GProxy               *proxy,
0073                      GIOStream            *connection,
0074                      GProxyAddress        *proxy_address,
0075                      GCancellable         *cancellable,
0076                      GError              **error);
0077 
0078   void        (* connect_async)     (GProxy               *proxy,
0079                      GIOStream            *connection,
0080                      GProxyAddress    *proxy_address,
0081                      GCancellable         *cancellable,
0082                      GAsyncReadyCallback   callback,
0083                      gpointer              user_data);
0084 
0085   GIOStream * (* connect_finish)    (GProxy               *proxy,
0086                      GAsyncResult         *result,
0087                      GError              **error);
0088 
0089   gboolean    (* supports_hostname) (GProxy             *proxy);
0090 };
0091 
0092 GIO_AVAILABLE_IN_ALL
0093 GType      g_proxy_get_type                 (void) G_GNUC_CONST;
0094 
0095 GIO_AVAILABLE_IN_ALL
0096 GProxy    *g_proxy_get_default_for_protocol (const gchar *protocol);
0097 
0098 GIO_AVAILABLE_IN_ALL
0099 GIOStream *g_proxy_connect           (GProxy               *proxy,
0100                       GIOStream            *connection,
0101                       GProxyAddress        *proxy_address,
0102                       GCancellable         *cancellable,
0103                       GError              **error);
0104 
0105 GIO_AVAILABLE_IN_ALL
0106 void       g_proxy_connect_async     (GProxy               *proxy,
0107                       GIOStream            *connection,
0108                       GProxyAddress        *proxy_address,
0109                       GCancellable         *cancellable,
0110                       GAsyncReadyCallback   callback,
0111                       gpointer              user_data);
0112 
0113 GIO_AVAILABLE_IN_ALL
0114 GIOStream *g_proxy_connect_finish    (GProxy               *proxy,
0115                       GAsyncResult         *result,
0116                       GError              **error);
0117 
0118 GIO_AVAILABLE_IN_ALL
0119 gboolean   g_proxy_supports_hostname (GProxy               *proxy);
0120 
0121 G_END_DECLS
0122 
0123 #endif /* __G_PROXY_H__ */