]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-chat-view.h
Updatre python binding
[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) 2002-2007 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  * Authors: Mikael Hallendal <micke@imendio.com>
21  *          Richard Hult <richard@imendio.com>
22  *          Martyn Russell <martyn@imendio.com>
23  */
24
25 #ifndef __EMPATHY_CHAT_VIEW_H__
26 #define __EMPATHY_CHAT_VIEW_H__
27
28 #include <gtk/gtktextview.h>
29
30 #include <libempathy/empathy-contact.h>
31 #include <libempathy/empathy-message.h>
32
33 G_BEGIN_DECLS
34
35 #define EMPATHY_TYPE_CHAT_VIEW         (empathy_chat_view_get_type ())
36 #define EMPATHY_CHAT_VIEW(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CHAT_VIEW, EmpathyChatView))
37 #define EMPATHY_CHAT_VIEW_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_CHAT_VIEW, EmpathyChatViewClass))
38 #define EMPATHY_IS_CHAT_VIEW(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CHAT_VIEW))
39 #define EMPATHY_IS_CHAT_VIEW_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_CHAT_VIEW))
40 #define EMPATHY_CHAT_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_CHAT_VIEW, EmpathyChatViewClass))
41
42 typedef struct _EmpathyChatView      EmpathyChatView;
43 typedef struct _EmpathyChatViewClass EmpathyChatViewClass;
44 typedef struct _EmpathyChatViewPriv  EmpathyChatViewPriv;
45
46 #include "empathy-theme.h"
47
48 struct _EmpathyChatView {
49         GtkTextView parent;
50 };
51
52 struct _EmpathyChatViewClass {
53         GtkTextViewClass parent_class;
54 };
55
56 typedef enum {
57         EMPATHY_CHAT_VIEW_BLOCK_NONE,
58         EMPATHY_CHAT_VIEW_BLOCK_SELF,
59         EMPATHY_CHAT_VIEW_BLOCK_OTHER,
60         EMPATHY_CHAT_VIEW_BLOCK_EVENT,
61         EMPATHY_CHAT_VIEW_BLOCK_TIME,
62         EMPATHY_CHAT_VIEW_BLOCK_INVITE
63 } EmpathyChatViewBlock;
64
65 GType            empathy_chat_view_get_type             (void) G_GNUC_CONST;
66 EmpathyChatView *empathy_chat_view_new                  (void);
67 void             empathy_chat_view_append_message       (EmpathyChatView *view,
68                                                          EmpathyMessage  *msg);
69 void             empathy_chat_view_append_event         (EmpathyChatView *view,
70                                                          const gchar     *str);
71 void             empathy_chat_view_append_button        (EmpathyChatView *view,
72                                                          const gchar     *message,
73                                                          GtkWidget       *button1,
74                                                          GtkWidget       *button2);
75 void             empathy_chat_view_set_margin           (EmpathyChatView *view,
76                                                          gint             margin);
77 void             empathy_chat_view_scroll               (EmpathyChatView *view,
78                                                          gboolean         allow_scrolling);
79 void             empathy_chat_view_scroll_down          (EmpathyChatView *view);
80 gboolean         empathy_chat_view_get_selection_bounds (EmpathyChatView *view,
81                                                          GtkTextIter     *start,
82                                                          GtkTextIter     *end);
83 void             empathy_chat_view_clear                (EmpathyChatView *view);
84 gboolean         empathy_chat_view_find_previous        (EmpathyChatView *view,
85                                                          const gchar     *search_criteria,
86                                                          gboolean         new_search);
87 gboolean         empathy_chat_view_find_next            (EmpathyChatView *view,
88                                                          const gchar     *search_criteria,
89                                                          gboolean         new_search);
90 void             empathy_chat_view_find_abilities       (EmpathyChatView *view,
91                                                          const gchar     *search_criteria,
92                                                          gboolean        *can_do_previous,
93                                                          gboolean        *can_do_next);
94 void             empathy_chat_view_highlight            (EmpathyChatView *view,
95                                                          const gchar     *text);
96 void             empathy_chat_view_copy_clipboard       (EmpathyChatView *view);
97 EmpathyTheme *   empathy_chat_view_get_theme            (EmpathyChatView *view);
98 void             empathy_chat_view_set_theme            (EmpathyChatView *view,
99                                                          EmpathyTheme    *theme);
100 void             empathy_chat_view_set_margin           (EmpathyChatView *view,
101                                                          gint             margin);
102 GtkWidget *      empathy_chat_view_get_smiley_menu      (GCallback        callback,
103                                                          gpointer         user_data);
104 void             empathy_chat_view_set_is_group_chat    (EmpathyChatView *view,
105                                                          gboolean         is_group_chat);
106 time_t           empathy_chat_view_get_last_timestamp   (EmpathyChatView *view);
107 void             empathy_chat_view_set_last_timestamp   (EmpathyChatView *view,
108                                                          time_t           timestamp);
109 EmpathyChatViewBlock empathy_chat_view_get_last_block_type  (EmpathyChatView *view);
110 void             empathy_chat_view_set_last_block_type  (EmpathyChatView *view, 
111                                                          EmpathyChatViewBlock block_type);
112 EmpathyContact * empathy_chat_view_get_last_contact     (EmpathyChatView *view);
113 void             empathy_chat_view_set_last_contact     (EmpathyChatView *view,
114                                                          EmpathyContact  *contact);
115 GdkPixbuf *      empathy_chat_view_get_avatar_pixbuf_with_cache (EmpathyContact *contact);
116
117 G_END_DECLS
118
119 #endif /* __EMPATHY_CHAT_VIEW_H__ */