]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-chat-text-view.h
use the 48x48 version of the local-xmpp icon
[empathy.git] / libempathy-gtk / empathy-chat-text-view.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2002-2007 Imendio AB
4  * Copyright (C) 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  *          Richard Hult <richard@imendio.com>
23  *          Martyn Russell <martyn@imendio.com>
24  *          Xavier Claessens <xclaesse@gmail.com>
25  */
26
27 #ifndef __EMPATHY_CHAT_TEXT_VIEW_H__
28 #define __EMPATHY_CHAT_TEXT_VIEW_H__
29
30 #include <gtk/gtk.h>
31
32 #include <libempathy/empathy-contact.h>
33 #include <libempathy/empathy-message.h>
34
35 #include "empathy-chat-view.h"
36
37 G_BEGIN_DECLS
38
39 #define EMPATHY_TYPE_CHAT_TEXT_VIEW         (empathy_chat_text_view_get_type ())
40 #define EMPATHY_CHAT_TEXT_VIEW(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CHAT_TEXT_VIEW, EmpathyChatTextView))
41 #define EMPATHY_CHAT_TEXT_VIEW_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_CHAT_TEXT_VIEW, EmpathyChatTextViewClass))
42 #define EMPATHY_IS_CHAT_TEXT_VIEW(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CHAT_TEXT_VIEW))
43 #define EMPATHY_IS_CHAT_TEXT_VIEW_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_CHAT_TEXT_VIEW))
44 #define EMPATHY_CHAT_TEXT_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_CHAT_TEXT_VIEW, EmpathyChatTextViewClass))
45
46 typedef struct _EmpathyChatTextView      EmpathyChatTextView;
47 typedef struct _EmpathyChatTextViewClass EmpathyChatTextViewClass;
48
49 struct _EmpathyChatTextView {
50         GtkTextView parent;
51         gpointer priv;
52 };
53
54 struct _EmpathyChatTextViewClass {
55         GtkTextViewClass parent_class;
56
57         /* <vtable> */
58         void (*append_message) (EmpathyChatTextView *view,
59                                 EmpathyMessage      *message,
60                                 gboolean             should_highlight);
61 };
62
63 #define EMPATHY_CHAT_TEXT_VIEW_TAG_CUT "cut"
64 #define EMPATHY_CHAT_TEXT_VIEW_TAG_HIGHLIGHT "highlight"
65 #define EMPATHY_CHAT_TEXT_VIEW_TAG_SPACING "spacing"
66 #define EMPATHY_CHAT_TEXT_VIEW_TAG_TIME "time"
67 #define EMPATHY_CHAT_TEXT_VIEW_TAG_ACTION "action"
68 #define EMPATHY_CHAT_TEXT_VIEW_TAG_BODY "body"
69 #define EMPATHY_CHAT_TEXT_VIEW_TAG_EVENT "event"
70 #define EMPATHY_CHAT_TEXT_VIEW_TAG_LINK "link"
71
72 GType                empathy_chat_text_view_get_type           (void) G_GNUC_CONST;
73 EmpathyContact *     empathy_chat_text_view_get_last_contact   (EmpathyChatTextView *view);
74 gint64               empathy_chat_text_view_get_last_timestamp (EmpathyChatTextView *view);
75 void                 empathy_chat_text_view_set_only_if_date   (EmpathyChatTextView *view,
76                                                                 gboolean             only_if_date);
77 void                 empathy_chat_text_view_append_body        (EmpathyChatTextView *view,
78                                                                 const gchar         *body,
79                                                                 const gchar         *tag);
80 void                 empathy_chat_text_view_append_spacing     (EmpathyChatTextView *view);
81 GtkTextTag *         empathy_chat_text_view_tag_set            (EmpathyChatTextView *view,
82                                                                 const gchar         *tag_name,
83                                                                 const gchar         *first_property_name,
84                                                                 ...);
85
86 G_END_DECLS
87
88 #endif /* __EMPATHY_CHAT_TEXT_VIEW_H__ */