]> git.0d.be Git - empathy.git/blob - libempathy/empathy-avatar.h
Cache avatars and RequestAvatars only when needed.
[empathy.git] / libempathy / empathy-avatar.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2006 Xavier Claessens <xclaesse@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) 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 GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __EMPATHY_AVATAR_H__
22 #define __EMPATHY_AVATAR_H__
23
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 #define EMPATHY_TYPE_AVATAR (empathy_avatar_get_type ())
29
30 typedef struct _EmpathyAvatar EmpathyAvatar;
31
32 struct _EmpathyAvatar {
33         guchar *data;
34         gsize   len;
35         gchar  *format;
36         gchar  *token;
37         guint   refcount;
38 };
39
40 GType           empathy_avatar_get_type       (void) G_GNUC_CONST;
41 EmpathyAvatar * empathy_avatar_new            (const guchar  *avatar,
42                                                const gsize    len,
43                                                const gchar   *format,
44                                                const gchar   *token);
45 EmpathyAvatar * empathy_avatar_new_from_cache (const gchar   *token);
46 EmpathyAvatar * empathy_avatar_ref            (EmpathyAvatar *avatar);
47 void            empathy_avatar_unref          (EmpathyAvatar *avatar);
48
49 G_END_DECLS
50
51 #endif /*  __EMPATHY_AVATAR_H__ */