]> git.0d.be Git - empathy.git/blob - libempathy/empathy-contact.h
Merge call branch from Elliot Fairweather with cleanups from Xavier Claessens.
[empathy.git] / libempathy / empathy-contact.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2004 Imendio AB
4  * Copyright (C) 2007 Collabora Ltd.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program 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  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  * Authors: Mikael Hallendal <micke@imendio.com>
22  *          Martyn Russell <martyn@imendio.com>
23  *          Xavier Claessens <xclaesse@gmail.com>
24  */
25
26 #ifndef __EMPATHY_CONTACT_H__
27 #define __EMPATHY_CONTACT_H__
28
29 #include <glib-object.h>
30
31 #include <libmissioncontrol/mc-account.h>
32 #include <libmissioncontrol/mission-control.h>
33
34 #include "empathy-avatar.h"
35
36 G_BEGIN_DECLS
37
38 #define EMPATHY_TYPE_CONTACT         (empathy_contact_get_type ())
39 #define EMPATHY_CONTACT(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CONTACT, EmpathyContact))
40 #define EMPATHY_CONTACT_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_CONTACT, EmpathyContactClass))
41 #define EMPATHY_IS_CONTACT(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CONTACT))
42 #define EMPATHY_IS_CONTACT_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_CONTACT))
43 #define EMPATHY_CONTACT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_CONTACT, EmpathyContactClass))
44
45 typedef struct _EmpathyContact      EmpathyContact;
46 typedef struct _EmpathyContactClass EmpathyContactClass;
47
48 struct _EmpathyContact {
49         GObject parent;
50 };
51
52 struct _EmpathyContactClass {
53         GObjectClass parent_class;
54 };
55
56 typedef enum {
57         EMPATHY_CAPABILITIES_AUDIO = 1 << 0,
58         EMPATHY_CAPABILITIES_VIDEO = 1 << 1,
59 } EmpathyCapabilities;
60
61 GType               empathy_contact_get_type           (void) G_GNUC_CONST;
62 EmpathyContact *    empathy_contact_new                (McAccount           *account);
63 EmpathyContact *    empathy_contact_new_full           (McAccount           *account,
64                                                         const gchar         *id,
65                                                         const gchar         *name);
66 const gchar *       empathy_contact_get_id             (EmpathyContact      *contact);
67 void                empathy_contact_set_id             (EmpathyContact      *contact,
68                                                         const gchar         *id);
69 const gchar *       empathy_contact_get_name           (EmpathyContact      *contact);
70 void                empathy_contact_set_name           (EmpathyContact      *contact,
71                                                         const gchar         *name);
72 EmpathyAvatar *     empathy_contact_get_avatar         (EmpathyContact      *contact);
73 void                empathy_contact_set_avatar         (EmpathyContact      *contact,
74                                                         EmpathyAvatar       *avatar);
75 McAccount *         empathy_contact_get_account        (EmpathyContact      *contact);
76 void                empathy_contact_set_account        (EmpathyContact      *contact,
77                                                         McAccount           *account);
78 McPresence          empathy_contact_get_presence       (EmpathyContact      *contact);
79 void                empathy_contact_set_presence       (EmpathyContact      *contact,
80                                                         McPresence           presence);
81 const gchar *       empathy_contact_get_presence_message (EmpathyContact    *contact);
82 void                empathy_contact_set_presence_message (EmpathyContact    *contact,
83                                                         const gchar         *message);
84 guint               empathy_contact_get_handle         (EmpathyContact      *contact);
85 void                empathy_contact_set_handle         (EmpathyContact      *contact,
86                                                         guint                handle);
87 EmpathyCapabilities empathy_contact_get_capabilities   (EmpathyContact      *contact);
88 void                empathy_contact_set_capabilities   (EmpathyContact      *contact,
89                                                         EmpathyCapabilities  capabilities);
90 gboolean            empathy_contact_is_user            (EmpathyContact      *contact);
91 void                empathy_contact_set_is_user        (EmpathyContact      *contact,
92                                                         gboolean             is_user);
93 gboolean            empathy_contact_is_online          (EmpathyContact      *contact);
94 const gchar *       empathy_contact_get_status         (EmpathyContact      *contact);
95 gboolean            empathy_contact_can_voip           (EmpathyContact      *contact);
96 gboolean            empathy_contact_equal              (gconstpointer        v1,
97                                                         gconstpointer        v2);
98 guint               empathy_contact_hash               (gconstpointer        key);
99
100 G_END_DECLS
101
102 #endif /* __EMPATHY_CONTACT_H__ */
103