]> git.0d.be Git - empathy.git/blob - libempathy/empathy-contact.h
Rename all filenames starting with "gossip" by "empathy", change namespace
[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  *
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.
9  *
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.
14  *
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.
19  */
20
21 #ifndef __EMPATHY_CONTACT_H__
22 #define __EMPATHY_CONTACT_H__
23
24 #include <glib-object.h>
25
26 #include <libmissioncontrol/mc-account.h>
27
28 #include "empathy-avatar.h"
29 #include "empathy-presence.h"
30
31 G_BEGIN_DECLS
32
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))
39
40 typedef struct _EmpathyContact      EmpathyContact;
41 typedef struct _EmpathyContactClass EmpathyContactClass;
42
43 struct _EmpathyContact {
44         GObject parent;
45 };
46
47 struct _EmpathyContactClass {
48         GObjectClass parent_class;
49 };
50
51 typedef enum {
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;
57
58 GType              empathy_contact_get_gtype                 (void) G_GNUC_CONST;
59
60 EmpathyContact *    empathy_contact_new                       (McAccount          *account);
61 EmpathyContact *    empathy_contact_new_full                  (McAccount          *account,
62                                                              const gchar        *id,
63                                                              const gchar        *name);
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,
74                                                              const gchar        *id);
75 void               empathy_contact_set_name                  (EmpathyContact      *contact,
76                                                              const gchar        *name);
77 void               empathy_contact_set_avatar                (EmpathyContact      *contact,
78                                                              EmpathyAvatar       *avatar);
79 void               empathy_contact_set_account               (EmpathyContact      *contact,
80                                                              McAccount          *account);
81 void               empathy_contact_set_presence              (EmpathyContact      *contact,
82                                                              EmpathyPresence     *presence);
83 void               empathy_contact_set_groups                (EmpathyContact      *contact,
84                                                              GList              *categories);
85 void               empathy_contact_set_subscription          (EmpathyContact      *contact,
86                                                              EmpathySubscription  subscription);
87 void               empathy_contact_set_handle                (EmpathyContact      *contact,
88                                                              guint               handle);
89 void               empathy_contact_set_is_user               (EmpathyContact      *contact,
90                                                              gboolean            is_user);
91 void               empathy_contact_add_group                 (EmpathyContact      *contact,
92                                                              const gchar        *group);
93 void               empathy_contact_remove_group              (EmpathyContact      *contact,
94                                                              const gchar        *group);
95 gboolean           empathy_contact_is_online                 (EmpathyContact      *contact);
96 gboolean           empathy_contact_is_in_group               (EmpathyContact      *contact,
97                                                              const gchar        *group);
98 const gchar *      empathy_contact_get_status                (EmpathyContact      *contact);
99 gboolean           empathy_contact_equal                     (gconstpointer       v1,
100                                                              gconstpointer       v2);
101 guint              empathy_contact_hash                      (gconstpointer       key);
102
103 G_END_DECLS
104
105 #endif /* __EMPATHY_CONTACT_H__ */
106