1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2004 Imendio AB
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program 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 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #ifndef __EMPATHY_CONTACT_H__
22 #define __EMPATHY_CONTACT_H__
24 #include <glib-object.h>
26 #include <libmissioncontrol/mc-account.h>
28 #include "empathy-avatar.h"
29 #include "empathy-presence.h"
33 #define EMPATHY_TYPE_CONTACT (empathy_contact_get_gtype ())
34 #define EMPATHY_CONTACT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CONTACT, EmpathyContact))
35 #define EMPATHY_CONTACT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_CONTACT, EmpathyContactClass))
36 #define EMPATHY_IS_CONTACT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CONTACT))
37 #define EMPATHY_IS_CONTACT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_CONTACT))
38 #define EMPATHY_CONTACT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_CONTACT, EmpathyContactClass))
40 typedef struct _EmpathyContact EmpathyContact;
41 typedef struct _EmpathyContactClass EmpathyContactClass;
43 struct _EmpathyContact {
47 struct _EmpathyContactClass {
48 GObjectClass parent_class;
52 EMPATHY_SUBSCRIPTION_NONE = 0,
53 EMPATHY_SUBSCRIPTION_TO = 1 << 0, /* We send our presence to that contact */
54 EMPATHY_SUBSCRIPTION_FROM = 1 << 1, /* That contact sends his presence to us */
55 EMPATHY_SUBSCRIPTION_BOTH = EMPATHY_SUBSCRIPTION_TO | EMPATHY_SUBSCRIPTION_FROM
56 } EmpathySubscription;
58 GType empathy_contact_get_gtype (void) G_GNUC_CONST;
60 EmpathyContact * empathy_contact_new (McAccount *account);
61 EmpathyContact * empathy_contact_new_full (McAccount *account,
64 const gchar * empathy_contact_get_id (EmpathyContact *contact);
65 const gchar * empathy_contact_get_name (EmpathyContact *contact);
66 EmpathyAvatar * empathy_contact_get_avatar (EmpathyContact *contact);
67 McAccount * empathy_contact_get_account (EmpathyContact *contact);
68 EmpathyPresence * empathy_contact_get_presence (EmpathyContact *contact);
69 GList * empathy_contact_get_groups (EmpathyContact *contact);
70 EmpathySubscription empathy_contact_get_subscription (EmpathyContact *contact);
71 guint empathy_contact_get_handle (EmpathyContact *contact);
72 gboolean empathy_contact_is_user (EmpathyContact *contact);
73 void empathy_contact_set_id (EmpathyContact *contact,
75 void empathy_contact_set_name (EmpathyContact *contact,
77 void empathy_contact_set_avatar (EmpathyContact *contact,
78 EmpathyAvatar *avatar);
79 void empathy_contact_set_account (EmpathyContact *contact,
81 void empathy_contact_set_presence (EmpathyContact *contact,
82 EmpathyPresence *presence);
83 void empathy_contact_set_groups (EmpathyContact *contact,
85 void empathy_contact_set_subscription (EmpathyContact *contact,
86 EmpathySubscription subscription);
87 void empathy_contact_set_handle (EmpathyContact *contact,
89 void empathy_contact_set_is_user (EmpathyContact *contact,
91 void empathy_contact_add_group (EmpathyContact *contact,
93 void empathy_contact_remove_group (EmpathyContact *contact,
95 gboolean empathy_contact_is_online (EmpathyContact *contact);
96 gboolean empathy_contact_is_in_group (EmpathyContact *contact,
98 const gchar * empathy_contact_get_status (EmpathyContact *contact);
99 gboolean empathy_contact_equal (gconstpointer v1,
101 guint empathy_contact_hash (gconstpointer key);
105 #endif /* __EMPATHY_CONTACT_H__ */