]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-chat.h
Rename all filenames starting with "gossip" by "empathy", change namespace
[empathy.git] / libempathy-gtk / empathy-chat.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) 2007 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., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  * Authors: Mikael Hallendal <micke@imendio.com>
22  *          Richard Hult <richard@imendio.com>
23  *          Martyn Russell <martyn@imendio.com>
24  *          Geert-Jan Van den Bogaerde <geertjan@gnome.org>
25  *          Xavier Claessens <xclaesse@gmail.com>
26  */
27
28 #ifndef __EMPATHY_CHAT_H__
29 #define __EMPATHY_CHAT_H__
30
31 #include <glib-object.h>
32
33 #include <libempathy/empathy-contact.h>
34 #include <libempathy/empathy-message.h>
35 #include <libempathy/empathy-tp-chat.h>
36
37 #include "empathy-chat-view.h"
38 #include "empathy-spell.h" 
39
40 G_BEGIN_DECLS
41
42 #define EMPATHY_TYPE_CHAT         (empathy_chat_get_type ())
43 #define EMPATHY_CHAT(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CHAT, EmpathyChat))
44 #define EMPATHY_CHAT_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_CHAT, EmpathyChatClass))
45 #define EMPATHY_IS_CHAT(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CHAT))
46 #define EMPATHY_IS_CHAT_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_CHAT))
47 #define EMPATHY_CHAT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_CHAT, EmpathyChatClass))
48
49 typedef struct _EmpathyChat       EmpathyChat;
50 typedef struct _EmpathyChatClass  EmpathyChatClass;
51 typedef struct _EmpathyChatPriv   EmpathyChatPriv;
52
53 #include "empathy-chat-window.h"
54
55 struct _EmpathyChat {
56         GObject          parent;
57
58         /* Protected */
59         EmpathyChatView  *view;
60         EmpathyTpChat   *tp_chat;
61         GtkWidget       *input_text_view;
62         gboolean         is_first_char;
63         McAccount       *account;
64 };
65
66 struct _EmpathyChatClass {
67         GObjectClass parent;
68
69         /* VTable */
70         const gchar *    (*get_name)            (EmpathyChat    *chat);
71         gchar *          (*get_tooltip)         (EmpathyChat    *chat);
72         const gchar *    (*get_status_icon_name)(EmpathyChat    *chat);
73         GtkWidget *      (*get_widget)          (EmpathyChat    *chat);
74         gboolean         (*is_group_chat)       (EmpathyChat    *chat);
75         void             (*set_tp_chat)         (EmpathyChat    *chat,
76                                                  EmpathyTpChat *tp_chat);
77 };
78
79 GType             empathy_chat_get_type              (void);
80
81 EmpathyChatView *  empathy_chat_get_view              (EmpathyChat       *chat);
82 EmpathyChatWindow *empathy_chat_get_window            (EmpathyChat       *chat);
83 void              empathy_chat_set_window            (EmpathyChat       *chat,
84                                                      EmpathyChatWindow *window);
85 void              empathy_chat_present               (EmpathyChat       *chat);
86 void              empathy_chat_clear                 (EmpathyChat       *chat);
87 void              empathy_chat_scroll_down           (EmpathyChat       *chat);
88 void              empathy_chat_cut                   (EmpathyChat       *chat);
89 void              empathy_chat_copy                  (EmpathyChat       *chat);
90 void              empathy_chat_paste                 (EmpathyChat       *chat);
91 const gchar *     empathy_chat_get_name              (EmpathyChat       *chat);
92 gchar *           empathy_chat_get_tooltip           (EmpathyChat       *chat);
93 const gchar *     empathy_chat_get_status_icon_name  (EmpathyChat       *chat);
94 GtkWidget *       empathy_chat_get_widget            (EmpathyChat       *chat);
95 gboolean          empathy_chat_is_group_chat         (EmpathyChat       *chat);
96 gboolean          empathy_chat_is_connected          (EmpathyChat       *chat);
97
98 void              empathy_chat_save_geometry         (EmpathyChat       *chat,
99                                                      gint              x,
100                                                      gint              y,
101                                                      gint              w,
102                                                      gint              h);
103 void              empathy_chat_load_geometry         (EmpathyChat       *chat,
104                                                      gint             *x,
105                                                      gint             *y,
106                                                      gint             *w,
107                                                      gint             *h);
108 void              empathy_chat_set_tp_chat           (EmpathyChat       *chat,
109                                                      EmpathyTpChat    *tp_chat);
110 const gchar *     empathy_chat_get_id                (EmpathyChat       *chat);
111
112 /* For spell checker dialog to correct the misspelled word. */
113 gboolean          empathy_chat_get_is_command        (const gchar      *str);
114 void              empathy_chat_correct_word          (EmpathyChat       *chat,
115                                                      GtkTextIter       start,
116                                                      GtkTextIter       end,
117                                                      const gchar      *new_word);
118 gboolean          empathy_chat_should_play_sound     (EmpathyChat       *chat);
119 gboolean          empathy_chat_should_highlight_nick (EmpathyMessage    *message);
120
121 G_END_DECLS
122
123 #endif /* __EMPATHY_CHAT_H__ */