]> git.0d.be Git - empathy.git/blob - libempathy-gtk/gossip-chat.h
8cbcee0b6fde3ddff7e7d2d2f810b6ef265e1319
[empathy.git] / libempathy-gtk / gossip-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 __GOSSIP_CHAT_H__
29 #define __GOSSIP_CHAT_H__
30
31 #include <glib-object.h>
32
33 #include <libempathy/gossip-contact.h>
34 #include <libempathy/gossip-message.h>
35 #include <libempathy/empathy-tp-chat.h>
36
37 #include "gossip-chat-view.h"
38 #include "gossip-spell.h" 
39
40 G_BEGIN_DECLS
41
42 #define GOSSIP_TYPE_CHAT         (gossip_chat_get_type ())
43 #define GOSSIP_CHAT(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GOSSIP_TYPE_CHAT, GossipChat))
44 #define GOSSIP_CHAT_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GOSSIP_TYPE_CHAT, GossipChatClass))
45 #define GOSSIP_IS_CHAT(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GOSSIP_TYPE_CHAT))
46 #define GOSSIP_IS_CHAT_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GOSSIP_TYPE_CHAT))
47 #define GOSSIP_CHAT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GOSSIP_TYPE_CHAT, GossipChatClass))
48
49 typedef struct _GossipChat       GossipChat;
50 typedef struct _GossipChatClass  GossipChatClass;
51 typedef struct _GossipChatPriv   GossipChatPriv;
52
53 #include "gossip-chat-window.h"
54
55 struct _GossipChat {
56         GObject          parent;
57
58         /* Protected */
59         GossipChatView  *view;
60         GtkWidget       *input_text_view;
61         gboolean         is_first_char;
62         McAccount       *account;
63 };
64
65 struct _GossipChatClass {
66         GObjectClass parent;
67
68         /* VTable */
69         const gchar *    (*get_name)            (GossipChat  *chat);
70         gchar *          (*get_tooltip)         (GossipChat  *chat);
71         const gchar *    (*get_status_icon_name)(GossipChat  *chat);
72         GossipContact *  (*get_contact)         (GossipChat  *chat);
73         GtkWidget *      (*get_widget)          (GossipChat  *chat);
74
75         gboolean         (*get_show_contacts)   (GossipChat  *chat);
76         void             (*set_show_contacts)   (GossipChat  *chat,
77                                                  gboolean     show);
78         gboolean         (*is_group_chat)       (GossipChat  *chat);
79         void             (*save_geometry)       (GossipChat  *chat,
80                                                  gint         x,
81                                                  gint         y,
82                                                  gint         w,
83                                                  gint         h);
84         void             (*load_geometry)       (GossipChat  *chat,
85                                                  gint        *x,
86                                                  gint        *y,
87                                                  gint        *w,
88                                                  gint        *h);
89 };
90
91 GType             gossip_chat_get_type              (void);
92
93 GossipChatView *  gossip_chat_get_view              (GossipChat       *chat);
94 GossipChatWindow *gossip_chat_get_window            (GossipChat       *chat);
95 void              gossip_chat_set_window            (GossipChat       *chat,
96                                                      GossipChatWindow *window);
97 void              gossip_chat_present               (GossipChat       *chat);
98 void              gossip_chat_clear                 (GossipChat       *chat);
99 void              gossip_chat_scroll_down           (GossipChat       *chat);
100 void              gossip_chat_cut                   (GossipChat       *chat);
101 void              gossip_chat_copy                  (GossipChat       *chat);
102 void              gossip_chat_paste                 (GossipChat       *chat);
103 const gchar *     gossip_chat_get_name              (GossipChat       *chat);
104 gchar *           gossip_chat_get_tooltip           (GossipChat       *chat);
105 const gchar *     gossip_chat_get_status_icon_name  (GossipChat       *chat);
106 GossipContact *   gossip_chat_get_contact           (GossipChat       *chat);
107 GossipContact *   gossip_chat_get_own_contact       (GossipChat       *chat);
108 GtkWidget *       gossip_chat_get_widget            (GossipChat       *chat);
109 gboolean          gossip_chat_get_show_contacts     (GossipChat       *chat);
110 void              gossip_chat_set_show_contacts     (GossipChat       *chat,
111                                                      gboolean          show);
112 gboolean          gossip_chat_is_group_chat         (GossipChat       *chat);
113 gboolean          gossip_chat_is_connected          (GossipChat       *chat);
114
115 void              gossip_chat_save_geometry         (GossipChat       *chat,
116                                                      gint              x,
117                                                      gint              y,
118                                                      gint              w,
119                                                      gint              h);
120 void              gossip_chat_load_geometry         (GossipChat       *chat,
121                                                      gint             *x,
122                                                      gint             *y,
123                                                      gint             *w,
124                                                      gint             *h);
125 void              gossip_chat_set_tp_chat           (GossipChat       *chat,
126                                                      EmpathyTpChat    *tp_chat);
127 const gchar *     gossip_chat_get_id                (GossipChat       *chat);
128
129 /* For spell checker dialog to correct the misspelled word. */
130 gboolean          gossip_chat_get_is_command        (const gchar      *str);
131 void              gossip_chat_correct_word          (GossipChat       *chat,
132                                                      GtkTextIter       start,
133                                                      GtkTextIter       end,
134                                                      const gchar      *new_word);
135 gboolean          gossip_chat_should_play_sound     (GossipChat       *chat);
136 gboolean          gossip_chat_should_highlight_nick (GossipMessage    *message);
137
138 G_END_DECLS
139
140 #endif /* __GOSSIP_CHAT_H__ */