]> git.0d.be Git - empathy.git/blob - libempathy/empathy-tp-group.h
Merge call branch from Elliot Fairweather with cleanups from Xavier Claessens.
[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 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 <libtelepathy/tp-chan.h>
29 #include <libtelepathy/tp-constants.h>
30 #include <libmissioncontrol/mc-account.h>
31
32 #include "empathy-contact.h"
33
34 G_BEGIN_DECLS
35
36 #define EMPATHY_TYPE_TP_GROUP         (empathy_tp_group_get_type ())
37 #define EMPATHY_TP_GROUP(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_TP_GROUP, EmpathyTpGroup))
38 #define EMPATHY_TP_GROUP_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_TP_GROUP, EmpathyTpGroupClass))
39 #define EMPATHY_IS_TP_GROUP(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_TP_GROUP))
40 #define EMPATHY_IS_TP_GROUP_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_TP_GROUP))
41 #define EMPATHY_TP_GROUP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_TP_GROUP, EmpathyTpGroupClass))
42
43 typedef struct _EmpathyTpGroup      EmpathyTpGroup;
44 typedef struct _EmpathyTpGroupClass EmpathyTpGroupClass;
45 typedef struct _EmpathyTpGroupPriv  EmpathyTpGroupPriv;
46
47 struct _EmpathyTpGroup {
48         GObject      parent;
49 };
50
51 struct _EmpathyTpGroupClass {
52         GObjectClass parent_class;
53 };
54
55 typedef struct {
56         EmpathyContact *member;
57         EmpathyContact *actor;
58         gchar          *message;
59         guint           reason;
60 } EmpathyPendingInfo;
61
62 GType               empathy_tp_group_get_type            (void) G_GNUC_CONST;
63 EmpathyTpGroup *    empathy_tp_group_new                 (McAccount          *account,
64                                                           TpChan             *tp_chan);
65 void                empathy_tp_group_close               (EmpathyTpGroup     *group);
66 void                empathy_tp_group_add_members         (EmpathyTpGroup     *group,
67                                                           GList              *contacts,
68                                                           const gchar        *message);
69 void                empathy_tp_group_add_member          (EmpathyTpGroup     *group,
70                                                           EmpathyContact     *contact,
71                                                           const gchar        *message);
72 void                empathy_tp_group_remove_members      (EmpathyTpGroup     *group,
73                                                           GList              *contacts,
74                                                           const gchar        *message);
75 void                empathy_tp_group_remove_member       (EmpathyTpGroup     *group,
76                                                           EmpathyContact     *contact,
77                                                           const gchar        *message);
78 GList *             empathy_tp_group_get_members         (EmpathyTpGroup     *group);
79 GList *             empathy_tp_group_get_local_pendings  (EmpathyTpGroup     *group);
80 GList *             empathy_tp_group_get_remote_pendings (EmpathyTpGroup     *group);
81 const gchar *       empathy_tp_group_get_name            (EmpathyTpGroup     *group);
82 EmpathyContact *    empathy_tp_group_get_self_contact    (EmpathyTpGroup     *group);
83 const gchar *       empathy_tp_group_get_object_path     (EmpathyTpGroup     *group);
84 gboolean            empathy_tp_group_is_member           (EmpathyTpGroup     *group,
85                                                           EmpathyContact     *contact);
86 EmpathyPendingInfo *empathy_pending_info_new             (EmpathyContact     *member,
87                                                           EmpathyContact     *actor,
88                                                           const gchar        *message);
89 void                empathy_pending_info_free            (EmpathyPendingInfo *info);
90
91 G_END_DECLS
92
93 #endif /* __EMPATHY_TP_GROUP_H__ */