]> git.0d.be Git - empathy.git/blob - libempathy/gossip-message.h
[darcs-to-svn @ Handling /say msg and remove useless debug messages]
[empathy.git] / libempathy / gossip-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 __GOSSIP_MESSAGE_H__
26 #define __GOSSIP_MESSAGE_H__
27
28 #include <glib-object.h>
29
30 #include "gossip-contact.h"
31 #include "gossip-time.h"
32
33 G_BEGIN_DECLS
34
35 #define GOSSIP_TYPE_MESSAGE         (gossip_message_get_gtype ())
36 #define GOSSIP_MESSAGE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GOSSIP_TYPE_MESSAGE, GossipMessage))
37 #define GOSSIP_MESSAGE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GOSSIP_TYPE_MESSAGE, GossipMessageClass))
38 #define GOSSIP_IS_MESSAGE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GOSSIP_TYPE_MESSAGE))
39 #define GOSSIP_IS_MESSAGE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GOSSIP_TYPE_MESSAGE))
40 #define GOSSIP_MESSAGE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GOSSIP_TYPE_MESSAGE, GossipMessageClass))
41
42 typedef struct _GossipMessage      GossipMessage;
43 typedef struct _GossipMessageClass GossipMessageClass;
44
45 struct _GossipMessage {
46         GObject parent;
47 };
48
49 struct _GossipMessageClass {
50         GObjectClass parent_class;
51 };
52
53 typedef enum {
54         GOSSIP_MESSAGE_TYPE_NORMAL,
55         GOSSIP_MESSAGE_TYPE_ACTION,
56         GOSSIP_MESSAGE_TYPE_NOTICE,
57         GOSSIP_MESSAGE_TYPE_AUTO_REPLY,
58         GOSSIP_MESSAGE_TYPE_LAST
59 } GossipMessageType;
60
61 GType             gossip_message_get_gtype               (void) G_GNUC_CONST;
62 GossipMessage *   gossip_message_new                     (const gchar          *body);
63 GossipMessageType gossip_message_get_type                (GossipMessage        *message);
64 void              gossip_message_set_type                (GossipMessage        *message,
65                                                           GossipMessageType     type);
66 GossipContact *   gossip_message_get_sender              (GossipMessage        *message);
67 void              gossip_message_set_sender              (GossipMessage        *message,
68                                                           GossipContact        *contact);
69 const gchar *     gossip_message_get_body                (GossipMessage        *message);
70 void              gossip_message_set_body                (GossipMessage        *message,
71                                                           const gchar          *body);
72 /* What return value should we have here? */
73 GossipTime        gossip_message_get_timestamp           (GossipMessage        *message);
74 void              gossip_message_set_timestamp           (GossipMessage        *message,
75                                                           GossipTime            timestamp);
76
77 G_END_DECLS
78
79 #endif /* __GOSSIP_MESSAGE_H__ */