]> git.0d.be Git - empathy.git/blob - libempathy/empathy-contact-list.h
Rename all filenames starting with "gossip" by "empathy", change namespace
[empathy.git] / libempathy / empathy-contact-list.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2007 Collabora Ltd.
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  * Authors: Xavier Claessens <xclaesse@gmail.com>
21  */
22
23 #ifndef __EMPATHY_CONTACT_LIST_H__
24 #define __EMPATHY_CONTACT_LIST_H__
25
26 #include <glib-object.h>
27
28 #include "empathy-contact.h"
29
30 G_BEGIN_DECLS
31
32 #define EMPATHY_TYPE_CONTACT_LIST         (empathy_contact_list_get_type ())
33 #define EMPATHY_CONTACT_LIST(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CONTACT_LIST, EmpathyContactList))
34 #define EMPATHY_IS_CONTACT_LIST(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CONTACT_LIST))
35 #define EMPATHY_CONTACT_LIST_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), EMPATHY_TYPE_CONTACT_LIST, EmpathyContactListIface))
36
37 typedef struct _EmpathyContactList      EmpathyContactList;
38 typedef struct _EmpathyContactListIface EmpathyContactListIface;
39
40 typedef struct {
41         EmpathyContact *contact;
42         gchar         *message;
43 } EmpathyContactListInfo;
44
45 struct _EmpathyContactListIface {
46         GTypeInterface   base_iface;
47
48         /* VTabled */
49         void            (*setup)             (EmpathyContactList *list);
50         EmpathyContact * (*find)              (EmpathyContactList *list,
51                                               const gchar        *id);
52         void            (*add)               (EmpathyContactList *list,
53                                               EmpathyContact      *contact,
54                                               const gchar        *message);
55         void            (*remove)            (EmpathyContactList *list,
56                                               EmpathyContact      *contact,
57                                               const gchar        *message);
58         GList *         (*get_members)       (EmpathyContactList *list);
59         GList *         (*get_local_pending) (EmpathyContactList *list);
60         void            (*process_pending)   (EmpathyContactList *list,
61                                               EmpathyContact      *contact,
62                                               gboolean            accept);
63 };
64
65 GType                   empathy_contact_list_get_type          (void) G_GNUC_CONST;
66 EmpathyContactListInfo *empathy_contact_list_info_new          (EmpathyContact          *contact,
67                                                                 const gchar            *message);
68 void                    empathy_contact_list_info_free         (EmpathyContactListInfo *info);
69 void                    empathy_contact_list_setup             (EmpathyContactList     *list);
70 EmpathyContact *         empathy_contact_list_find              (EmpathyContactList     *list,
71                                                                 const gchar            *id);
72 void                    empathy_contact_list_add               (EmpathyContactList     *list,
73                                                                 EmpathyContact          *contact,
74                                                                 const gchar            *message);
75 void                    empathy_contact_list_remove            (EmpathyContactList     *list,
76                                                                 EmpathyContact          *contact,
77                                                                 const gchar            *message);
78 GList *                 empathy_contact_list_get_members       (EmpathyContactList     *list);
79 GList *                 empathy_contact_list_get_local_pending (EmpathyContactList     *list);
80 void                    empathy_contact_list_process_pending   (EmpathyContactList     *list,
81                                                                 EmpathyContact          *contact,
82                                                                 gboolean                accept);
83
84 G_END_DECLS
85
86 #endif /* __EMPATHY_CONTACT_LIST_H__ */
87