1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
/*
* Copyright (C) 2012 Igalia S.L.
* Copyright (C) 2017 Endless Mobile, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
@API_SINGLE_HEADER_CHECK@
#ifndef WebKitCookieManager_h
#define WebKitCookieManager_h
#include <gio/gio.h>
#include <glib-object.h>
#include <libsoup/soup.h>
#include <@API_INCLUDE_PREFIX@/WebKitDefines.h>
G_BEGIN_DECLS
#define WEBKIT_TYPE_COOKIE_MANAGER (webkit_cookie_manager_get_type())
#if !ENABLE(2022_GLIB_API)
#define WEBKIT_COOKIE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_COOKIE_MANAGER, WebKitCookieManager))
#define WEBKIT_IS_COOKIE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_COOKIE_MANAGER))
#define WEBKIT_COOKIE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_COOKIE_MANAGER, WebKitCookieManagerClass))
#define WEBKIT_IS_COOKIE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_COOKIE_MANAGER))
#define WEBKIT_COOKIE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_COOKIE_MANAGER, WebKitCookieManagerClass))
struct _WebKitCookieManagerClass {
GObjectClass parent_class;
/*< private >*/
void (*_webkit_reserved0) (void);
void (*_webkit_reserved1) (void);
void (*_webkit_reserved2) (void);
void (*_webkit_reserved3) (void);
};
#endif
WEBKIT_DECLARE_FINAL_TYPE (WebKitCookieManager, webkit_cookie_manager, WEBKIT, COOKIE_MANAGER, GObject)
/**
* WebKitCookiePersistentStorage:
* @WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT: Cookies are stored in a text
* file in the Mozilla "cookies.txt" format.
* @WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE: Cookies are stored in a SQLite
* file in the current Mozilla format.
*
* Enum values used to denote the cookie persistent storage types.
*/
typedef enum {
WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT,
WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE
} WebKitCookiePersistentStorage;
/**
* WebKitCookieAcceptPolicy:
* @WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS: Accept all cookies unconditionally.
* @WEBKIT_COOKIE_POLICY_ACCEPT_NEVER: Reject all cookies unconditionally.
* @WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY: Accept only cookies set by the main document loaded.
*
* Enum values used to denote the cookie acceptance policies.
*/
typedef enum {
WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS,
WEBKIT_COOKIE_POLICY_ACCEPT_NEVER,
WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY
} WebKitCookieAcceptPolicy;
WEBKIT_API void
webkit_cookie_manager_set_persistent_storage (WebKitCookieManager *cookie_manager,
const gchar *filename,
WebKitCookiePersistentStorage storage);
WEBKIT_API void
webkit_cookie_manager_set_accept_policy (WebKitCookieManager *cookie_manager,
WebKitCookieAcceptPolicy policy);
WEBKIT_API void
webkit_cookie_manager_get_accept_policy (WebKitCookieManager *cookie_manager,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
WEBKIT_API WebKitCookieAcceptPolicy
webkit_cookie_manager_get_accept_policy_finish (WebKitCookieManager *cookie_manager,
GAsyncResult *result,
GError **error);
WEBKIT_API void
webkit_cookie_manager_add_cookie (WebKitCookieManager *cookie_manager,
SoupCookie *cookie,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
WEBKIT_API gboolean
webkit_cookie_manager_add_cookie_finish (WebKitCookieManager *cookie_manager,
GAsyncResult *result,
GError **error);
WEBKIT_API void
webkit_cookie_manager_get_cookies (WebKitCookieManager *cookie_manager,
const gchar *uri,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
WEBKIT_API GList *
webkit_cookie_manager_get_cookies_finish (WebKitCookieManager *cookie_manager,
GAsyncResult *result,
GError **error);
WEBKIT_API void
webkit_cookie_manager_delete_cookie (WebKitCookieManager *cookie_manager,
SoupCookie *cookie,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
WEBKIT_API gboolean
webkit_cookie_manager_delete_cookie_finish (WebKitCookieManager *cookie_manager,
GAsyncResult *result,
GError **error);
#if PLATFORM(GTK) && !USE(GTK4)
WEBKIT_DEPRECATED_FOR(webkit_website_data_manager_fetch) void
webkit_cookie_manager_get_domains_with_cookies (WebKitCookieManager *cookie_manager,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
WEBKIT_DEPRECATED_FOR(webkit_website_data_manager_fetch_finish) gchar **
webkit_cookie_manager_get_domains_with_cookies_finish (WebKitCookieManager *cookie_manager,
GAsyncResult *result,
GError **error);
WEBKIT_DEPRECATED_FOR(webkit_website_data_manager_remove) void
webkit_cookie_manager_delete_cookies_for_domain (WebKitCookieManager *cookie_manager,
const gchar *domain);
WEBKIT_DEPRECATED_FOR(webkit_website_data_manager_clear) void
webkit_cookie_manager_delete_all_cookies (WebKitCookieManager *cookie_manager);
#endif
WEBKIT_API void
webkit_cookie_manager_replace_cookies (WebKitCookieManager *cookie_manager,
GList *cookies,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
WEBKIT_API gboolean
webkit_cookie_manager_replace_cookies_finish (WebKitCookieManager *cookie_manager,
GAsyncResult *result,
GError **error);
WEBKIT_API void
webkit_cookie_manager_get_all_cookies (WebKitCookieManager *cookie_manager,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
WEBKIT_API GList *
webkit_cookie_manager_get_all_cookies_finish (WebKitCookieManager *cookie_manager,
GAsyncResult *result,
GError **error);
G_END_DECLS
#endif
|