1/* GIO - GLib Input, Output and Streaming Library
2 *
3 * Copyright (C) 2011 Collabora, Ltd.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 *
18 * Author: Stef Walter <stefw@collabora.co.uk>
19 */
20
21#ifndef __G_TLS_INTERACTION_H__
22#define __G_TLS_INTERACTION_H__
23
24#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25#error "Only <gio/gio.h> can be included directly."
26#endif
27
28#include <gio/giotypes.h>
29
30G_BEGIN_DECLS
31
32#define G_TYPE_TLS_INTERACTION (g_tls_interaction_get_type ())
33#define G_TLS_INTERACTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_TLS_INTERACTION, GTlsInteraction))
34#define G_TLS_INTERACTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_TLS_INTERACTION, GTlsInteractionClass))
35#define G_IS_TLS_INTERACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_TLS_INTERACTION))
36#define G_IS_TLS_INTERACTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_TLS_INTERACTION))
37#define G_TLS_INTERACTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_TLS_INTERACTION, GTlsInteractionClass))
38
39typedef struct _GTlsInteractionClass GTlsInteractionClass;
40typedef struct _GTlsInteractionPrivate GTlsInteractionPrivate;
41
42struct _GTlsInteraction
43{
44 /*< private >*/
45 GObject parent_instance;
46 GTlsInteractionPrivate *priv;
47};
48
49struct _GTlsInteractionClass
50{
51 /*< private >*/
52 GObjectClass parent_class;
53
54 /*< public >*/
55 GTlsInteractionResult (* ask_password) (GTlsInteraction *interaction,
56 GTlsPassword *password,
57 GCancellable *cancellable,
58 GError **error);
59
60 void (* ask_password_async) (GTlsInteraction *interaction,
61 GTlsPassword *password,
62 GCancellable *cancellable,
63 GAsyncReadyCallback callback,
64 gpointer user_data);
65
66 GTlsInteractionResult (* ask_password_finish) (GTlsInteraction *interaction,
67 GAsyncResult *result,
68 GError **error);
69
70 GTlsInteractionResult (* request_certificate) (GTlsInteraction *interaction,
71 GTlsConnection *connection,
72 GTlsCertificateRequestFlags flags,
73 GCancellable *cancellable,
74 GError **error);
75
76 void (* request_certificate_async) (GTlsInteraction *interaction,
77 GTlsConnection *connection,
78 GTlsCertificateRequestFlags flags,
79 GCancellable *cancellable,
80 GAsyncReadyCallback callback,
81 gpointer user_data);
82
83 GTlsInteractionResult (* request_certificate_finish) (GTlsInteraction *interaction,
84 GAsyncResult *result,
85 GError **error);
86
87 /*< private >*/
88 /* Padding for future expansion */
89 gpointer padding[21];
90};
91
92GLIB_AVAILABLE_IN_ALL
93GType g_tls_interaction_get_type (void) G_GNUC_CONST;
94
95GLIB_AVAILABLE_IN_ALL
96GTlsInteractionResult g_tls_interaction_invoke_ask_password (GTlsInteraction *interaction,
97 GTlsPassword *password,
98 GCancellable *cancellable,
99 GError **error);
100
101GLIB_AVAILABLE_IN_ALL
102GTlsInteractionResult g_tls_interaction_ask_password (GTlsInteraction *interaction,
103 GTlsPassword *password,
104 GCancellable *cancellable,
105 GError **error);
106
107GLIB_AVAILABLE_IN_ALL
108void g_tls_interaction_ask_password_async (GTlsInteraction *interaction,
109 GTlsPassword *password,
110 GCancellable *cancellable,
111 GAsyncReadyCallback callback,
112 gpointer user_data);
113
114GLIB_AVAILABLE_IN_ALL
115GTlsInteractionResult g_tls_interaction_ask_password_finish (GTlsInteraction *interaction,
116 GAsyncResult *result,
117 GError **error);
118
119GLIB_AVAILABLE_IN_2_40
120GTlsInteractionResult g_tls_interaction_invoke_request_certificate (GTlsInteraction *interaction,
121 GTlsConnection *connection,
122 GTlsCertificateRequestFlags flags,
123 GCancellable *cancellable,
124 GError **error);
125
126GLIB_AVAILABLE_IN_2_40
127GTlsInteractionResult g_tls_interaction_request_certificate (GTlsInteraction *interaction,
128 GTlsConnection *connection,
129 GTlsCertificateRequestFlags flags,
130 GCancellable *cancellable,
131 GError **error);
132
133GLIB_AVAILABLE_IN_2_40
134void g_tls_interaction_request_certificate_async (GTlsInteraction *interaction,
135 GTlsConnection *connection,
136 GTlsCertificateRequestFlags flags,
137 GCancellable *cancellable,
138 GAsyncReadyCallback callback,
139 gpointer user_data);
140
141GLIB_AVAILABLE_IN_2_40
142GTlsInteractionResult g_tls_interaction_request_certificate_finish (GTlsInteraction *interaction,
143 GAsyncResult *result,
144 GError **error);
145
146G_END_DECLS
147
148#endif /* __G_TLS_INTERACTION_H__ */
149