| 1 | /* |
| 2 | * Copyright (C) 2018 Igalia S.L. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
| 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
| 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 23 | * THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) |
| 27 | #error "Only <webkit2/webkit2.h> can be included directly." |
| 28 | #endif |
| 29 | |
| 30 | #ifndef WebKitUserContentFilterStore_h |
| 31 | #define WebKitUserContentFilterStore_h |
| 32 | |
| 33 | #include <gio/gio.h> |
| 34 | #include <webkit2/WebKitDefines.h> |
| 35 | |
| 36 | G_BEGIN_DECLS |
| 37 | |
| 38 | #define WEBKIT_TYPE_USER_CONTENT_FILTER_STORE (webkit_user_content_filter_store_get_type()) |
| 39 | #define WEBKIT_USER_CONTENT_FILTER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_USER_CONTENT_FILTER_STORE, WebKitUserContentFilterStore)) |
| 40 | #define WEBKIT_IS_USER_CONTENT_FILTER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_USER_CONTENT_FILTER_STORE)) |
| 41 | #define WEBKIT_USER_CONTENT_FILTER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_USER_CONTENT_FILTER_STORE, WebKitUserContentFilterStoreClass)) |
| 42 | #define WEBKIT_IS_USER_CONTENT_FILTER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_USER_CONTENT_FILTER_STORE)) |
| 43 | #define WEBKIT_USER_CONTENT_FILTER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_USER_CONTENT_FILTER_STORE, WebKitUserContentFilterStoreClass)) |
| 44 | |
| 45 | typedef struct _WebKitUserContentFilterStore WebKitUserContentFilterStore; |
| 46 | typedef struct _WebKitUserContentFilterStoreClass WebKitUserContentFilterStoreClass; |
| 47 | typedef struct _WebKitUserContentFilterStorePrivate WebKitUserContentFilterStorePrivate; |
| 48 | |
| 49 | typedef struct _WebKitUserContentFilter WebKitUserContentFilter; |
| 50 | |
| 51 | struct _WebKitUserContentFilterStore { |
| 52 | GObject parent; |
| 53 | |
| 54 | /*< private >*/ |
| 55 | WebKitUserContentFilterStorePrivate *priv; |
| 56 | }; |
| 57 | |
| 58 | struct _WebKitUserContentFilterStoreClass { |
| 59 | GObjectClass parent_class; |
| 60 | |
| 61 | void (*_webkit_reserved0) (void); |
| 62 | void (*_webkit_reserved1) (void); |
| 63 | void (*_webkit_reserved2) (void); |
| 64 | void (*_webkit_reserved3) (void); |
| 65 | }; |
| 66 | |
| 67 | |
| 68 | WEBKIT_API GType |
| 69 | webkit_user_content_filter_store_get_type (void); |
| 70 | |
| 71 | WEBKIT_API WebKitUserContentFilterStore * |
| 72 | webkit_user_content_filter_store_new (const gchar *storage_path); |
| 73 | |
| 74 | WEBKIT_API const gchar * |
| 75 | webkit_user_content_filter_store_get_path (WebKitUserContentFilterStore *store); |
| 76 | |
| 77 | WEBKIT_API void |
| 78 | webkit_user_content_filter_store_save (WebKitUserContentFilterStore *store, |
| 79 | const gchar *identifier, |
| 80 | GBytes *source, |
| 81 | GCancellable *cancellable, |
| 82 | GAsyncReadyCallback callback, |
| 83 | gpointer user_data); |
| 84 | |
| 85 | WEBKIT_API WebKitUserContentFilter * |
| 86 | webkit_user_content_filter_store_save_finish (WebKitUserContentFilterStore *store, |
| 87 | GAsyncResult *result, |
| 88 | GError **error); |
| 89 | |
| 90 | WEBKIT_API void |
| 91 | webkit_user_content_filter_store_save_from_file (WebKitUserContentFilterStore *store, |
| 92 | const gchar *identifier, |
| 93 | GFile *file, |
| 94 | GCancellable *cancellable, |
| 95 | GAsyncReadyCallback callback, |
| 96 | gpointer user_data); |
| 97 | |
| 98 | WEBKIT_API WebKitUserContentFilter * |
| 99 | webkit_user_content_filter_store_save_from_file_finish (WebKitUserContentFilterStore *store, |
| 100 | GAsyncResult *result, |
| 101 | GError **error); |
| 102 | |
| 103 | WEBKIT_API void |
| 104 | webkit_user_content_filter_store_remove (WebKitUserContentFilterStore *store, |
| 105 | const gchar *identifier, |
| 106 | GCancellable *cancellable, |
| 107 | GAsyncReadyCallback callback, |
| 108 | gpointer user_data); |
| 109 | |
| 110 | WEBKIT_API gboolean |
| 111 | webkit_user_content_filter_store_remove_finish (WebKitUserContentFilterStore *store, |
| 112 | GAsyncResult *result, |
| 113 | GError **error); |
| 114 | |
| 115 | WEBKIT_API void |
| 116 | webkit_user_content_filter_store_load (WebKitUserContentFilterStore *store, |
| 117 | const gchar *identifier, |
| 118 | GCancellable *cancellable, |
| 119 | GAsyncReadyCallback callback, |
| 120 | gpointer user_data); |
| 121 | |
| 122 | WEBKIT_API WebKitUserContentFilter * |
| 123 | webkit_user_content_filter_store_load_finish (WebKitUserContentFilterStore *store, |
| 124 | GAsyncResult *result, |
| 125 | GError **error); |
| 126 | |
| 127 | WEBKIT_API void |
| 128 | webkit_user_content_filter_store_fetch_identifiers (WebKitUserContentFilterStore *store, |
| 129 | GCancellable *cancellable, |
| 130 | GAsyncReadyCallback callback, |
| 131 | gpointer user_data); |
| 132 | |
| 133 | WEBKIT_API gchar** |
| 134 | webkit_user_content_filter_store_fetch_identifiers_finish (WebKitUserContentFilterStore *store, |
| 135 | GAsyncResult *result); |
| 136 | |
| 137 | G_END_DECLS |
| 138 | |
| 139 | #endif /* !WebKitUserContentFilterStore_h */ |
| 140 | |