[WebKit2] [GTK] Add API for controlling the user agent
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / gtk / WebKitSettings.h
1 /*
2  * Copyright (c) 2011 Motorola Mobility, Inc.  All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  *
7  * Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  *
10  * Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation and/or
12  * other materials provided with the distribution.
13  *
14  * Neither the name of Motorola Mobility, Inc. nor the names of its contributors may
15  * be used to endorse or promote products derived from this software without
16  * specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30
31 #if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
32 #error "Only <webkit2/webkit2.h> can be included directly."
33 #endif
34
35 #ifndef WebKitSettings_h
36 #define WebKitSettings_h
37
38 #include <glib-object.h>
39 #include <webkit2/WebKitDefines.h>
40
41 G_BEGIN_DECLS
42
43 #define WEBKIT_TYPE_SETTINGS            (webkit_settings_get_type())
44 #define WEBKIT_SETTINGS(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_SETTINGS, WebKitSettings))
45 #define WEBKIT_SETTINGS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_SETTINGS, WebKitSettingsClass))
46 #define WEBKIT_IS_SETTINGS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_SETTINGS))
47 #define WEBKIT_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_SETTINGS))
48 #define WEBKIT_SETTINGS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_SETTINGS, WebKitSettingsClass))
49
50 typedef struct _WebKitSettings WebKitSettings;
51 typedef struct _WebKitSettingsClass WebKitSettingsClass;
52 typedef struct _WebKitSettingsPrivate WebKitSettingsPrivate;
53
54 struct _WebKitSettings {
55     GObject parent_instance;
56
57     WebKitSettingsPrivate *priv;
58 };
59
60 struct _WebKitSettingsClass {
61     GObjectClass parent_class;
62
63     /* Padding for future expansion */
64     void (*_webkit_reserved1) (void);
65     void (*_webkit_reserved2) (void);
66     void (*_webkit_reserved3) (void);
67     void (*_webkit_reserved4) (void);
68 };
69
70 WEBKIT_API GType
71 webkit_settings_get_type(void);
72
73 WEBKIT_API WebKitSettings *
74 webkit_settings_new                                            (void);
75
76 WEBKIT_API WebKitSettings *
77 webkit_settings_new_with_settings                              (const gchar    *first_setting_name,
78                                                                 ...);
79
80 WEBKIT_API gboolean
81 webkit_settings_get_enable_javascript                          (WebKitSettings *settings);
82
83 WEBKIT_API void
84 webkit_settings_set_enable_javascript                          (WebKitSettings *settings,
85                                                                 gboolean        enabled);
86
87 WEBKIT_API gboolean
88 webkit_settings_get_auto_load_images                           (WebKitSettings *settings);
89
90 WEBKIT_API void
91 webkit_settings_set_auto_load_images                           (WebKitSettings *settings,
92                                                                 gboolean        enabled);
93
94 WEBKIT_API gboolean
95 webkit_settings_get_load_icons_ignoring_image_load_setting     (WebKitSettings *settings);
96
97 WEBKIT_API void
98 webkit_settings_set_load_icons_ignoring_image_load_setting     (WebKitSettings *settings,
99                                                                 gboolean        enabled);
100
101 WEBKIT_API gboolean
102 webkit_settings_get_enable_offline_web_application_cache       (WebKitSettings *settings);
103
104 WEBKIT_API void
105 webkit_settings_set_enable_offline_web_application_cache       (WebKitSettings *settings,
106                                                                 gboolean        enabled);
107
108 WEBKIT_API gboolean
109 webkit_settings_get_enable_html5_local_storage                 (WebKitSettings *settings);
110
111 WEBKIT_API void
112 webkit_settings_set_enable_html5_local_storage                 (WebKitSettings *settings,
113                                                                 gboolean        enabled);
114
115 WEBKIT_API gboolean
116 webkit_settings_get_enable_html5_database                      (WebKitSettings *settings);
117
118 WEBKIT_API void
119 webkit_settings_set_enable_html5_database                      (WebKitSettings *settings,
120                                                                 gboolean        enabled);
121 WEBKIT_API gboolean
122 webkit_settings_get_enable_xss_auditor                         (WebKitSettings *settings);
123
124 WEBKIT_API void
125 webkit_settings_set_enable_xss_auditor                         (WebKitSettings *settings,
126                                                                 gboolean        enabled);
127
128 WEBKIT_API gboolean
129 webkit_settings_get_enable_frame_flattening                    (WebKitSettings *settings);
130
131 WEBKIT_API void
132 webkit_settings_set_enable_frame_flattening                    (WebKitSettings *settings,
133                                                                 gboolean        enabled);
134
135 WEBKIT_API gboolean
136 webkit_settings_get_enable_plugins                             (WebKitSettings *settings);
137
138 WEBKIT_API void
139 webkit_settings_set_enable_plugins                             (WebKitSettings *settings,
140                                                                 gboolean        enabled);
141
142 WEBKIT_API gboolean
143 webkit_settings_get_enable_java                                (WebKitSettings *settings);
144
145 WEBKIT_API void
146 webkit_settings_set_enable_java                                (WebKitSettings *settings,
147                                                                 gboolean        enabled);
148
149 WEBKIT_API gboolean
150 webkit_settings_get_javascript_can_open_windows_automatically  (WebKitSettings *settings);
151
152 WEBKIT_API void
153 webkit_settings_set_javascript_can_open_windows_automatically  (WebKitSettings *settings,
154                                                                 gboolean        enabled);
155
156 WEBKIT_API gboolean
157 webkit_settings_get_enable_hyperlink_auditing                  (WebKitSettings *settings);
158
159 WEBKIT_API void
160 webkit_settings_set_enable_hyperlink_auditing                  (WebKitSettings *settings,
161                                                                 gboolean        enabled);
162
163 WEBKIT_API const gchar *
164 webkit_settings_get_default_font_family                        (WebKitSettings *settings);
165
166 WEBKIT_API void
167 webkit_settings_set_default_font_family                        (WebKitSettings *settings,
168                                                                 const gchar    *default_font_family);
169
170 WEBKIT_API const gchar *
171 webkit_settings_get_monospace_font_family                      (WebKitSettings *settings);
172
173 WEBKIT_API void
174 webkit_settings_set_monospace_font_family                      (WebKitSettings *settings,
175                                                                 const gchar    *monospace_font_family);
176
177 WEBKIT_API const gchar *
178 webkit_settings_get_serif_font_family                          (WebKitSettings *settings);
179
180 WEBKIT_API void
181 webkit_settings_set_serif_font_family                          (WebKitSettings *settings,
182                                                                 const gchar    *serif_font_family);
183
184 WEBKIT_API const gchar *
185 webkit_settings_get_sans_serif_font_family                     (WebKitSettings *settings);
186
187 WEBKIT_API void
188 webkit_settings_set_sans_serif_font_family                     (WebKitSettings *settings,
189                                                                 const gchar    *sans_serif_font_family);
190
191 WEBKIT_API const gchar *
192 webkit_settings_get_cursive_font_family                        (WebKitSettings *settings);
193
194 WEBKIT_API void
195 webkit_settings_set_cursive_font_family                        (WebKitSettings *settings,
196                                                                 const gchar    *cursive_font_family);
197
198 WEBKIT_API const gchar *
199 webkit_settings_get_fantasy_font_family                        (WebKitSettings *settings);
200
201 WEBKIT_API void
202 webkit_settings_set_fantasy_font_family                        (WebKitSettings *settings,
203                                                                 const gchar    *fantasy_font_family);
204
205 WEBKIT_API const gchar *
206 webkit_settings_get_pictograph_font_family                     (WebKitSettings *settings);
207
208 WEBKIT_API void
209 webkit_settings_set_pictograph_font_family                     (WebKitSettings *settings,
210                                                                 const gchar    *pictograph_font_family);
211
212 WEBKIT_API guint32
213 webkit_settings_get_default_font_size                          (WebKitSettings *settings);
214
215 WEBKIT_API void
216 webkit_settings_set_default_font_size                          (WebKitSettings *settings,
217                                                                 guint32         font_size);
218
219 WEBKIT_API guint32
220 webkit_settings_get_default_monospace_font_size                (WebKitSettings *settings);
221
222 WEBKIT_API void
223 webkit_settings_set_default_monospace_font_size                (WebKitSettings *settings,
224                                                                 guint32         font_size);
225
226 WEBKIT_API guint32
227 webkit_settings_get_minimum_font_size                          (WebKitSettings *settings);
228
229 WEBKIT_API void
230 webkit_settings_set_minimum_font_size                          (WebKitSettings *settings,
231                                                                 guint32         font_size);
232
233 WEBKIT_API const gchar *
234 webkit_settings_get_default_charset                            (WebKitSettings *settings);
235
236 WEBKIT_API void
237 webkit_settings_set_default_charset                            (WebKitSettings *settings,
238                                                                 const gchar    *default_charset);
239
240 WEBKIT_API gboolean
241 webkit_settings_get_enable_private_browsing                    (WebKitSettings *settings);
242
243 WEBKIT_API void
244 webkit_settings_set_enable_private_browsing                    (WebKitSettings *settings,
245                                                                 gboolean        enabled);
246
247 WEBKIT_API gboolean
248 webkit_settings_get_enable_developer_extras                    (WebKitSettings *settings);
249
250 WEBKIT_API void
251 webkit_settings_set_enable_developer_extras                    (WebKitSettings *settings,
252                                                                 gboolean        enabled);
253
254 WEBKIT_API gboolean
255 webkit_settings_get_enable_resizable_text_areas                (WebKitSettings *settings);
256
257 WEBKIT_API void
258 webkit_settings_set_enable_resizable_text_areas                (WebKitSettings *settings,
259                                                                 gboolean        enabled);
260
261 WEBKIT_API gboolean
262 webkit_settings_get_enable_tabs_to_links                       (WebKitSettings *settings);
263
264 WEBKIT_API void
265 webkit_settings_set_enable_tabs_to_links                       (WebKitSettings *settings,
266                                                                 gboolean        enabled);
267
268 WEBKIT_API gboolean
269 webkit_settings_get_enable_dns_prefetching                     (WebKitSettings *settings);
270
271 WEBKIT_API void
272 webkit_settings_set_enable_dns_prefetching                     (WebKitSettings *settings,
273                                                                 gboolean        enabled);
274
275 WEBKIT_API gboolean
276 webkit_settings_get_enable_caret_browsing                      (WebKitSettings *settings);
277
278 WEBKIT_API void
279 webkit_settings_set_enable_caret_browsing                      (WebKitSettings *settings,
280                                                                 gboolean        enabled);
281
282 WEBKIT_API gboolean
283 webkit_settings_get_enable_fullscreen                          (WebKitSettings *settings);
284
285 WEBKIT_API void
286 webkit_settings_set_enable_fullscreen                          (WebKitSettings *settings,
287                                                                 gboolean        enabled);
288
289 WEBKIT_API gboolean
290 webkit_settings_get_print_backgrounds                          (WebKitSettings *settings);
291
292 WEBKIT_API void
293 webkit_settings_set_print_backgrounds                          (WebKitSettings *settings,
294                                                                 gboolean        print_backgrounds);
295
296 WEBKIT_API gboolean
297 webkit_settings_get_enable_webaudio                            (WebKitSettings *settings);
298
299 WEBKIT_API void
300 webkit_settings_set_enable_webaudio                            (WebKitSettings *settings,
301                                                                 gboolean        enabled);
302
303 WEBKIT_API gboolean
304 webkit_settings_get_enable_webgl                               (WebKitSettings *settings);
305
306 WEBKIT_API void
307 webkit_settings_set_enable_webgl                               (WebKitSettings *settings,
308                                                                 gboolean        enabled);
309
310 WEBKIT_API void
311 webkit_settings_set_allow_modal_dialogs                        (WebKitSettings *settings,
312                                                                 gboolean        allowed);
313
314 WEBKIT_API gboolean
315 webkit_settings_get_allow_modal_dialogs                        (WebKitSettings *settings);
316
317 WEBKIT_API void
318 webkit_settings_set_zoom_text_only                             (WebKitSettings *settings,
319                                                                 gboolean        zoom_text_only);
320
321 WEBKIT_API gboolean
322 webkit_settings_get_zoom_text_only                             (WebKitSettings *settings);
323
324 WEBKIT_API gboolean
325 webkit_settings_get_javascript_can_access_clipboard            (WebKitSettings *settings);
326
327 WEBKIT_API void
328 webkit_settings_set_javascript_can_access_clipboard            (WebKitSettings *settings,
329                                                                 gboolean        enabled);
330
331 WEBKIT_API gboolean
332 webkit_settings_get_media_playback_requires_user_gesture       (WebKitSettings *settings);
333
334 WEBKIT_API void
335 webkit_settings_set_media_playback_requires_user_gesture       (WebKitSettings *settings,
336                                                                 gboolean        enabled);
337
338 WEBKIT_API gboolean
339 webkit_settings_get_media_playback_allows_inline               (WebKitSettings *settings);
340
341 WEBKIT_API void
342 webkit_settings_set_media_playback_allows_inline               (WebKitSettings *settings,
343                                                                 gboolean        enabled);
344 WEBKIT_API gboolean
345 webkit_settings_get_draw_compositing_indicators                (WebKitSettings *settings);
346
347 WEBKIT_API void
348 webkit_settings_set_draw_compositing_indicators                (WebKitSettings *settings,
349                                                                 gboolean        enabled);
350
351 WEBKIT_API gboolean
352 webkit_settings_get_enable_site_specific_quirks                (WebKitSettings *settings);
353
354 WEBKIT_API void
355 webkit_settings_set_enable_site_specific_quirks                (WebKitSettings *settings,
356                                                                 gboolean        enabled);
357
358 WEBKIT_API gboolean
359 webkit_settings_get_enable_page_cache                          (WebKitSettings *settings);
360
361 WEBKIT_API void
362 webkit_settings_set_enable_page_cache                          (WebKitSettings *settings,
363                                                                 gboolean        enabled);
364
365 WEBKIT_API const gchar *
366 webkit_settings_get_user_agent                                 (WebKitSettings *settings);
367
368 WEBKIT_API void
369 webkit_settings_set_user_agent                                 (WebKitSettings *settings,
370                                                                 const gchar    *user_agent);
371 WEBKIT_API void
372 webkit_settings_set_user_agent_with_application_details        (WebKitSettings *settings,
373                                                                 const gchar    *application_name,
374                                                                 const gchar    *application_version);
375
376 G_END_DECLS
377
378 #endif /* WebKitSettings_h */