1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2002-2007 Imendio AB
4 * Copyright (C) 2007 Collabora Ltd.
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.
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.
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.
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>
28 #ifndef __GOSSIP_CHAT_H__
29 #define __GOSSIP_CHAT_H__
31 #include <glib-object.h>
33 #include <libempathy/gossip-contact.h>
34 #include <libempathy/gossip-message.h>
35 #include <libempathy/empathy-tp-chat.h>
37 #include "gossip-chat-view.h"
38 #include "gossip-spell.h"
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))
49 typedef struct _GossipChat GossipChat;
50 typedef struct _GossipChatClass GossipChatClass;
51 typedef struct _GossipChatPriv GossipChatPriv;
53 #include "gossip-chat-window.h"
60 GtkWidget *input_text_view;
61 gboolean is_first_char;
65 struct _GossipChatClass {
69 const gchar * (*get_name) (GossipChat *chat);
70 gchar * (*get_tooltip) (GossipChat *chat);
71 GdkPixbuf * (*get_status_pixbuf)(GossipChat *chat);
72 GossipContact * (*get_contact) (GossipChat *chat);
73 GtkWidget * (*get_widget) (GossipChat *chat);
75 gboolean (*get_show_contacts)(GossipChat *chat);
76 void (*set_show_contacts)(GossipChat *chat,
79 gboolean (*is_group_chat) (GossipChat *chat);
80 void (*save_geometry) (GossipChat *chat,
85 void (*load_geometry) (GossipChat *chat,
92 GType gossip_chat_get_type (void);
94 GossipChatView * gossip_chat_get_view (GossipChat *chat);
95 GossipChatWindow *gossip_chat_get_window (GossipChat *chat);
96 void gossip_chat_set_window (GossipChat *chat,
97 GossipChatWindow *window);
98 void gossip_chat_present (GossipChat *chat);
99 void gossip_chat_clear (GossipChat *chat);
100 void gossip_chat_scroll_down (GossipChat *chat);
101 void gossip_chat_cut (GossipChat *chat);
102 void gossip_chat_copy (GossipChat *chat);
103 void gossip_chat_paste (GossipChat *chat);
104 const gchar * gossip_chat_get_name (GossipChat *chat);
105 gchar * gossip_chat_get_tooltip (GossipChat *chat);
106 GdkPixbuf * gossip_chat_get_status_pixbuf (GossipChat *chat);
107 GossipContact * gossip_chat_get_contact (GossipChat *chat);
108 GossipContact * gossip_chat_get_own_contact (GossipChat *chat);
109 GtkWidget * gossip_chat_get_widget (GossipChat *chat);
110 gboolean gossip_chat_get_show_contacts (GossipChat *chat);
111 void gossip_chat_set_show_contacts (GossipChat *chat,
114 gboolean gossip_chat_is_group_chat (GossipChat *chat);
115 gboolean gossip_chat_is_connected (GossipChat *chat);
117 void gossip_chat_save_geometry (GossipChat *chat,
122 void gossip_chat_load_geometry (GossipChat *chat,
127 void gossip_chat_set_tp_chat (GossipChat *chat,
128 EmpathyTpChat *tp_chat);
129 const gchar * gossip_chat_get_id (GossipChat *chat);
131 /* For spell checker dialog to correct the misspelled word. */
132 gboolean gossip_chat_get_is_command (const gchar *str);
133 void gossip_chat_correct_word (GossipChat *chat,
136 const gchar *new_word);
137 gboolean gossip_chat_should_play_sound (GossipChat *chat);
138 gboolean gossip_chat_should_highlight_nick (GossipMessage *message);
142 #endif /* __GOSSIP_CHAT_H__ */