]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-chat-view.h
a96b114b228c158d7e0aaf03d9625d38ef272f69
[empathy.git] / libempathy-gtk / empathy-chat-view.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2008 Collabora Ltd.
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  * Authors: Xavier Claessens <xclaesse@gmail.com>
21  */
22
23 #ifndef __EMPATHY_CHAT_VIEW_H__
24 #define __EMPATHY_CHAT_VIEW_H__
25
26 #include <gtk/gtktextview.h>
27
28 #include <libempathy/empathy-contact.h>
29 #include <libempathy/empathy-message.h>
30
31 G_BEGIN_DECLS
32
33 #define EMPATHY_TYPE_CHAT_VIEW         (empathy_chat_view_get_type ())
34 #define EMPATHY_CHAT_VIEW(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CHAT_VIEW, EmpathyChatView))
35 #define EMPATHY_IS_CHAT_VIEW(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CHAT_VIEW))
36 #define EMPATHY_TYPE_CHAT_VIEW_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), EMPATHY_TYPE_CHAT_VIEW, EmpathyChatViewIface))
37
38 typedef struct _EmpathyChatView      EmpathyChatView;
39 typedef struct _EmpathyChatViewIface EmpathyChatViewIface;
40
41 #include "empathy-theme.h"
42
43 struct _EmpathyChatViewIface {
44         GTypeInterface   base_iface;
45
46         /* VTabled */
47         void             (*append_message)       (EmpathyChatView *view,
48                                                   EmpathyMessage  *msg);
49         void             (*append_event)         (EmpathyChatView *view,
50                                                   const gchar     *str);
51         void             (*set_margin)           (EmpathyChatView *view,
52                                                   gint             margin);
53         void             (*scroll)               (EmpathyChatView *view,
54                                                   gboolean         allow_scrolling);
55         void             (*scroll_down)          (EmpathyChatView *view);
56         gboolean         (*get_selection_bounds) (EmpathyChatView *view,
57                                                   GtkTextIter     *start,
58                                                   GtkTextIter     *end);
59         void             (*clear)                (EmpathyChatView *view);
60         gboolean         (*find_previous)        (EmpathyChatView *view,
61                                                   const gchar     *search_criteria,
62                                                   gboolean         new_search);
63         gboolean         (*find_next)            (EmpathyChatView *view,
64                                                   const gchar     *search_criteria,
65                                                   gboolean         new_search);
66         void             (*find_abilities)       (EmpathyChatView *view,
67                                                   const gchar     *search_criteria,
68                                                   gboolean        *can_do_previous,
69                                                   gboolean        *can_do_next);
70         void             (*highlight)            (EmpathyChatView *view,
71                                                   const gchar     *text);
72         void             (*copy_clipboard)       (EmpathyChatView *view);
73         EmpathyTheme *   (*get_theme)            (EmpathyChatView *view);
74         void             (*set_theme)            (EmpathyChatView *view,
75                                                   EmpathyTheme    *theme);
76         time_t           (*get_last_timestamp)   (EmpathyChatView *view);
77         void             (*set_last_timestamp)   (EmpathyChatView *view,
78                                                   time_t           timestamp);
79         EmpathyContact * (*get_last_contact)     (EmpathyChatView *view);
80
81 };
82
83 GType            empathy_chat_view_get_type             (void) G_GNUC_CONST;
84 void             empathy_chat_view_append_message       (EmpathyChatView *view,
85                                                          EmpathyMessage  *msg);
86 void             empathy_chat_view_append_event         (EmpathyChatView *view,
87                                                          const gchar     *str);
88 void             empathy_chat_view_scroll               (EmpathyChatView *view,
89                                                          gboolean         allow_scrolling);
90 void             empathy_chat_view_scroll_down          (EmpathyChatView *view);
91 gboolean         empathy_chat_view_get_selection_bounds (EmpathyChatView *view,
92                                                          GtkTextIter     *start,
93                                                          GtkTextIter     *end);
94 void             empathy_chat_view_clear                (EmpathyChatView *view);
95 gboolean         empathy_chat_view_find_previous        (EmpathyChatView *view,
96                                                          const gchar     *search_criteria,
97                                                          gboolean         new_search);
98 gboolean         empathy_chat_view_find_next            (EmpathyChatView *view,
99                                                          const gchar     *search_criteria,
100                                                          gboolean         new_search);
101 void             empathy_chat_view_find_abilities       (EmpathyChatView *view,
102                                                          const gchar     *search_criteria,
103                                                          gboolean        *can_do_previous,
104                                                          gboolean        *can_do_next);
105 void             empathy_chat_view_highlight            (EmpathyChatView *view,
106                                                          const gchar     *text);
107 void             empathy_chat_view_copy_clipboard       (EmpathyChatView *view);
108 EmpathyTheme *   empathy_chat_view_get_theme            (EmpathyChatView *view);
109 void             empathy_chat_view_set_theme            (EmpathyChatView *view,
110                                                          EmpathyTheme    *theme);
111 void             empathy_chat_view_set_margin           (EmpathyChatView *view,
112                                                          gint             margin);
113 time_t           empathy_chat_view_get_last_timestamp   (EmpathyChatView *view);
114 void             empathy_chat_view_set_last_timestamp   (EmpathyChatView *view,
115                                                          time_t           timestamp);
116 EmpathyContact * empathy_chat_view_get_last_contact     (EmpathyChatView *view);
117
118 GtkWidget *      empathy_chat_view_get_smiley_menu      (GCallback        callback,
119                                                          gpointer         user_data);
120
121 G_END_DECLS
122
123 #endif /* __EMPATHY_CHAT_VIEW_H__ */
124