1/*
2 * Copyright (C) 2013 Samsung Electronics Inc. All rights reserved.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
21#error "Only <webkit2/webkit2.h> can be included directly."
22#endif
23
24#ifndef WebKitAuthenticationRequest_h
25#define WebKitAuthenticationRequest_h
26
27#include <gtk/gtk.h>
28#include <webkit2/WebKitCredential.h>
29#include <webkit2/WebKitDefines.h>
30
31G_BEGIN_DECLS
32
33#define WEBKIT_TYPE_AUTHENTICATION_REQUEST (webkit_authentication_request_get_type())
34#define WEBKIT_AUTHENTICATION_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_AUTHENTICATION_REQUEST, WebKitAuthenticationRequest))
35#define WEBKIT_AUTHENTICATION_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_AUTHENTICATION_REQUEST, WebKitAuthenticationRequestClass))
36#define WEBKIT_IS_AUTHENTICATION_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_AUTHENTICATION_REQUEST))
37#define WEBKIT_IS_AUTHENTICATION_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_AUTHENTICATION_REQUEST))
38#define WEBKIT_AUTHENTICATION_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_AUTHENTICATION_REQUEST, WebKitAuthenticationRequestClass))
39
40typedef struct _WebKitAuthenticationRequest WebKitAuthenticationRequest;
41typedef struct _WebKitAuthenticationRequestClass WebKitAuthenticationRequestClass;
42typedef struct _WebKitAuthenticationRequestPrivate WebKitAuthenticationRequestPrivate;
43
44struct _WebKitAuthenticationRequest {
45 GObject parent;
46
47 /*< private >*/
48 WebKitAuthenticationRequestPrivate *priv;
49};
50
51struct _WebKitAuthenticationRequestClass {
52 GObjectClass parent_class;
53
54 void (*_webkit_reserved0) (void);
55 void (*_webkit_reserved1) (void);
56 void (*_webkit_reserved2) (void);
57 void (*_webkit_reserved3) (void);
58};
59
60/**
61 * WebKitAuthenticationScheme:
62 * @WEBKIT_AUTHENTICATION_SCHEME_DEFAULT: The default authentication scheme of WebKit.
63 * @WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC: Basic authentication scheme as defined in RFC 2617.
64 * @WEBKIT_AUTHENTICATION_SCHEME_HTTP_DIGEST: Digest authentication scheme as defined in RFC 2617.
65 * @WEBKIT_AUTHENTICATION_SCHEME_HTML_FORM: HTML Form authentication.
66 * @WEBKIT_AUTHENTICATION_SCHEME_NTLM: NTLM Microsoft proprietary authentication scheme.
67 * @WEBKIT_AUTHENTICATION_SCHEME_NEGOTIATE: Negotiate (or SPNEGO) authentication scheme as defined in RFC 4559.
68 * @WEBKIT_AUTHENTICATION_SCHEME_CLIENT_CERTIFICATE_REQUESTED: Client Certificate Authentication (see RFC 2246).
69 * @WEBKIT_AUTHENTICATION_SCHEME_SERVER_TRUST_EVALUATION_REQUESTED: Server Trust Authentication.
70 * @WEBKIT_AUTHENTICATION_SCHEME_UNKNOWN: Authentication scheme unknown.
71 *
72 * Enum values representing the authentication scheme.
73 *
74 * Since: 2.2
75 */
76typedef enum {
77 WEBKIT_AUTHENTICATION_SCHEME_DEFAULT = 1,
78 WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC = 2,
79 WEBKIT_AUTHENTICATION_SCHEME_HTTP_DIGEST = 3,
80 WEBKIT_AUTHENTICATION_SCHEME_HTML_FORM = 4,
81 WEBKIT_AUTHENTICATION_SCHEME_NTLM = 5,
82 WEBKIT_AUTHENTICATION_SCHEME_NEGOTIATE = 6,
83 WEBKIT_AUTHENTICATION_SCHEME_CLIENT_CERTIFICATE_REQUESTED = 7,
84 WEBKIT_AUTHENTICATION_SCHEME_SERVER_TRUST_EVALUATION_REQUESTED = 8,
85 WEBKIT_AUTHENTICATION_SCHEME_UNKNOWN = 100,
86} WebKitAuthenticationScheme;
87
88
89WEBKIT_API GType
90webkit_authentication_request_get_type (void);
91
92WEBKIT_API gboolean
93webkit_authentication_request_can_save_credentials (WebKitAuthenticationRequest *request);
94
95WEBKIT_API WebKitCredential *
96webkit_authentication_request_get_proposed_credential (WebKitAuthenticationRequest *request);
97
98WEBKIT_API const gchar *
99webkit_authentication_request_get_host (WebKitAuthenticationRequest *request);
100
101WEBKIT_API guint
102webkit_authentication_request_get_port (WebKitAuthenticationRequest *request);
103
104WEBKIT_API const gchar *
105webkit_authentication_request_get_realm (WebKitAuthenticationRequest *request);
106
107WEBKIT_API WebKitAuthenticationScheme
108webkit_authentication_request_get_scheme (WebKitAuthenticationRequest *request);
109
110WEBKIT_API gboolean
111webkit_authentication_request_is_for_proxy (WebKitAuthenticationRequest *request);
112
113WEBKIT_API gboolean
114webkit_authentication_request_is_retry (WebKitAuthenticationRequest *request);
115
116WEBKIT_API void
117webkit_authentication_request_authenticate (WebKitAuthenticationRequest *request,
118 WebKitCredential *credential);
119
120WEBKIT_API void
121webkit_authentication_request_cancel (WebKitAuthenticationRequest *request);
122
123G_END_DECLS
124
125#endif
126