Initial import of ephy (rev# 7126) from svn
[ephy-soc.git] / embed / .svn / text-base / ephy-cookie-manager.h.svn-base
blobbc8069ed341309980536f89cc58cb31ee6d4e959
1         /*
2  *  Copyright © 2003 Marco Pesenti Gritti
3  *  Copyright © 2003 Christian Persch
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  *  $Id$
20  */
22 #ifndef EPHY_COOKIE_MANAGER_H
23 #define EPHY_COOKIE_MANAGER_H
25 #include <glib-object.h>
26 #include <glib.h>
27 #include <time.h>
29 G_BEGIN_DECLS
31 #define EPHY_TYPE_COOKIE_MANAGER                (ephy_cookie_manager_get_type ())
32 #define EPHY_COOKIE_MANAGER(o)                  (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_COOKIE_MANAGER, EphyCookieManager))
33 #define EPHY_COOKIE_MANAGER_IFACE(k)            (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_COOKIE_MANAGER, EphyCookieManagerIface))
34 #define EPHY_IS_COOKIE_MANAGER(o)               (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_COOKIE_MANAGER))
35 #define EPHY_IS_COOKIE_MANAGER_IFACE(k)         (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_COOKIE_MANAGER))
36 #define EPHY_COOKIE_MANAGER_GET_IFACE(inst)     (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EPHY_TYPE_COOKIE_MANAGER, EphyCookieManagerIface))
38 #define EPHY_TYPE_COOKIE                        (ephy_cookie_get_type ())
40 typedef struct _EphyCookieManager       EphyCookieManager;
41 typedef struct _EphyCookieManagerIface  EphyCookieManagerIface;
43 typedef struct
45         char *name;
46         char *value;
47         char *domain;
48         char *path;
49         time_t expires;
50         glong real_expires;
51         guint is_secure : 1;
52         guint is_session : 1;
53         guint is_http_only : 1;
54 } EphyCookie;
56 struct _EphyCookieManagerIface
58         GTypeInterface base_iface;
60         /* Signals */
61         void    (* added)       (EphyCookieManager *manager,
62                                  EphyCookie *cookie);
63         void    (* changed)     (EphyCookieManager *manager,
64                                  EphyCookie *cookie);
65         void    (* deleted)     (EphyCookieManager *manager,
66                                  EphyCookie *cookie);
67         void    (* rejected)    (EphyCookieManager *manager,
68                                  const char *url);
69         void    (* cleared)     (EphyCookieManager *manager);
71         /* Methods */
72         GList * (* list)        (EphyCookieManager *manager);
73         void    (* remove)      (EphyCookieManager *manager,
74                                  const EphyCookie *cookie);
75         void    (* clear)       (EphyCookieManager *manager);
78 /* EphyCookie */
80 GType           ephy_cookie_get_type    (void);
82 EphyCookie     *ephy_cookie_new         (void);
84 EphyCookie     *ephy_cookie_copy        (const EphyCookie *cookie);
86 void            ephy_cookie_free        (EphyCookie *cookie);
88 /* EphyCookieManager */
90 GType           ephy_cookie_manager_get_type            (void);
92 GList *         ephy_cookie_manager_list_cookies        (EphyCookieManager *manager);
94 void            ephy_cookie_manager_remove_cookie       (EphyCookieManager *manager,
95                                                          const EphyCookie *cookie);
97 void            ephy_cookie_manager_clear               (EphyCookieManager *manager);
99 G_END_DECLS
101 #endif