1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2002-2007 Imendio AB
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.
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.
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.
20 * Authors: Mikael Hallendal <micke@imendio.com>
21 * Richard Hult <richard@imendio.com>
22 * Martyn Russell <martyn@imendio.com>
23 * Geert-Jan Van den Bogaerde <geertjan@gnome.org>
26 #ifndef __GOSSIP_CHAT_H__
27 #define __GOSSIP_CHAT_H__
29 #include <glib-object.h>
31 #include <libempathy/gossip-contact.h>
32 #include <libempathy/gossip-message.h>
33 #include <libempathy/empathy-tp-chat.h>
35 #include "gossip-chat-view.h"
36 #include "gossip-spell.h"
40 #define GOSSIP_TYPE_CHAT (gossip_chat_get_type ())
41 #define GOSSIP_CHAT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GOSSIP_TYPE_CHAT, GossipChat))
42 #define GOSSIP_CHAT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GOSSIP_TYPE_CHAT, GossipChatClass))
43 #define GOSSIP_IS_CHAT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GOSSIP_TYPE_CHAT))
44 #define GOSSIP_IS_CHAT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GOSSIP_TYPE_CHAT))
45 #define GOSSIP_CHAT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GOSSIP_TYPE_CHAT, GossipChatClass))
47 typedef struct _GossipChat GossipChat;
48 typedef struct _GossipChatClass GossipChatClass;
49 typedef struct _GossipChatPriv GossipChatPriv;
51 #include "gossip-chat-window.h"
58 GtkWidget *input_text_view;
59 gboolean is_first_char;
63 struct _GossipChatClass {
67 const gchar * (*get_name) (GossipChat *chat);
68 gchar * (*get_tooltip) (GossipChat *chat);
69 GdkPixbuf * (*get_status_pixbuf)(GossipChat *chat);
70 GossipContact * (*get_contact) (GossipChat *chat);
71 GtkWidget * (*get_widget) (GossipChat *chat);
73 gboolean (*get_show_contacts)(GossipChat *chat);
74 void (*set_show_contacts)(GossipChat *chat,
77 gboolean (*is_group_chat) (GossipChat *chat);
78 void (*save_geometry) (GossipChat *chat,
83 void (*load_geometry) (GossipChat *chat,
90 GType gossip_chat_get_type (void);
92 GossipChatView * gossip_chat_get_view (GossipChat *chat);
93 GossipChatWindow *gossip_chat_get_window (GossipChat *chat);
94 void gossip_chat_set_window (GossipChat *chat,
95 GossipChatWindow *window);
96 void gossip_chat_present (GossipChat *chat);
97 void gossip_chat_clear (GossipChat *chat);
98 void gossip_chat_scroll_down (GossipChat *chat);
99 void gossip_chat_cut (GossipChat *chat);
100 void gossip_chat_copy (GossipChat *chat);
101 void gossip_chat_paste (GossipChat *chat);
102 const gchar * gossip_chat_get_name (GossipChat *chat);
103 gchar * gossip_chat_get_tooltip (GossipChat *chat);
104 GdkPixbuf * gossip_chat_get_status_pixbuf (GossipChat *chat);
105 GossipContact * gossip_chat_get_contact (GossipChat *chat);
106 GossipContact * gossip_chat_get_own_contact (GossipChat *chat);
107 GtkWidget * gossip_chat_get_widget (GossipChat *chat);
108 gboolean gossip_chat_get_show_contacts (GossipChat *chat);
109 void gossip_chat_set_show_contacts (GossipChat *chat,
112 gboolean gossip_chat_is_group_chat (GossipChat *chat);
113 gboolean gossip_chat_is_connected (GossipChat *chat);
115 void gossip_chat_save_geometry (GossipChat *chat,
120 void gossip_chat_load_geometry (GossipChat *chat,
125 void gossip_chat_set_tp_chat (GossipChat *chat,
126 EmpathyTpChat *tp_chat);
128 /* For spell checker dialog to correct the misspelled word. */
129 gboolean gossip_chat_get_is_command (const gchar *str);
130 void gossip_chat_correct_word (GossipChat *chat,
133 const gchar *new_word);
134 gboolean gossip_chat_should_play_sound (GossipChat *chat);
135 gboolean gossip_chat_should_highlight_nick (GossipMessage *message);
139 #endif /* __GOSSIP_CHAT_H__ */