comparison gtk/gtkconv.h @ 14191:009db0b357b5

This is a hand-crafted commit to migrate across subversion revisions 16854:16861, due to some vagaries of the way the original renames were done. Witness that monotone can do in one revision what svn had to spread across several.
author Ethan Blanton <elb@pidgin.im>
date Sat, 16 Dec 2006 04:59:55 +0000
parents
children c2fe0f54c389
comparison
equal deleted inserted replaced
14190:366be2ce35a7 14191:009db0b357b5
1 /**
2 * @file gtkconv.h GTK+ Conversation API
3 * @ingroup gtkui
4 *
5 * gaim
6 *
7 * Gaim is the legal property of its developers, whose names are too numerous
8 * to list here. Please refer to the COPYRIGHT file distributed with this
9 * source distribution.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
25 #ifndef _GAIM_GTKCONVERSATION_H_
26 #define _GAIM_GTKCONVERSATION_H_
27
28 typedef struct _GaimGtkImPane GaimGtkImPane;
29 typedef struct _GaimGtkChatPane GaimGtkChatPane;
30 typedef struct _GaimGtkConversation GaimGtkConversation;
31
32 /**
33 * Unseen text states.
34 */
35 typedef enum
36 {
37 GAIM_UNSEEN_NONE, /**< No unseen text in the conversation. */
38 GAIM_UNSEEN_EVENT, /**< Unseen events in the conversation. */
39 GAIM_UNSEEN_NO_LOG, /**< Unseen text with NO_LOG flag. */
40 GAIM_UNSEEN_TEXT, /**< Unseen text in the conversation. */
41 GAIM_UNSEEN_NICK /**< Unseen text and the nick was said. */
42 } GaimUnseenState;
43
44 enum {
45 CHAT_USERS_ICON_COLUMN,
46 CHAT_USERS_ALIAS_COLUMN,
47 CHAT_USERS_ALIAS_KEY_COLUMN,
48 CHAT_USERS_NAME_COLUMN,
49 CHAT_USERS_FLAGS_COLUMN,
50 CHAT_USERS_COLOR_COLUMN,
51 CHAT_USERS_BUDDY_COLUMN,
52 CHAT_USERS_COLUMNS
53 };
54
55 #define GAIM_GTK_CONVERSATION(conv) \
56 ((GaimGtkConversation *)(conv)->ui_data)
57
58 #define GAIM_IS_GTK_CONVERSATION(conv) \
59 (gaim_conversation_get_ui_ops(conv) == \
60 gaim_gtk_conversations_get_conv_ui_ops())
61
62 #include "gtkgaim.h"
63 #include "conversation.h"
64 #include "gtkconvwin.h"
65
66 /**************************************************************************
67 * @name Structures
68 **************************************************************************/
69 /*@{*/
70
71 /**
72 * A GTK+ representation of a graphical window containing one or more
73 * conversations.
74 */
75
76 /**
77 * A GTK+ Instant Message pane.
78 */
79 struct _GaimGtkImPane
80 {
81 GtkWidget *block;
82 GtkWidget *send_file;
83 GtkWidget *sep1;
84 GtkWidget *sep2;
85 GtkWidget *check;
86 GtkWidget *progress;
87
88 /* Buddy icon stuff */
89 GtkWidget *icon_container;
90 GtkWidget *icon;
91 gboolean show_icon;
92 gboolean animate;
93 GdkPixbufAnimation *anim;
94 GdkPixbufAnimationIter *iter;
95 guint32 icon_timer;
96 };
97
98 /**
99 * GTK+ Chat panes.
100 */
101 struct _GaimGtkChatPane
102 {
103 GtkWidget *count;
104 GtkWidget *list;
105 GtkWidget *topic_text;
106 };
107
108 /**
109 * A GTK+ conversation pane.
110 */
111 struct _GaimGtkConversation
112 {
113 GaimConversation *active_conv;
114 GList *convs;
115 GList *send_history;
116
117 GaimGtkWindow *win;
118
119 gboolean make_sound;
120
121 GtkTooltips *tooltips;
122
123 GtkWidget *tab_cont;
124 GtkWidget *tabby;
125 GtkWidget *menu_tabby;
126
127 GtkWidget *imhtml;
128 GtkTextBuffer *entry_buffer;
129 GtkWidget *entry;
130
131 GtkWidget *close; /* "x" on the tab */
132 GtkWidget *icon;
133 GtkWidget *tab_label;
134 GtkWidget *menu_icon;
135 GtkWidget *menu_label;
136 GtkSizeGroup *sg;
137
138 GtkWidget *lower_hbox;
139
140 GtkWidget *toolbar;
141
142 GaimUnseenState unseen_state;
143 guint unseen_count;
144
145 struct
146 {
147 GtkWidget *image;
148 GtkWidget *search;
149
150 } dialogs;
151
152 union
153 {
154 GaimGtkImPane *im;
155 GaimGtkChatPane *chat;
156
157 } u;
158 };
159
160 /*@}*/
161
162 /**************************************************************************
163 * @name GTK+ Conversation API
164 **************************************************************************/
165 /*@{*/
166
167 /**
168 * Returns the UI operations structure for GTK+ conversations.
169 *
170 * @return The GTK+ conversation operations structure.
171 */
172 GaimConversationUiOps *gaim_gtk_conversations_get_conv_ui_ops(void);
173
174 /**
175 * Updates the buddy icon on a conversation.
176 *
177 * @param conv The conversation.
178 */
179 void gaim_gtkconv_update_buddy_icon(GaimConversation *conv);
180
181 /**
182 * Sets the active conversation within a GTK-conversation.
183 *
184 * @param conv The conversation
185 */
186 void gaim_gtkconv_switch_active_conversation(GaimConversation *conv);
187
188 /**
189 * Updates the tab positions on all conversation windows to reflect any
190 * changed preferences.
191 */
192 void gaim_gtkconv_update_tabs(void);
193
194 /**
195 * Updates conversation buttons by protocol.
196 *
197 * @param conv The conversation.
198 */
199 void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv);
200
201 /**
202 * Returns a list of conversations of the given type which have an unseen
203 * state greater than or equal to the specified minimum state. Using the
204 * hidden_only parameter, this search can be limited to hidden
205 * conversations. The max_count parameter will limit the total number of
206 * converations returned if greater than zero. The returned list should
207 * be freed by the caller.
208 *
209 * @param type The type of conversation.
210 * @param min_state The minimum unseen state.
211 * @param hidden_only If TRUE, only consider hidden conversations.
212 * @param max_count Maximum number of conversations to return, or 0 for
213 * no maximum.
214 * @return List of GaimConversation matching criteria, or NULL.
215 */
216 GList *
217 gaim_gtk_conversations_find_unseen_list(GaimConversationType type,
218 GaimUnseenState min_state,
219 gboolean hidden_only,
220 guint max_count);
221
222 /**
223 * Fill a menu with a list of conversations. Clicking the conversation
224 * menu item will present that conversation to the user.
225 *
226 * @param menu Menu widget to add items to.
227 * @param convs List of GaimConversation to add to menu.
228 * @return Number of conversations added to menu.
229 */
230 guint
231 gaim_gtk_conversations_fill_menu(GtkWidget *menu, GList *convs);
232
233 /**
234 * Presents a gaim conversation to the user.
235 *
236 * @param conv The conversation.
237 */
238 void gaim_gtkconv_present_conversation(GaimConversation *conv);
239
240 GaimGtkWindow *gaim_gtkconv_get_window(GaimGtkConversation *gtkconv);
241 GdkPixbuf *gaim_gtkconv_get_tab_icon(GaimConversation *conv, gboolean small_icon);
242 void gaim_gtkconv_new(GaimConversation *conv);
243 int gaim_gtkconv_get_tab_at_xy(GaimGtkWindow *win, int x, int y, gboolean *to_right);
244 gboolean gaim_gtkconv_is_hidden(GaimGtkConversation *gtkconv);
245 /*@}*/
246
247 /**************************************************************************/
248 /** @name GTK+ Conversations Subsystem */
249 /**************************************************************************/
250 /*@{*/
251
252 /**
253 * Returns the gtk conversations subsystem handle.
254 *
255 * @return The conversations subsystem handle.
256 */
257 void *gaim_gtk_conversations_get_handle(void);
258
259 /**
260 * Initializes the GTK+ conversations subsystem.
261 */
262 void gaim_gtk_conversations_init(void);
263
264 /**
265 * Uninitialized the GTK+ conversation subsystem.
266 */
267 void gaim_gtk_conversations_uninit(void);
268
269 /*@}*/
270
271 #endif /* _GAIM_GTKCONVERSATION_H_ */