]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-roster-model.h
9a211946dd35dce85c89650a2f876bba0e0c257b
[empathy.git] / libempathy-gtk / empathy-roster-model.h
1 /*
2  * empathy-roster-model.h
3  *
4  * Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20 #ifndef __EMPATHY_ROSTER_MODEL_H__
21 #define __EMPATHY_ROSTER_MODEL_H__
22
23 #include <glib-object.h>
24 #include <folks/folks.h>
25
26 G_BEGIN_DECLS
27
28 #define EMPATHY_ROSTER_MODEL_GROUP_TOP_GROUP _("Top Contacts")
29 #define EMPATHY_ROSTER_MODEL_GROUP_PEOPLE_NEARBY _("People Nearby")
30 #define EMPATHY_ROSTER_MODEL_GROUP_UNGROUPED _("Ungrouped")
31
32 typedef struct _EmpathyRosterModel EmpathyRosterModel;
33 typedef struct _EmpathyRosterModelInterface EmpathyRosterModelInterface;
34
35 struct _EmpathyRosterModelInterface
36 {
37   /*<private>*/
38   GTypeInterface g_iface;
39
40   /* Virtual table */
41   GList * (* get_individuals) (EmpathyRosterModel *self);
42   GList * (*dup_groups_for_individual) (EmpathyRosterModel *self,
43       FolksIndividual *individual);
44 };
45
46 GType empathy_roster_model_get_type (void);
47
48 /* TYPE MACROS */
49 #define EMPATHY_TYPE_ROSTER_MODEL \
50   (empathy_roster_model_get_type ())
51 #define EMPATHY_ROSTER_MODEL(obj) \
52   (G_TYPE_CHECK_INSTANCE_CAST((obj), \
53     EMPATHY_TYPE_ROSTER_MODEL, \
54     EmpathyRosterModel))
55 #define EMPATHY_IS_ROSTER_MODEL(obj) \
56   (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
57     EMPATHY_TYPE_ROSTER_MODEL))
58 #define EMPATHY_ROSTER_MODEL_GET_IFACE(obj) \
59   (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
60     EMPATHY_TYPE_ROSTER_MODEL, \
61     EmpathyRosterModelInterface))
62
63 /* Restricted */
64
65 void empathy_roster_model_fire_individual_added (EmpathyRosterModel *self,
66     FolksIndividual *individual);
67
68 void empathy_roster_model_fire_individual_removed (EmpathyRosterModel *self,
69     FolksIndividual *individual);
70
71 void empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self,
72     FolksIndividual *individual,
73     const gchar *group,
74     gboolean is_member);
75
76 /* Public API */
77 GList * empathy_roster_model_get_individuals (EmpathyRosterModel *self);
78
79 GList * empathy_roster_model_dup_groups_for_individual (
80     EmpathyRosterModel *self,
81     FolksIndividual *individual);
82
83 G_END_DECLS
84
85 #endif /* #ifndef __EMPATHY_ROSTER_MODEL_H__*/