| 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 | |
| 31 | G_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 | |
| 40 | typedef struct _WebKitUserContentManager WebKitUserContentManager; |
| 41 | typedef struct _WebKitUserContentManagerClass WebKitUserContentManagerClass; |
| 42 | typedef struct _WebKitUserContentManagerPrivate WebKitUserContentManagerPrivate; |
| 43 | |
| 44 | |
| 45 | struct _WebKitUserContentManager { |
| 46 | GObject parent; |
| 47 | |
| 48 | /*< private >*/ |
| 49 | WebKitUserContentManagerPrivate *priv; |
| 50 | }; |
| 51 | |
| 52 | struct _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 | |
| 61 | WEBKIT_API GType |
| 62 | webkit_user_content_manager_get_type (void); |
| 63 | |
| 64 | WEBKIT_API WebKitUserContentManager * |
| 65 | webkit_user_content_manager_new (void); |
| 66 | |
| 67 | WEBKIT_API void |
| 68 | webkit_user_content_manager_add_style_sheet (WebKitUserContentManager *manager, |
| 69 | WebKitUserStyleSheet *stylesheet); |
| 70 | WEBKIT_API void |
| 71 | webkit_user_content_manager_remove_all_style_sheets (WebKitUserContentManager *manager); |
| 72 | |
| 73 | WEBKIT_API gboolean |
| 74 | webkit_user_content_manager_register_script_message_handler (WebKitUserContentManager *manager, |
| 75 | const gchar *name); |
| 76 | WEBKIT_API void |
| 77 | webkit_user_content_manager_unregister_script_message_handler (WebKitUserContentManager *manager, |
| 78 | const gchar *name); |
| 79 | |
| 80 | WEBKIT_API gboolean |
| 81 | webkit_user_content_manager_register_script_message_handler_in_world (WebKitUserContentManager *manager, |
| 82 | const gchar *name, |
| 83 | const gchar *world_name); |
| 84 | WEBKIT_API void |
| 85 | webkit_user_content_manager_unregister_script_message_handler_in_world (WebKitUserContentManager *manager, |
| 86 | const gchar *name, |
| 87 | const gchar *world_name); |
| 88 | |
| 89 | WEBKIT_API void |
| 90 | webkit_user_content_manager_add_script (WebKitUserContentManager *manager, |
| 91 | WebKitUserScript *script); |
| 92 | |
| 93 | WEBKIT_API void |
| 94 | webkit_user_content_manager_remove_all_scripts (WebKitUserContentManager *manager); |
| 95 | |
| 96 | WEBKIT_API void |
| 97 | webkit_user_content_manager_add_filter (WebKitUserContentManager *manager, |
| 98 | WebKitUserContentFilter *filter); |
| 99 | |
| 100 | WEBKIT_API void |
| 101 | webkit_user_content_manager_remove_filter (WebKitUserContentManager *manager, |
| 102 | WebKitUserContentFilter *filter); |
| 103 | |
| 104 | WEBKIT_API void |
| 105 | webkit_user_content_manager_remove_all_filters (WebKitUserContentManager *manager); |
| 106 | |
| 107 | G_END_DECLS |
| 108 | |
| 109 | #endif |
| 110 | |