1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2008 Red Hat, Inc.
6 #ifndef SOUP_COOKIE_JAR_H
7 #define SOUP_COOKIE_JAR_H 1
9 #include <libsoup/soup-types.h>
13 #define SOUP_TYPE_COOKIE_JAR (soup_cookie_jar_get_type ())
14 #define SOUP_COOKIE_JAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_COOKIE_JAR, SoupCookieJar))
15 #define SOUP_COOKIE_JAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_COOKIE_JAR, SoupCookieJarClass))
16 #define SOUP_IS_COOKIE_JAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_COOKIE_JAR))
17 #define SOUP_IS_COOKIE_JAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_COOKIE_JAR))
18 #define SOUP_COOKIE_JAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_COOKIE_JAR, SoupCookieJarClass))
20 struct _SoupCookieJar {
26 GObjectClass parent_class;
28 void (*save) (SoupCookieJar *jar);
29 gboolean (*is_persistent) (SoupCookieJar *jar);
32 void (*changed) (SoupCookieJar *jar,
33 SoupCookie *old_cookie,
34 SoupCookie *new_cookie);
36 /* Padding for future expansion */
37 void (*_libsoup_reserved1) (void);
38 void (*_libsoup_reserved2) (void);
41 #define SOUP_COOKIE_JAR_READ_ONLY "read-only"
42 #define SOUP_COOKIE_JAR_ACCEPT_POLICY "accept-policy"
45 SOUP_COOKIE_JAR_ACCEPT_ALWAYS,
46 SOUP_COOKIE_JAR_ACCEPT_NEVER,
47 SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY
48 } SoupCookieJarAcceptPolicy;
50 SOUP_AVAILABLE_IN_2_24
51 GType soup_cookie_jar_get_type (void);
52 SOUP_AVAILABLE_IN_2_24
53 SoupCookieJar * soup_cookie_jar_new (void);
54 SOUP_AVAILABLE_IN_2_24
55 char * soup_cookie_jar_get_cookies (SoupCookieJar *jar,
58 SOUP_AVAILABLE_IN_2_40
59 GSList * soup_cookie_jar_get_cookie_list (SoupCookieJar *jar,
62 SOUP_AVAILABLE_IN_2_24
63 void soup_cookie_jar_set_cookie (SoupCookieJar *jar,
66 SOUP_AVAILABLE_IN_2_30
67 void soup_cookie_jar_set_cookie_with_first_party (SoupCookieJar *jar,
71 SOUP_AVAILABLE_IN_2_26
72 void soup_cookie_jar_add_cookie (SoupCookieJar *jar,
74 SOUP_AVAILABLE_IN_2_40
75 void soup_cookie_jar_add_cookie_with_first_party (SoupCookieJar *jar,
78 SOUP_AVAILABLE_IN_2_26
79 void soup_cookie_jar_delete_cookie (SoupCookieJar *jar,
81 SOUP_AVAILABLE_IN_2_26
82 GSList * soup_cookie_jar_all_cookies (SoupCookieJar *jar);
83 SOUP_AVAILABLE_IN_2_30
84 void soup_cookie_jar_set_accept_policy (SoupCookieJar *jar,
85 SoupCookieJarAcceptPolicy policy);
86 SOUP_AVAILABLE_IN_2_30
87 SoupCookieJarAcceptPolicy soup_cookie_jar_get_accept_policy (SoupCookieJar *jar);
88 SOUP_AVAILABLE_IN_2_40
89 gboolean soup_cookie_jar_is_persistent (SoupCookieJar *jar);
91 #ifndef SOUP_DISABLE_DEPRECATED
92 SOUP_AVAILABLE_IN_2_24
93 SOUP_DEPRECATED_IN_2_26
94 void soup_cookie_jar_save (SoupCookieJar *jar);
99 #endif /* SOUP_COOKIE_JAR_H */