]> git.0d.be Git - empathy.git/blob - libempathy-gtk/gossip-chat.h
[darcs-to-svn @ Adding salut profile]
[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  *
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  *          Geert-Jan Van den Bogaerde <geertjan@gnome.org>
24  */
25
26 #ifndef __GOSSIP_CHAT_H__
27 #define __GOSSIP_CHAT_H__
28
29 #include <glib-object.h>
30
31 #include <libempathy/gossip-contact.h>
32 #include <libempathy/gossip-message.h>
33 #include <libempathy/empathy-tp-chat.h>
34
35 #include "gossip-chat-view.h"
36 #include "gossip-spell.h" 
37
38 G_BEGIN_DECLS
39
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))
46
47 typedef struct _GossipChat       GossipChat;
48 typedef struct _GossipChatClass  GossipChatClass;
49 typedef struct _GossipChatPriv   GossipChatPriv;
50
51 #include "gossip-chat-window.h"
52
53 struct _GossipChat {
54         GObject          parent;
55
56         /* Protected */
57         GossipChatView  *view;
58         GtkWidget       *input_text_view;
59         gboolean         is_first_char;
60         McAccount       *account;
61 };
62
63 struct _GossipChatClass {
64         GObjectClass parent;
65
66         /* VTable */
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);
72
73         gboolean         (*get_show_contacts)(GossipChat  *chat);
74         void             (*set_show_contacts)(GossipChat  *chat,
75                                               gboolean     show);
76
77         gboolean         (*is_group_chat)    (GossipChat  *chat);
78         void             (*save_geometry)    (GossipChat  *chat,
79                                               gint         x,
80                                               gint         y,
81                                               gint         w,
82                                               gint         h);
83         void             (*load_geometry)    (GossipChat  *chat,
84                                               gint        *x,
85                                               gint        *y,
86                                               gint        *w,
87                                               gint        *h);
88 };
89
90 GType             gossip_chat_get_type              (void);
91
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,
110                                                      gboolean          show);
111
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
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,
131                                                      GtkTextIter       start,
132                                                      GtkTextIter       end,
133                                                      const gchar      *new_word);
134 gboolean          gossip_chat_should_play_sound     (GossipChat       *chat);
135 gboolean          gossip_chat_should_highlight_nick (GossipMessage    *message);
136
137 G_END_DECLS
138
139 #endif /* __GOSSIP_CHAT_H__ */