]> git.0d.be Git - empathy.git/blob - libempathy/empathy-contact-list.h
Updated Persian translation
[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-2008 Collabora Ltd.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library 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  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  *
19  * Authors: Xavier Claessens <xclaesse@gmail.com>
20  */
21
22 #ifndef __EMPATHY_CONTACT_LIST_H__
23 #define __EMPATHY_CONTACT_LIST_H__
24
25 #include <glib-object.h>
26
27 #include "empathy-types.h"
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 enum {
38         EMPATHY_CONTACT_LIST_CAN_ADD            = 1 << 0,
39         EMPATHY_CONTACT_LIST_CAN_REMOVE         = 1 << 1,
40         EMPATHY_CONTACT_LIST_CAN_ALIAS          = 1 << 2,
41         EMPATHY_CONTACT_LIST_CAN_GROUP          = 1 << 3,
42         EMPATHY_CONTACT_LIST_CAN_BLOCK          = 1 << 4,
43         EMPATHY_CONTACT_LIST_CAN_REPORT_ABUSIVE = 1 << 5,
44 } EmpathyContactListFlags;
45
46 typedef struct _EmpathyContactListIface EmpathyContactListIface;
47
48 struct _EmpathyContactListIface {
49         GTypeInterface   base_iface;
50
51         /* VTabled */
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_pendings)      (EmpathyContactList *list);
60         GList *          (*get_all_groups)    (EmpathyContactList *list);
61         GList *          (*get_groups)        (EmpathyContactList *list,
62                                                EmpathyContact     *contact);
63         void             (*add_to_group)      (EmpathyContactList *list,
64                                                EmpathyContact     *contact,
65                                                const gchar        *group);
66         void             (*remove_from_group) (EmpathyContactList *list,
67                                                EmpathyContact     *contact,
68                                                const gchar        *group);
69         void             (*rename_group)      (EmpathyContactList *list,
70                                                const gchar        *old_group,
71                                                const gchar        *new_group);
72         void             (*remove_group)      (EmpathyContactList *list,
73                                                const gchar        *group);
74         EmpathyContactListFlags
75                          (*get_flags)         (EmpathyContactList *list);
76         gboolean         (*is_favourite)      (EmpathyContactList *list,
77                                                EmpathyContact     *contact);
78         void             (*add_favourite)     (EmpathyContactList *list,
79                                                EmpathyContact     *contact);
80         void             (*remove_favourite)  (EmpathyContactList *list,
81                                                EmpathyContact     *contact);
82         void             (*set_blocked)       (EmpathyContactList *list,
83                                                EmpathyContact     *contact,
84                                                gboolean            blocked,
85                                                gboolean            abusive);
86         gboolean         (*get_blocked)       (EmpathyContactList *list,
87                                                EmpathyContact     *contact);
88 };
89
90 GType    empathy_contact_list_get_type          (void) G_GNUC_CONST;
91 void     empathy_contact_list_add               (EmpathyContactList *list,
92                                                  EmpathyContact     *contact,
93                                                  const gchar        *message);
94 void     empathy_contact_list_remove            (EmpathyContactList *list,
95                                                  EmpathyContact     *contact,
96                                                  const gchar        *message);
97 GList *  empathy_contact_list_get_members       (EmpathyContactList *list);
98 GList *  empathy_contact_list_get_pendings      (EmpathyContactList *list);
99 GList *  empathy_contact_list_get_all_groups    (EmpathyContactList *list);
100 GList *  empathy_contact_list_get_groups        (EmpathyContactList *list,
101                                                  EmpathyContact     *contact);
102 void     empathy_contact_list_add_to_group      (EmpathyContactList *list,
103                                                  EmpathyContact     *contact,
104                                                  const gchar        *group);
105 void     empathy_contact_list_remove_from_group (EmpathyContactList *list,
106                                                  EmpathyContact     *contact,
107                                                  const gchar        *group);
108 void     empathy_contact_list_rename_group      (EmpathyContactList *list,
109                                                  const gchar        *old_group,
110                                                  const gchar        *new_group);
111 void     empathy_contact_list_remove_group      (EmpathyContactList *list,
112                                                  const gchar        *group);
113
114 EmpathyContactListFlags
115          empathy_contact_list_get_flags         (EmpathyContactList *list);
116
117 gboolean empathy_contact_list_is_favourite      (EmpathyContactList *list,
118                                                  EmpathyContact     *contact);
119
120 void     empathy_contact_list_add_to_favourites (EmpathyContactList *list,
121                                                  EmpathyContact     *contact);
122
123 void     empathy_contact_list_remove_from_favourites
124                                                 (EmpathyContactList *list,
125                                                  EmpathyContact     *contact);
126
127 void     empathy_contact_list_set_blocked       (EmpathyContactList *list,
128                                                  EmpathyContact     *contact,
129                                                  gboolean            blocked,
130                                                  gboolean            abusive);
131 gboolean empathy_contact_list_get_blocked       (EmpathyContactList *list,
132                                                  EmpathyContact     *contact);
133
134
135 G_END_DECLS
136
137 #endif /* __EMPATHY_CONTACT_LIST_H__ */
138