1/*
2 * Copyright (C) 2015 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 Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2,1 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 WebKitWebsiteDataManager_h
25#define WebKitWebsiteDataManager_h
26
27#include <gio/gio.h>
28#include <webkit2/WebKitCookieManager.h>
29#include <webkit2/WebKitDefines.h>
30#include <webkit2/WebKitWebsiteData.h>
31
32G_BEGIN_DECLS
33
34#define WEBKIT_TYPE_WEBSITE_DATA_MANAGER (webkit_website_data_manager_get_type())
35#define WEBKIT_WEBSITE_DATA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEBSITE_DATA_MANAGER, WebKitWebsiteDataManager))
36#define WEBKIT_IS_WEBSITE_DATA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEBSITE_DATA_MANAGER))
37#define WEBKIT_WEBSITE_DATA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEBSITE_DATA_MANAGER, WebKitWebsiteDataManagerClass))
38#define WEBKIT_IS_WEBSITE_DATA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEBSITE_DATA_MANAGER))
39#define WEBKIT_WEBSITE_DATA_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEBSITE_DATA_MANAGER, WebKitWebsiteDataManagerClass))
40
41typedef struct _WebKitWebsiteDataManager WebKitWebsiteDataManager;
42typedef struct _WebKitWebsiteDataManagerClass WebKitWebsiteDataManagerClass;
43typedef struct _WebKitWebsiteDataManagerPrivate WebKitWebsiteDataManagerPrivate;
44
45struct _WebKitWebsiteDataManager {
46 GObject parent;
47
48 WebKitWebsiteDataManagerPrivate *priv;
49};
50
51struct _WebKitWebsiteDataManagerClass {
52 GObjectClass parent_class;
53
54 void (*_webkit_reserved0) (void);
55 void (*_webkit_reserved1) (void);
56 void (*_webkit_reserved2) (void);
57 void (*_webkit_reserved3) (void);
58};
59
60WEBKIT_API GType
61webkit_website_data_manager_get_type (void);
62
63WEBKIT_API WebKitWebsiteDataManager *
64webkit_website_data_manager_new (const gchar *first_option_name,
65 ...);
66WEBKIT_API WebKitWebsiteDataManager *
67webkit_website_data_manager_new_ephemeral (void);
68
69WEBKIT_API gboolean
70webkit_website_data_manager_is_ephemeral (WebKitWebsiteDataManager* manager);
71
72WEBKIT_API const gchar *
73webkit_website_data_manager_get_base_data_directory (WebKitWebsiteDataManager *manager);
74
75WEBKIT_API const gchar *
76webkit_website_data_manager_get_base_cache_directory (WebKitWebsiteDataManager *manager);
77
78WEBKIT_API const gchar *
79webkit_website_data_manager_get_local_storage_directory (WebKitWebsiteDataManager *manager);
80
81WEBKIT_API const gchar *
82webkit_website_data_manager_get_disk_cache_directory (WebKitWebsiteDataManager *manager);
83
84WEBKIT_API const gchar *
85webkit_website_data_manager_get_offline_application_cache_directory (WebKitWebsiteDataManager *manager);
86
87WEBKIT_API const gchar *
88webkit_website_data_manager_get_indexeddb_directory (WebKitWebsiteDataManager *manager);
89
90WEBKIT_DEPRECATED const gchar *
91webkit_website_data_manager_get_websql_directory (WebKitWebsiteDataManager *manager);
92
93WEBKIT_API WebKitCookieManager *
94webkit_website_data_manager_get_cookie_manager (WebKitWebsiteDataManager *manager);
95
96WEBKIT_API void
97webkit_website_data_manager_fetch (WebKitWebsiteDataManager *manager,
98 WebKitWebsiteDataTypes types,
99 GCancellable *cancellable,
100 GAsyncReadyCallback callback,
101 gpointer user_data);
102
103WEBKIT_API GList *
104webkit_website_data_manager_fetch_finish (WebKitWebsiteDataManager *manager,
105 GAsyncResult *result,
106 GError **error);
107WEBKIT_API void
108webkit_website_data_manager_remove (WebKitWebsiteDataManager *manager,
109 WebKitWebsiteDataTypes types,
110 GList *website_data,
111 GCancellable *cancellable,
112 GAsyncReadyCallback callback,
113 gpointer user_data);
114WEBKIT_API gboolean
115webkit_website_data_manager_remove_finish (WebKitWebsiteDataManager *manager,
116 GAsyncResult *result,
117 GError **error);
118
119WEBKIT_API void
120webkit_website_data_manager_clear (WebKitWebsiteDataManager *manager,
121 WebKitWebsiteDataTypes types,
122 GTimeSpan timespan,
123 GCancellable *cancellable,
124 GAsyncReadyCallback callback,
125 gpointer user_data);
126
127WEBKIT_API gboolean
128webkit_website_data_manager_clear_finish (WebKitWebsiteDataManager *manager,
129 GAsyncResult *result,
130 GError **error);
131
132G_END_DECLS
133
134#endif
135