More clearly define 'named menu' in the XML parser
[glib.git] / gio / gsocketclient.h
blob180bedd0e940773a865de74bcb4eb4712fbf5203
1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright © 2008, 2009 Codethink Limited
4 * Copyright © 2009 Red Hat, Inc
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; either version 2 of the licence or (at
9 * your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General
17 * Public License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 * Boston, MA 02111-1307, USA.
21 * Authors: Ryan Lortie <desrt@desrt.ca>
22 * Alexander Larsson <alexl@redhat.com>
25 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
26 #error "Only <gio/gio.h> can be included directly."
27 #endif
29 #ifndef __G_SOCKET_CLIENT_H__
30 #define __G_SOCKET_CLIENT_H__
32 #include <gio/giotypes.h>
34 G_BEGIN_DECLS
36 #define G_TYPE_SOCKET_CLIENT (g_socket_client_get_type ())
37 #define G_SOCKET_CLIENT(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
38 G_TYPE_SOCKET_CLIENT, GSocketClient))
39 #define G_SOCKET_CLIENT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
40 G_TYPE_SOCKET_CLIENT, GSocketClientClass))
41 #define G_IS_SOCKET_CLIENT(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
42 G_TYPE_SOCKET_CLIENT))
43 #define G_IS_SOCKET_CLIENT_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
44 G_TYPE_SOCKET_CLIENT))
45 #define G_SOCKET_CLIENT_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
46 G_TYPE_SOCKET_CLIENT, GSocketClientClass))
48 typedef struct _GSocketClientPrivate GSocketClientPrivate;
49 typedef struct _GSocketClientClass GSocketClientClass;
51 struct _GSocketClientClass
53 GObjectClass parent_class;
55 /* Padding for future expansion */
56 void (*_g_reserved1) (void);
57 void (*_g_reserved2) (void);
58 void (*_g_reserved3) (void);
59 void (*_g_reserved4) (void);
60 void (*_g_reserved5) (void);
63 struct _GSocketClient
65 GObject parent_instance;
66 GSocketClientPrivate *priv;
69 GType g_socket_client_get_type (void) G_GNUC_CONST;
71 GSocketClient *g_socket_client_new (void);
73 GSocketFamily g_socket_client_get_family (GSocketClient *client);
74 void g_socket_client_set_family (GSocketClient *client,
75 GSocketFamily family);
76 GSocketType g_socket_client_get_socket_type (GSocketClient *client);
77 void g_socket_client_set_socket_type (GSocketClient *client,
78 GSocketType type);
79 GSocketProtocol g_socket_client_get_protocol (GSocketClient *client);
80 void g_socket_client_set_protocol (GSocketClient *client,
81 GSocketProtocol protocol);
82 GSocketAddress *g_socket_client_get_local_address (GSocketClient *client);
83 void g_socket_client_set_local_address (GSocketClient *client,
84 GSocketAddress *address);
85 guint g_socket_client_get_timeout (GSocketClient *client);
86 void g_socket_client_set_timeout (GSocketClient *client,
87 guint timeout);
88 gboolean g_socket_client_get_enable_proxy (GSocketClient *client);
89 void g_socket_client_set_enable_proxy (GSocketClient *client,
90 gboolean enable);
92 gboolean g_socket_client_get_tls (GSocketClient *client);
93 void g_socket_client_set_tls (GSocketClient *client,
94 gboolean tls);
95 GTlsCertificateFlags g_socket_client_get_tls_validation_flags (GSocketClient *client);
96 void g_socket_client_set_tls_validation_flags (GSocketClient *client,
97 GTlsCertificateFlags flags);
99 GSocketConnection * g_socket_client_connect (GSocketClient *client,
100 GSocketConnectable *connectable,
101 GCancellable *cancellable,
102 GError **error);
103 GSocketConnection * g_socket_client_connect_to_host (GSocketClient *client,
104 const gchar *host_and_port,
105 guint16 default_port,
106 GCancellable *cancellable,
107 GError **error);
108 GSocketConnection * g_socket_client_connect_to_service (GSocketClient *client,
109 const gchar *domain,
110 const gchar *service,
111 GCancellable *cancellable,
112 GError **error);
113 GSocketConnection * g_socket_client_connect_to_uri (GSocketClient *client,
114 const gchar *uri,
115 guint16 default_port,
116 GCancellable *cancellable,
117 GError **error);
118 void g_socket_client_connect_async (GSocketClient *client,
119 GSocketConnectable *connectable,
120 GCancellable *cancellable,
121 GAsyncReadyCallback callback,
122 gpointer user_data);
123 GSocketConnection * g_socket_client_connect_finish (GSocketClient *client,
124 GAsyncResult *result,
125 GError **error);
126 void g_socket_client_connect_to_host_async (GSocketClient *client,
127 const gchar *host_and_port,
128 guint16 default_port,
129 GCancellable *cancellable,
130 GAsyncReadyCallback callback,
131 gpointer user_data);
132 GSocketConnection * g_socket_client_connect_to_host_finish (GSocketClient *client,
133 GAsyncResult *result,
134 GError **error);
136 void g_socket_client_connect_to_service_async (GSocketClient *client,
137 const gchar *domain,
138 const gchar *service,
139 GCancellable *cancellable,
140 GAsyncReadyCallback callback,
141 gpointer user_data);
142 GSocketConnection * g_socket_client_connect_to_service_finish (GSocketClient *client,
143 GAsyncResult *result,
144 GError **error);
145 void g_socket_client_connect_to_uri_async (GSocketClient *client,
146 const gchar *uri,
147 guint16 default_port,
148 GCancellable *cancellable,
149 GAsyncReadyCallback callback,
150 gpointer user_data);
151 GSocketConnection * g_socket_client_connect_to_uri_finish (GSocketClient *client,
152 GAsyncResult *result,
153 GError **error);
154 void g_socket_client_add_application_proxy (GSocketClient *client,
155 const gchar *protocol);
157 G_END_DECLS
159 #endif /* __G_SOCKET_CLIENT_H___ */