]> git.0d.be Git - empathy.git/blob - libempathy/empathy-message.h
Rename all filenames starting with "gossip" by "empathy", change namespace
[empathy.git] / libempathy / empathy-message.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2004-2007 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  *          Xavier Claessens <xclaesse@gmail.com>
23  */
24
25 #ifndef __EMPATHY_MESSAGE_H__
26 #define __EMPATHY_MESSAGE_H__
27
28 #include <glib-object.h>
29
30 #include "empathy-contact.h"
31 #include "empathy-time.h"
32
33 G_BEGIN_DECLS
34
35 #define EMPATHY_TYPE_MESSAGE         (empathy_message_get_gtype ())
36 #define EMPATHY_MESSAGE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_MESSAGE, EmpathyMessage))
37 #define EMPATHY_MESSAGE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_MESSAGE, EmpathyMessageClass))
38 #define EMPATHY_IS_MESSAGE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_MESSAGE))
39 #define EMPATHY_IS_MESSAGE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_MESSAGE))
40 #define EMPATHY_MESSAGE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_MESSAGE, EmpathyMessageClass))
41
42 typedef struct _EmpathyMessage      EmpathyMessage;
43 typedef struct _EmpathyMessageClass EmpathyMessageClass;
44
45 struct _EmpathyMessage {
46         GObject parent;
47 };
48
49 struct _EmpathyMessageClass {
50         GObjectClass parent_class;
51 };
52
53 typedef enum {
54         EMPATHY_MESSAGE_TYPE_NORMAL,
55         EMPATHY_MESSAGE_TYPE_ACTION,
56         EMPATHY_MESSAGE_TYPE_NOTICE,
57         EMPATHY_MESSAGE_TYPE_AUTO_REPLY,
58         EMPATHY_MESSAGE_TYPE_LAST
59 } EmpathyMessageType;
60
61 GType             empathy_message_get_gtype               (void) G_GNUC_CONST;
62 EmpathyMessage *   empathy_message_new                     (const gchar          *body);
63 EmpathyMessageType empathy_message_get_type                (EmpathyMessage        *message);
64 void              empathy_message_set_type                (EmpathyMessage        *message,
65                                                           EmpathyMessageType     type);
66 EmpathyContact *   empathy_message_get_sender              (EmpathyMessage        *message);
67 void              empathy_message_set_sender              (EmpathyMessage        *message,
68                                                           EmpathyContact        *contact);
69 EmpathyContact *   empathy_message_get_receiver            (EmpathyMessage        *message);
70 void              empathy_message_set_receiver            (EmpathyMessage        *message,
71                                                           EmpathyContact        *contact);
72 const gchar *     empathy_message_get_body                (EmpathyMessage        *message);
73 void              empathy_message_set_body                (EmpathyMessage        *message,
74                                                           const gchar          *body);
75 /* What return value should we have here? */
76 EmpathyTime        empathy_message_get_timestamp           (EmpathyMessage        *message);
77 void              empathy_message_set_timestamp           (EmpathyMessage        *message,
78                                                           EmpathyTime            timestamp);
79
80 G_END_DECLS
81
82 #endif /* __EMPATHY_MESSAGE_H__ */