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