2
* Copyright (C) 2011 Igalia S.L.
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.
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.
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.
20
#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
21
#error "Only <webkit2/webkit2.h> can be included directly."
24
#ifndef WebKitWebContext_h
25
#define WebKitWebContext_h
27
#include <glib-object.h>
28
#include <webkit2/WebKitCookieManager.h>
29
#include <webkit2/WebKitDefines.h>
30
#include <webkit2/WebKitDownload.h>
31
#include <webkit2/WebKitFaviconDatabase.h>
32
#include <webkit2/WebKitSecurityManager.h>
33
#include <webkit2/WebKitURISchemeRequest.h>
37
#define WEBKIT_TYPE_WEB_CONTEXT (webkit_web_context_get_type())
38
#define WEBKIT_WEB_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_CONTEXT, WebKitWebContext))
39
#define WEBKIT_WEB_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_CONTEXT, WebKitWebContextClass))
40
#define WEBKIT_IS_WEB_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_CONTEXT))
41
#define WEBKIT_IS_WEB_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_CONTEXT))
42
#define WEBKIT_WEB_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_CONTEXT, WebKitWebContextClass))
46
* @WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER: Disable the cache completely, which
47
* substantially reduces memory usage. Useful for applications that only
48
* access a single local file, with no navigation to other pages. No remote
49
* resources will be cached.
50
* @WEBKIT_CACHE_MODEL_DOCUMENT_BROWSER: A cache model optimized for viewing
51
* a series of local files -- for example, a documentation viewer or a website
52
* designer. WebKit will cache a moderate number of resources.
53
* @WEBKIT_CACHE_MODEL_WEB_BROWSER: Improve document load speed substantially
54
* by caching a very large number of resources and previously viewed content.
56
* Enum values used for determining the #WebKitWebContext cache model.
59
WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER,
60
WEBKIT_CACHE_MODEL_WEB_BROWSER,
61
WEBKIT_CACHE_MODEL_DOCUMENT_BROWSER
65
* WebKitURISchemeRequestCallback:
66
* @request: the #WebKitURISchemeRequest
67
* @user_data: user data passed to the callback
69
* Type definition for a function that will be called back when an URI request is
70
* made for a user registered URI scheme.
72
typedef void (* WebKitURISchemeRequestCallback) (WebKitURISchemeRequest *request,
75
typedef struct _WebKitWebContext WebKitWebContext;
76
typedef struct _WebKitWebContextClass WebKitWebContextClass;
77
typedef struct _WebKitWebContextPrivate WebKitWebContextPrivate;
79
struct _WebKitWebContext {
83
WebKitWebContextPrivate *priv;
86
struct _WebKitWebContextClass {
89
/* Padding for future expansion */
90
void (*_webkit_reserved0) (void);
91
void (*_webkit_reserved1) (void);
92
void (*_webkit_reserved2) (void);
93
void (*_webkit_reserved3) (void);
97
webkit_web_context_get_type (void);
99
WEBKIT_API WebKitWebContext *
100
webkit_web_context_get_default (void);
103
webkit_web_context_set_cache_model (WebKitWebContext *context,
104
WebKitCacheModel cache_model);
105
WEBKIT_API WebKitCacheModel
106
webkit_web_context_get_cache_model (WebKitWebContext *context);
109
webkit_web_context_clear_cache (WebKitWebContext *context);
111
WEBKIT_API WebKitDownload *
112
webkit_web_context_download_uri (WebKitWebContext *context,
115
WEBKIT_API WebKitCookieManager *
116
webkit_web_context_get_cookie_manager (WebKitWebContext *context);
118
WEBKIT_API WebKitFaviconDatabase *
119
webkit_web_context_get_favicon_database (WebKitWebContext *context);
122
webkit_web_context_set_favicon_database_directory (WebKitWebContext *context,
124
WEBKIT_API const gchar *
125
webkit_web_context_get_favicon_database_directory (WebKitWebContext *context);
127
WEBKIT_API WebKitSecurityManager *
128
webkit_web_context_get_security_manager (WebKitWebContext *context);
131
webkit_web_context_set_additional_plugins_directory (WebKitWebContext *context,
132
const gchar *directory);
135
webkit_web_context_get_plugins (WebKitWebContext *context,
136
GCancellable *cancellable,
137
GAsyncReadyCallback callback,
141
webkit_web_context_get_plugins_finish (WebKitWebContext *context,
142
GAsyncResult *result,
145
webkit_web_context_register_uri_scheme (WebKitWebContext *context,
147
WebKitURISchemeRequestCallback callback,
149
GDestroyNotify user_data_destroy_func);
152
webkit_web_context_get_spell_checking_enabled (WebKitWebContext *context);
155
webkit_web_context_set_spell_checking_enabled (WebKitWebContext *context,
157
WEBKIT_API const gchar * const *
158
webkit_web_context_get_spell_checking_languages (WebKitWebContext *context);
161
webkit_web_context_set_spell_checking_languages (WebKitWebContext *context,
162
const gchar * const *languages);
165
webkit_web_context_set_preferred_languages (WebKitWebContext *context,
166
const gchar * const *languages);