]> git.0d.be Git - empathy.git/blob - libempathy/empathy-message.h
Updated Polish translation
[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-2008 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., 51 Franklin St, Fifth Floor,
19  * Boston, MA  02110-1301  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 #ifdef ENABLE_TPL
30 #include <telepathy-logger/log-entry.h>
31 #endif
32
33 #include "empathy-contact.h"
34 #include "empathy-time.h"
35
36 G_BEGIN_DECLS
37
38 #define EMPATHY_TYPE_MESSAGE         (empathy_message_get_type ())
39 #define EMPATHY_MESSAGE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_MESSAGE, EmpathyMessage))
40 #define EMPATHY_MESSAGE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_MESSAGE, EmpathyMessageClass))
41 #define EMPATHY_IS_MESSAGE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_MESSAGE))
42 #define EMPATHY_IS_MESSAGE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_MESSAGE))
43 #define EMPATHY_MESSAGE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_MESSAGE, EmpathyMessageClass))
44
45 typedef struct _EmpathyMessage      EmpathyMessage;
46 typedef struct _EmpathyMessageClass EmpathyMessageClass;
47
48 struct _EmpathyMessage {
49         GObject parent;
50         gpointer priv;
51 };
52
53 struct _EmpathyMessageClass {
54         GObjectClass parent_class;
55 };
56
57 GType                    empathy_message_get_type          (void) G_GNUC_CONST;
58 EmpathyMessage *         empathy_message_new               (const gchar              *body);
59 #ifdef ENABLE_TPL
60 EmpathyMessage *         empathy_message_from_tpl_log_entry (TplLogEntry             *logentry);
61 #endif /* ENABLE_TPL */
62 TpChannelTextMessageType empathy_message_get_tptype        (EmpathyMessage           *message);
63 void                     empathy_message_set_tptype        (EmpathyMessage           *message,
64                                                             TpChannelTextMessageType  type);
65 EmpathyContact *         empathy_message_get_sender        (EmpathyMessage           *message);
66 void                     empathy_message_set_sender        (EmpathyMessage           *message,
67                                                             EmpathyContact           *contact);
68 EmpathyContact *         empathy_message_get_receiver      (EmpathyMessage           *message);
69 void                     empathy_message_set_receiver      (EmpathyMessage           *message,
70                                                             EmpathyContact           *contact);
71 const gchar *            empathy_message_get_body          (EmpathyMessage           *message);
72 void                     empathy_message_set_body          (EmpathyMessage           *message,
73                                                             const gchar              *body);
74 time_t                   empathy_message_get_timestamp     (EmpathyMessage           *message);
75 void                     empathy_message_set_timestamp     (EmpathyMessage           *message,
76                                                             time_t                    timestamp);
77 gboolean                 empathy_message_is_backlog        (EmpathyMessage           *message);
78 void                     empathy_message_set_is_backlog    (EmpathyMessage           *message,
79                                                             gboolean                 is_backlog);
80 gboolean                 empathy_message_is_incoming       (EmpathyMessage           *message);
81 void                     empathy_message_set_incoming      (EmpathyMessage           *message,
82                                                             gboolean                 incoming);
83
84 gboolean                 empathy_message_should_highlight  (EmpathyMessage           *message);
85 TpChannelTextMessageType empathy_message_type_from_str     (const gchar              *type_str);
86 const gchar *            empathy_message_type_to_str       (TpChannelTextMessageType  type);
87
88 guint                    empathy_message_get_id (EmpathyMessage *message);
89 void                     empathy_message_set_id (EmpathyMessage *message, guint id);
90
91 gboolean                 empathy_message_equal (EmpathyMessage *message1, EmpathyMessage *message2);
92
93 TpChannelTextMessageFlags empathy_message_get_flags        (EmpathyMessage           *message);
94 void                      empathy_message_set_flags        (EmpathyMessage           *message,
95                                                             TpChannelTextMessageFlags flags);
96
97 G_END_DECLS
98
99 #endif /* __EMPATHY_MESSAGE_H__ */