Add deleted HTTP digest functions to ChangeLog.API.
[pidgin-git.git] / pidgin / gtkconv.h
blob45f8815b7fcc05d94e882e81b8d0e009f9d38e0d
1 /* pidgin
3 * Pidgin is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef _PIDGIN_CONVERSATION_H_
23 #define _PIDGIN_CONVERSATION_H_
24 /**
25 * SECTION:gtkconv
26 * @section_id: pidgin-gtkconv
27 * @short_description: <filename>gtkconv.h</filename>
28 * @title: Conversation API
29 * @see_also: <link linkend="chapter-signals-gtkconv">Conversation signals</link>
32 #define PIDGIN_TYPE_CONVERSATION (pidgin_conversation_get_type())
34 typedef struct _PidginImPane PidginImPane;
35 typedef struct _PidginChatPane PidginChatPane;
36 typedef struct _PidginConversation PidginConversation;
38 /**
39 * PidginUnseenState:
40 * @PIDGIN_UNSEEN_NONE: No unseen text in the conversation.
41 * @PIDGIN_UNSEEN_EVENT: Unseen events in the conversation.
42 * @PIDGIN_UNSEEN_NO_LOG: Unseen text with NO_LOG flag.
43 * @PIDGIN_UNSEEN_TEXT: Unseen text in the conversation.
44 * @PIDGIN_UNSEEN_NICK: Unseen text and the nick was said.
46 * Unseen text states.
48 typedef enum
50 PIDGIN_UNSEEN_NONE,
51 PIDGIN_UNSEEN_EVENT,
52 PIDGIN_UNSEEN_NO_LOG,
53 PIDGIN_UNSEEN_TEXT,
54 PIDGIN_UNSEEN_NICK
55 } PidginUnseenState;
57 enum {
58 CHAT_USERS_ICON_COLUMN,
59 CHAT_USERS_ALIAS_COLUMN,
60 CHAT_USERS_ALIAS_KEY_COLUMN,
61 CHAT_USERS_NAME_COLUMN,
62 CHAT_USERS_FLAGS_COLUMN,
63 CHAT_USERS_COLOR_COLUMN,
64 CHAT_USERS_WEIGHT_COLUMN,
65 CHAT_USERS_ICON_STOCK_COLUMN,
66 CHAT_USERS_COLUMNS
69 #define PIDGIN_CONVERSATION(conv) \
70 ((PidginConversation *)purple_conversation_get_ui_data(conv))
72 #define PIDGIN_IS_PIDGIN_CONVERSATION(conv) \
73 (purple_conversation_get_ui_ops(conv) == \
74 pidgin_conversations_get_conv_ui_ops())
76 #include "pidgin.h"
77 #include "conversation.h"
78 #include "gtkconvwin.h"
80 /**************************************************************************
81 * Structures
82 **************************************************************************/
84 /**
85 * PidginConversation:
87 * A GTK+ conversation pane.
89 struct _PidginConversation
91 gint box_count;
93 PurpleConversation *active_conv;
94 PurpleConversation *last_conversed;
95 GList *convs;
96 GList *send_history;
98 PidginConvWindow *win;
100 gboolean make_sound;
102 GtkWidget *tab_cont;
103 GtkWidget *tabby;
104 GtkWidget *menu_tabby;
106 GArray *nick_colors;
107 PurpleMessageFlags last_flags;
108 GtkTextBuffer *history_buffer;
109 GtkWidget *history;
111 GtkWidget *editor;
112 GtkWidget *entry;
114 GtkWidget *close; /* "x" on the tab */
115 GtkWidget *icon;
116 GtkWidget *tab_label;
117 GtkWidget *menu_icon;
118 GtkWidget *menu_label;
120 GtkWidget *lower_hbox;
122 PidginUnseenState unseen_state;
123 guint unseen_count;
125 union
127 PidginImPane *im;
128 PidginChatPane *chat;
130 } u;
132 time_t newday;
133 GtkWidget *infopane_hbox;
134 GtkWidget *infopane;
135 GtkListStore *infopane_model;
136 GtkTreeIter infopane_iter;
138 /* Used when attaching a PidginConversation to a PurpleConversation
139 * with message history */
140 int attach_timer;
141 GList *attach_current;
144 * Quick Find.
146 GtkWidget *quickfind_entry;
147 GtkWidget *quickfind_container;
150 G_BEGIN_DECLS
152 /**************************************************************************
153 * GTK+ Conversation API
154 **************************************************************************/
157 * pidgin_conversation_get_type:
159 * Returns: The #GType for the #PidginConversation boxed structure.
161 GType pidgin_conversation_get_type(void);
164 * pidgin_conversations_get_conv_ui_ops:
166 * Returns the UI operations structure for GTK+ conversations.
168 * Returns: The GTK+ conversation operations structure.
170 PurpleConversationUiOps *pidgin_conversations_get_conv_ui_ops(void);
173 * pidgin_conv_update_buddy_icon:
174 * @im: The IM conversation.
176 * Updates the buddy icon on a conversation.
178 void pidgin_conv_update_buddy_icon(PurpleIMConversation *im);
181 * pidgin_conv_switch_active_conversation:
182 * @conv: The conversation
184 * Sets the active conversation within a GTK-conversation.
186 void pidgin_conv_switch_active_conversation(PurpleConversation *conv);
189 * pidgin_conv_update_buttons_by_protocol:
190 * @conv: The conversation.
192 * Updates conversation buttons by protocol.
194 void pidgin_conv_update_buttons_by_protocol(PurpleConversation *conv);
197 * pidgin_conversations_get_unseen_all:
198 * @min_state: The minimum unseen state.
199 * @hidden_only: If %TRUE, only consider hidden conversations.
200 * @max_count: Maximum number of conversations to return, or 0 for
201 * no maximum.
203 * Returns a list of conversations of any type which have an unseen
204 * state greater than or equal to the specified minimum state. Using the
205 * hidden_only parameter, this search can be limited to hidden
206 * conversations. The max_count parameter will limit the total number of
207 * converations returned if greater than zero. The returned list should
208 * be freed by the caller.
210 * Returns: (transfer container) (element-type PurpleConversation): List of PurpleConversation matching criteria, or %NULL.
212 GList *
213 pidgin_conversations_get_unseen_all(PidginUnseenState min_state,
214 gboolean hidden_only,
215 guint max_count);
218 * pidgin_conversations_get_unseen_ims:
219 * @min_state: The minimum unseen state.
220 * @hidden_only: If %TRUE, only consider hidden conversations.
221 * @max_count: Maximum number of conversations to return, or 0 for
222 * no maximum.
224 * Returns a list of IM conversations which have an unseen state greater
225 * than or equal to the specified minimum state. Using the hidden_only
226 * parameter, this search can be limited to hidden IM conversations. The
227 * max_count parameter will limit the total number of IM converations
228 * returned if greater than zero. The returned list should be freed by the
229 * caller.
231 * Returns: (transfer container) (element-type PurpleConversation): List of PurpleIMConversation matching criteria, or %NULL.
233 GList *
234 pidgin_conversations_get_unseen_ims(PidginUnseenState min_state,
235 gboolean hidden_only,
236 guint max_count);
239 * pidgin_conversations_get_unseen_chats:
240 * @min_state: The minimum unseen state.
241 * @hidden_only: If %TRUE, only consider hidden conversations.
242 * @max_count: Maximum number of conversations to return, or 0 for
243 * no maximum.
245 * Returns a list of chat conversations which have an unseen state greater
246 * than or equal to the specified minimum state. Using the hidden_only
247 * parameter, this search can be limited to hidden chat conversations. The
248 * max_count parameter will limit the total number of chat converations
249 * returned if greater than zero. The returned list should be freed by the
250 * caller.
252 * Returns: (transfer container) (element-type PurpleConversation): List of PurpleChatConversation matching criteria, or %NULL.
254 GList *
255 pidgin_conversations_get_unseen_chats(PidginUnseenState min_state,
256 gboolean hidden_only,
257 guint max_count);
260 * pidgin_conversations_fill_menu:
261 * @menu: Menu widget to add items to.
262 * @convs: (element-type PurpleConversation): List of PurpleConversation to add to menu.
264 * Fill a menu with a list of conversations. Clicking the conversation
265 * menu item will present that conversation to the user.
267 * Returns: Number of conversations added to menu.
269 guint
270 pidgin_conversations_fill_menu(GtkWidget *menu, GList *convs);
273 * pidgin_conv_present_conversation:
274 * @conv: The conversation.
276 * Presents a purple conversation to the user.
278 void pidgin_conv_present_conversation(PurpleConversation *conv);
281 * pidgin_conv_attach_to_conversation:
282 * @conv: The conversation.
284 * Reattach Pidgin UI to a conversation.
286 * Returns: Wheter Pidgin UI was successfully attached.
288 gboolean pidgin_conv_attach_to_conversation(PurpleConversation *conv);
291 * pidgin_conv_get_window:
292 * @gtkconv: The GTK+ conversation.
294 * Returns: The window the conversation belongs to.
296 PidginConvWindow *pidgin_conv_get_window(PidginConversation *gtkconv);
299 * pidgin_conv_get_tab_icon:
300 * @conv: The conversation.
301 * @small_icon: Whether to get the small icon.
303 * Returns: (transfer full): The tab icon.
305 GdkPixbuf *pidgin_conv_get_tab_icon(PurpleConversation *conv, gboolean small_icon);
308 * pidgin_conv_new:
309 * @conv: The conversation.
311 * Creates a new GTK+ conversation for a given #PurpleConversation.
313 void pidgin_conv_new(PurpleConversation *conv);
316 * pidgin_conv_get_tab_at_xy:
317 * @win: The conversation window.
318 * @x: X-coordinate to look up.
319 * @y: Y-coordinate to look up.
320 * @to_right: (out): Return address for a boolean which will be %TRUE if the
321 * coordinates are on the right side of the tab (or bottom in case of
322 * a vertical notebook), %FALSE otherwise.
324 * Returns: The tab index of a conversation in @win at (@x, @y).
326 int pidgin_conv_get_tab_at_xy(PidginConvWindow *win, int x, int y, gboolean *to_right);
329 * pidgin_conv_is_hidden:
330 * @gtkconv: The GTK+ conversation.
332 * Returns: %TRUE if the conversation is hidden, %FALSE otherwise.
334 gboolean pidgin_conv_is_hidden(PidginConversation *gtkconv);
336 /**************************************************************************/
337 /* GTK+ Conversations Subsystem */
338 /**************************************************************************/
341 * pidgin_conversations_get_handle:
343 * Returns the gtk conversations subsystem handle.
345 * Returns: The conversations subsystem handle.
347 void *pidgin_conversations_get_handle(void);
350 * pidgin_conversations_init:
352 * Initializes the GTK+ conversations subsystem.
354 void pidgin_conversations_init(void);
357 * pidgin_conversations_uninit:
359 * Uninitialized the GTK+ conversation subsystem.
361 void pidgin_conversations_uninit(void);
363 G_END_DECLS
365 #endif /* _PIDGIN_CONVERSATION_H_ */