]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-roster-model.h
Added top_group_members list in model, view relying on it
[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
25 #include <folks/folks.h>
26
27 #include <libempathy-gtk/empathy-roster-contact.h>
28
29 G_BEGIN_DECLS
30
31 #define EMPATHY_ROSTER_MODEL_GROUP_TOP_GROUP _("Top Contacts")
32 #define EMPATHY_ROSTER_MODEL_GROUP_PEOPLE_NEARBY _("People Nearby")
33 #define EMPATHY_ROSTER_MODEL_GROUP_UNGROUPED _("Ungrouped")
34
35 typedef struct _EmpathyRosterModel EmpathyRosterModel;
36 typedef struct _EmpathyRosterModelInterface EmpathyRosterModelInterface;
37
38 struct _EmpathyRosterModelInterface
39 {
40   /*<private>*/
41   GTypeInterface g_iface;
42
43   /* Virtual table */
44   GList * (* get_individuals) (EmpathyRosterModel *self);
45   GList * (*get_groups_for_individual) (EmpathyRosterModel *self,
46       FolksIndividual *individual);
47   GList * (*get_top_individuals) (EmpathyRosterModel *self);
48   gboolean (*contact_in_top) (EmpathyRosterModel *self,
49       EmpathyRosterContact *contact);
50 };
51
52 GType empathy_roster_model_get_type (void);
53
54 /* TYPE MACROS */
55 #define EMPATHY_TYPE_ROSTER_MODEL \
56   (empathy_roster_model_get_type ())
57 #define EMPATHY_ROSTER_MODEL(obj) \
58   (G_TYPE_CHECK_INSTANCE_CAST((obj), \
59     EMPATHY_TYPE_ROSTER_MODEL, \
60     EmpathyRosterModel))
61 #define EMPATHY_IS_ROSTER_MODEL(obj) \
62   (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
63     EMPATHY_TYPE_ROSTER_MODEL))
64 #define EMPATHY_ROSTER_MODEL_GET_IFACE(obj) \
65   (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
66     EMPATHY_TYPE_ROSTER_MODEL, \
67     EmpathyRosterModelInterface))
68
69 /* Restricted */
70
71 void empathy_roster_model_fire_individual_added (EmpathyRosterModel *self,
72     FolksIndividual *individual);
73
74 void empathy_roster_model_fire_individual_removed (EmpathyRosterModel *self,
75     FolksIndividual *individual);
76
77 void empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self,
78     FolksIndividual *individual,
79     const gchar *group,
80     gboolean is_member);
81
82 /* Public API */
83 GList * empathy_roster_model_get_individuals (EmpathyRosterModel *self);
84
85 GList * empathy_roster_model_get_groups_for_individual (
86     EmpathyRosterModel *self,
87     FolksIndividual *individual);
88
89 GList * empathy_roster_model_get_top_individuals (EmpathyRosterModel *self);
90
91 gboolean empathy_roster_model_contact_in_top (EmpathyRosterModel *self,
92     EmpathyRosterContact *contact);
93
94 G_END_DECLS
95
96 #endif /* #ifndef __EMPATHY_ROSTER_MODEL_H__*/