1/*
2 * Copyright (C) 2014 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 WebKitUserContentManager_h
25#define WebKitUserContentManager_h
26
27#include <glib-object.h>
28#include <webkit2/WebKitDefines.h>
29#include <webkit2/WebKitUserContent.h>
30
31G_BEGIN_DECLS
32
33#define WEBKIT_TYPE_USER_CONTENT_MANAGER (webkit_user_content_manager_get_type())
34#define WEBKIT_USER_CONTENT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_USER_CONTENT_MANAGER, WebKitUserContentManager))
35#define WEBKIT_IS_USER_CONTENT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_USER_CONTENT_MANAGER))
36#define WEBKIT_USER_CONTENT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_USER_CONTENT_MANAGER, WebKitUserContentManagerClass))
37#define WEBKIT_IS_USER_CONTENT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_USER_CONTENT_MANAGER))
38#define WEBKIT_USER_CONTENT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_USER_CONTENT_MANAGER, WebKitUserContentManagerClass))
39
40typedef struct _WebKitUserContentManager WebKitUserContentManager;
41typedef struct _WebKitUserContentManagerClass WebKitUserContentManagerClass;
42typedef struct _WebKitUserContentManagerPrivate WebKitUserContentManagerPrivate;
43
44
45struct _WebKitUserContentManager {
46 GObject parent;
47
48 /*< private >*/
49 WebKitUserContentManagerPrivate *priv;
50};
51
52struct _WebKitUserContentManagerClass {
53 GObjectClass parent_class;
54
55 void (*_webkit_reserved0) (void);
56 void (*_webkit_reserved1) (void);
57 void (*_webkit_reserved2) (void);
58 void (*_webkit_reserved3) (void);
59};
60
61WEBKIT_API GType
62webkit_user_content_manager_get_type (void);
63
64WEBKIT_API WebKitUserContentManager *
65webkit_user_content_manager_new (void);
66
67WEBKIT_API void
68webkit_user_content_manager_add_style_sheet (WebKitUserContentManager *manager,
69 WebKitUserStyleSheet *stylesheet);
70WEBKIT_API void
71webkit_user_content_manager_remove_all_style_sheets (WebKitUserContentManager *manager);
72
73WEBKIT_API gboolean
74webkit_user_content_manager_register_script_message_handler (WebKitUserContentManager *manager,
75 const gchar *name);
76WEBKIT_API void
77webkit_user_content_manager_unregister_script_message_handler (WebKitUserContentManager *manager,
78 const gchar *name);
79
80WEBKIT_API gboolean
81webkit_user_content_manager_register_script_message_handler_in_world (WebKitUserContentManager *manager,
82 const gchar *name,
83 const gchar *world_name);
84WEBKIT_API void
85webkit_user_content_manager_unregister_script_message_handler_in_world (WebKitUserContentManager *manager,
86 const gchar *name,
87 const gchar *world_name);
88
89WEBKIT_API void
90webkit_user_content_manager_add_script (WebKitUserContentManager *manager,
91 WebKitUserScript *script);
92
93WEBKIT_API void
94webkit_user_content_manager_remove_all_scripts (WebKitUserContentManager *manager);
95
96WEBKIT_API void
97webkit_user_content_manager_add_filter (WebKitUserContentManager *manager,
98 WebKitUserContentFilter *filter);
99
100WEBKIT_API void
101webkit_user_content_manager_remove_filter (WebKitUserContentManager *manager,
102 WebKitUserContentFilter *filter);
103
104WEBKIT_API void
105webkit_user_content_manager_remove_all_filters (WebKitUserContentManager *manager);
106
107G_END_DECLS
108
109#endif
110