]> git.0d.be Git - empathy.git/blob - libempathy/empathy-tp-group.h
empathy-tube-handler: wait that tube is ready before announcing it
[empathy.git] / libempathy / empathy-tp-group.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2006 Xavier Claessens <xclaesse@gmail.com>
4  * Copyright (C) 2007-2008 Collabora Ltd.
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  * Authors: Xavier Claessens <xclaesse@gmail.com>
21  */
22
23 #ifndef __EMPATHY_TP_GROUP_H__
24 #define __EMPATHY_TP_GROUP_H__
25
26 #include <glib.h>
27
28 #include <telepathy-glib/channel.h>
29
30 #include "empathy-contact.h"
31
32 G_BEGIN_DECLS
33
34 #define EMPATHY_TYPE_TP_GROUP         (empathy_tp_group_get_type ())
35 #define EMPATHY_TP_GROUP(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_TP_GROUP, EmpathyTpGroup))
36 #define EMPATHY_TP_GROUP_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_TP_GROUP, EmpathyTpGroupClass))
37 #define EMPATHY_IS_TP_GROUP(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_TP_GROUP))
38 #define EMPATHY_IS_TP_GROUP_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_TP_GROUP))
39 #define EMPATHY_TP_GROUP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_TP_GROUP, EmpathyTpGroupClass))
40
41 typedef struct _EmpathyTpGroup      EmpathyTpGroup;
42 typedef struct _EmpathyTpGroupClass EmpathyTpGroupClass;
43
44 struct _EmpathyTpGroup {
45         GObject parent;
46         gpointer priv;
47 };
48
49 struct _EmpathyTpGroupClass {
50         GObjectClass parent_class;
51 };
52
53 typedef struct {
54         EmpathyContact *member;
55         EmpathyContact *actor;
56         gchar          *message;
57         guint           reason;
58 } EmpathyPendingInfo;
59
60 GType               empathy_tp_group_get_type            (void) G_GNUC_CONST;
61 EmpathyTpGroup *    empathy_tp_group_new                 (TpChannel          *channel);
62 void                empathy_tp_group_close               (EmpathyTpGroup     *group);
63 void                empathy_tp_group_add_members         (EmpathyTpGroup     *group,
64                                                           GList              *contacts,
65                                                           const gchar        *message);
66 void                empathy_tp_group_add_member          (EmpathyTpGroup     *group,
67                                                           EmpathyContact     *contact,
68                                                           const gchar        *message);
69 void                empathy_tp_group_remove_members      (EmpathyTpGroup     *group,
70                                                           GList              *contacts,
71                                                           const gchar        *message);
72 void                empathy_tp_group_remove_member       (EmpathyTpGroup     *group,
73                                                           EmpathyContact     *contact,
74                                                           const gchar        *message);
75 GList *             empathy_tp_group_get_members         (EmpathyTpGroup     *group);
76 GList *             empathy_tp_group_get_local_pendings  (EmpathyTpGroup     *group);
77 GList *             empathy_tp_group_get_remote_pendings (EmpathyTpGroup     *group);
78 const gchar *       empathy_tp_group_get_name            (EmpathyTpGroup     *group);
79 EmpathyContact *    empathy_tp_group_get_self_contact    (EmpathyTpGroup     *group);
80 gboolean            empathy_tp_group_is_member           (EmpathyTpGroup     *group,
81                                                           EmpathyContact     *contact);
82 gboolean            empathy_tp_group_is_ready            (EmpathyTpGroup     *group);
83 EmpathyPendingInfo *empathy_tp_group_get_invitation      (EmpathyTpGroup     *group,
84                                                           EmpathyContact    **remote_contact);
85 EmpathyPendingInfo *empathy_pending_info_new             (EmpathyContact     *member,
86                                                           EmpathyContact     *actor,
87                                                           const gchar        *message);
88 void                empathy_pending_info_free            (EmpathyPendingInfo *info);
89 TpChannelGroupFlags empathy_tp_group_get_flags           (EmpathyTpGroup     *group);
90
91 G_END_DECLS
92
93 #endif /* __EMPATHY_TP_GROUP_H__ */