]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-tp-group.h
Completely reworked ContactList API. Fixes bug #471611, bug #467280, bug #459540...
[empathy.git] / libempathy / empathy-tp-group.h
index 5ea7bfc710f092ba1daf2fa89eef0c93f995c621..14cbd4649992b6b5d51908278cbc76a27bb645de 100644 (file)
@@ -1,6 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2006 Xavier Claessens <xclaesse@gmail.com>
+ * Copyright (C) 2007 Collabora Ltd.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -16,6 +17,8 @@
  * License along with this program; if not, write to the
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
+ *
+ * Authors: Xavier Claessens <xclaesse@gmail.com>
  */
 
 #ifndef __EMPATHY_TP_GROUP_H__
 #include <glib.h>
 
 #include <libtelepathy/tp-chan.h>
+#include <libtelepathy/tp-constants.h>
 #include <libmissioncontrol/mc-account.h>
 
+#include "empathy-contact.h"
+
 G_BEGIN_DECLS
 
 #define EMPATHY_TYPE_TP_GROUP         (empathy_tp_group_get_type ())
@@ -48,39 +54,40 @@ struct _EmpathyTpGroupClass {
 };
 
 typedef struct {
-       guint  member;
-       guint  actor;
-       guint  reason;
-       gchar *message;
-} EmpathyTpGroupInfo;
+       EmpathyContact *member;
+       EmpathyContact *actor;
+       gchar          *message;
+       guint           reason;
+} EmpathyPendingInfo;
 
-GType            empathy_tp_group_get_type                            (void) G_GNUC_CONST;
-EmpathyTpGroup * empathy_tp_group_new                                 (McAccount       *account,
-                                                                      TpChan          *tp_chan);
-void             empathy_tp_group_add_members                         (EmpathyTpGroup  *group,
-                                                                      GArray          *handles,
-                                                                      const gchar     *message);
-void             empathy_tp_group_add_member                          (EmpathyTpGroup  *group,
-                                                                      guint            handle,
-                                                                      const gchar     *message);
-void             empathy_tp_group_remove_members                      (EmpathyTpGroup  *group,
-                                                                      GArray          *handle,
-                                                                      const gchar     *message);
-void             empathy_tp_group_remove_member                       (EmpathyTpGroup  *group,
-                                                                      guint            handle,
-                                                                      const gchar     *message);
-GArray *         empathy_tp_group_get_members                         (EmpathyTpGroup  *group);
-void             empathy_tp_group_get_all_members                     (EmpathyTpGroup  *group,
-                                                                      GArray         **members,
-                                                                      GArray         **local_pending,
-                                                                      GArray         **remote_pending);
-GList *          empathy_tp_group_get_local_pending_members_with_info (EmpathyTpGroup  *group);
-void             empathy_tp_group_info_list_free                      (GList           *infos);
-const gchar *    empathy_tp_group_get_name                            (EmpathyTpGroup  *group);
-guint            empathy_tp_group_get_self_handle                     (EmpathyTpGroup  *group);
-const gchar *    empathy_tp_group_get_object_path                     (EmpathyTpGroup  *group);
-gboolean         empathy_tp_group_is_member                           (EmpathyTpGroup  *group,
-                                                                      guint            handle);
+GType               empathy_tp_group_get_type            (void) G_GNUC_CONST;
+EmpathyTpGroup *    empathy_tp_group_new                 (McAccount          *account,
+                                                         TpChan             *tp_chan);
+void                empathy_tp_group_close               (EmpathyTpGroup     *group);
+void                empathy_tp_group_add_members         (EmpathyTpGroup     *group,
+                                                         GList              *contacts,
+                                                         const gchar        *message);
+void                empathy_tp_group_add_member          (EmpathyTpGroup     *group,
+                                                         EmpathyContact     *contact,
+                                                         const gchar        *message);
+void                empathy_tp_group_remove_members      (EmpathyTpGroup     *group,
+                                                         GList              *contacts,
+                                                         const gchar        *message);
+void                empathy_tp_group_remove_member       (EmpathyTpGroup     *group,
+                                                         EmpathyContact     *contact,
+                                                         const gchar        *message);
+GList *             empathy_tp_group_get_members         (EmpathyTpGroup     *group);
+GList *             empathy_tp_group_get_local_pendings  (EmpathyTpGroup     *group);
+GList *             empathy_tp_group_get_remote_pendings (EmpathyTpGroup     *group);
+const gchar *       empathy_tp_group_get_name            (EmpathyTpGroup     *group);
+EmpathyContact *    empathy_tp_group_get_self_contact    (EmpathyTpGroup     *group);
+const gchar *       empathy_tp_group_get_object_path     (EmpathyTpGroup     *group);
+gboolean            empathy_tp_group_is_member           (EmpathyTpGroup     *group,
+                                                         EmpathyContact     *contact);
+EmpathyPendingInfo *empathy_pending_info_new             (EmpathyContact     *member,
+                                                         EmpathyContact     *actor,
+                                                         const gchar        *message);
+void                empathy_pending_info_free            (EmpathyPendingInfo *info);
 
 G_END_DECLS