1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2004-2007 Imendio AB
4 * Copyright (C) 2007 Collabora Ltd.
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.
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.
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.
21 * Authors: Mikael Hallendal <micke@imendio.com>
22 * Xavier Claessens <xclaesse@gmail.com>
25 #ifndef __GOSSIP_MESSAGE_H__
26 #define __GOSSIP_MESSAGE_H__
28 #include <glib-object.h>
30 #include "gossip-contact.h"
31 #include "gossip-time.h"
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))
42 typedef struct _GossipMessage GossipMessage;
43 typedef struct _GossipMessageClass GossipMessageClass;
45 struct _GossipMessage {
49 struct _GossipMessageClass {
50 GObjectClass parent_class;
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
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,
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);
79 #endif /* __GOSSIP_MESSAGE_H__ */