]> git.0d.be Git - empathy.git/blob - libempathy/empathy-contact-list.h
Completely reworked ContactList API. Fixes bug #471611, bug #467280, bug #459540...
[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 #include "empathy-tp-group.h"
30
31 G_BEGIN_DECLS
32
33 #define EMPATHY_TYPE_CONTACT_LIST         (empathy_contact_list_get_type ())
34 #define EMPATHY_CONTACT_LIST(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CONTACT_LIST, EmpathyContactList))
35 #define EMPATHY_IS_CONTACT_LIST(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CONTACT_LIST))
36 #define EMPATHY_CONTACT_LIST_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), EMPATHY_TYPE_CONTACT_LIST, EmpathyContactListIface))
37
38 typedef struct _EmpathyContactList      EmpathyContactList;
39 typedef struct _EmpathyContactListIface EmpathyContactListIface;
40
41 struct _EmpathyContactListIface {
42         GTypeInterface   base_iface;
43
44         /* VTabled */
45         void             (*add)               (EmpathyContactList *list,
46                                                EmpathyContact     *contact,
47                                                const gchar        *message);
48         void             (*remove)            (EmpathyContactList *list,
49                                                EmpathyContact     *contact,
50                                                const gchar        *message);
51         GList *          (*get_members)       (EmpathyContactList *list);
52         GList *          (*get_pendings)      (EmpathyContactList *list);
53         GList *          (*get_all_groups)    (EmpathyContactList *list);
54         GList *          (*get_groups)        (EmpathyContactList *list,
55                                                EmpathyContact     *contact);
56         void             (*add_to_group)      (EmpathyContactList *list,
57                                                EmpathyContact     *contact,
58                                                const gchar        *group);
59         void             (*remove_from_group) (EmpathyContactList *list,
60                                                EmpathyContact     *contact,
61                                                const gchar        *group);
62         void             (*rename_group)      (EmpathyContactList *list,
63                                                const gchar        *old_group,
64                                                const gchar        *new_group);
65 };
66
67 GType    empathy_contact_list_get_type          (void) G_GNUC_CONST;
68 void     empathy_contact_list_add               (EmpathyContactList *list,
69                                                  EmpathyContact     *contact,
70                                                  const gchar        *message);
71 void     empathy_contact_list_remove            (EmpathyContactList *list,
72                                                  EmpathyContact     *contact,
73                                                  const gchar        *message);
74 GList *  empathy_contact_list_get_members       (EmpathyContactList *list);
75 GList *  empathy_contact_list_get_pendings      (EmpathyContactList *list);
76 GList *  empathy_contact_list_get_all_groups    (EmpathyContactList *list);
77 GList *  empathy_contact_list_get_groups        (EmpathyContactList *list,
78                                                  EmpathyContact     *contact);
79 void     empathy_contact_list_add_to_group      (EmpathyContactList *list,
80                                                  EmpathyContact     *contact,
81                                                  const gchar        *group);
82 void     empathy_contact_list_remove_from_group (EmpathyContactList *list,
83                                                  EmpathyContact     *contact,
84                                                  const gchar        *group);
85 void     empathy_contact_list_rename_group      (EmpathyContactList *list,
86                                                  const gchar        *old_group,
87                                                  const gchar        *new_group);
88
89 G_END_DECLS
90
91 #endif /* __EMPATHY_CONTACT_LIST_H__ */
92