~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2011 Igalia S.L.
 
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 WebKitWebContext_h
 
25
#define WebKitWebContext_h
 
26
 
 
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>
 
34
 
 
35
G_BEGIN_DECLS
 
36
 
 
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))
 
43
 
 
44
/**
 
45
 * WebKitCacheModel:
 
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.
 
55
 *
 
56
 * Enum values used for determining the #WebKitWebContext cache model.
 
57
 */
 
58
typedef enum {
 
59
    WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER,
 
60
    WEBKIT_CACHE_MODEL_WEB_BROWSER,
 
61
    WEBKIT_CACHE_MODEL_DOCUMENT_BROWSER
 
62
} WebKitCacheModel;
 
63
 
 
64
/**
 
65
 * WebKitURISchemeRequestCallback:
 
66
 * @request: the #WebKitURISchemeRequest
 
67
 * @user_data: user data passed to the callback
 
68
 *
 
69
 * Type definition for a function that will be called back when an URI request is
 
70
 * made for a user registered URI scheme.
 
71
 */
 
72
typedef void (* WebKitURISchemeRequestCallback) (WebKitURISchemeRequest *request,
 
73
                                                 gpointer                user_data);
 
74
 
 
75
typedef struct _WebKitWebContext        WebKitWebContext;
 
76
typedef struct _WebKitWebContextClass   WebKitWebContextClass;
 
77
typedef struct _WebKitWebContextPrivate WebKitWebContextPrivate;
 
78
 
 
79
struct _WebKitWebContext {
 
80
    GObject parent;
 
81
 
 
82
    /*< private >*/
 
83
    WebKitWebContextPrivate *priv;
 
84
};
 
85
 
 
86
struct _WebKitWebContextClass {
 
87
    GObjectClass parent;
 
88
 
 
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);
 
94
};
 
95
 
 
96
WEBKIT_API GType
 
97
webkit_web_context_get_type                         (void);
 
98
 
 
99
WEBKIT_API WebKitWebContext *
 
100
webkit_web_context_get_default                      (void);
 
101
 
 
102
WEBKIT_API 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);
 
107
 
 
108
WEBKIT_API void
 
109
webkit_web_context_clear_cache                      (WebKitWebContext              *context);
 
110
 
 
111
WEBKIT_API WebKitDownload *
 
112
webkit_web_context_download_uri                     (WebKitWebContext              *context,
 
113
                                                     const gchar                   *uri);
 
114
 
 
115
WEBKIT_API WebKitCookieManager *
 
116
webkit_web_context_get_cookie_manager               (WebKitWebContext              *context);
 
117
 
 
118
WEBKIT_API WebKitFaviconDatabase *
 
119
webkit_web_context_get_favicon_database             (WebKitWebContext              *context);
 
120
 
 
121
WEBKIT_API void
 
122
webkit_web_context_set_favicon_database_directory   (WebKitWebContext              *context,
 
123
                                                     const gchar                   *path);
 
124
WEBKIT_API const gchar *
 
125
webkit_web_context_get_favicon_database_directory   (WebKitWebContext              *context);
 
126
 
 
127
WEBKIT_API WebKitSecurityManager *
 
128
webkit_web_context_get_security_manager             (WebKitWebContext              *context);
 
129
 
 
130
WEBKIT_API void
 
131
webkit_web_context_set_additional_plugins_directory (WebKitWebContext              *context,
 
132
                                                     const gchar                   *directory);
 
133
 
 
134
WEBKIT_API void
 
135
webkit_web_context_get_plugins                      (WebKitWebContext              *context,
 
136
                                                     GCancellable                  *cancellable,
 
137
                                                     GAsyncReadyCallback            callback,
 
138
                                                     gpointer                       user_data);
 
139
 
 
140
WEBKIT_API GList *
 
141
webkit_web_context_get_plugins_finish               (WebKitWebContext              *context,
 
142
                                                     GAsyncResult                  *result,
 
143
                                                     GError                       **error);
 
144
WEBKIT_API void
 
145
webkit_web_context_register_uri_scheme              (WebKitWebContext              *context,
 
146
                                                     const gchar                   *scheme,
 
147
                                                     WebKitURISchemeRequestCallback callback,
 
148
                                                     gpointer                       user_data,
 
149
                                                     GDestroyNotify                 user_data_destroy_func);
 
150
 
 
151
WEBKIT_API gboolean
 
152
webkit_web_context_get_spell_checking_enabled       (WebKitWebContext              *context);
 
153
 
 
154
WEBKIT_API void
 
155
webkit_web_context_set_spell_checking_enabled       (WebKitWebContext              *context,
 
156
                                                     gboolean                       enabled);
 
157
WEBKIT_API const gchar * const *
 
158
webkit_web_context_get_spell_checking_languages     (WebKitWebContext              *context);
 
159
 
 
160
WEBKIT_API void
 
161
webkit_web_context_set_spell_checking_languages     (WebKitWebContext              *context,
 
162
                                                     const gchar * const           *languages);
 
163
 
 
164
WEBKIT_API void
 
165
webkit_web_context_set_preferred_languages          (WebKitWebContext              *context,
 
166
                                                     const gchar * const           *languages);
 
167
 
 
168
G_END_DECLS
 
169
 
 
170
#endif