Merged pidgin/main into default
[pidgin-git.git] / pidgin / gtkconvwin.h
blob5e59b491245cbfd366669a84de0615e36b16c680
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_WINDOW_H_
23 #define _PIDGIN_CONVERSATION_WINDOW_H_
24 /**
25 * SECTION:gtkconvwin
26 * @section_id: pidgin-gtkconvwin
27 * @short_description: <filename>gtkconvwin.h</filename>
28 * @title: Conversation Window API
31 #define PIDGIN_TYPE_CONV_WINDOW (pidgin_conv_window_get_type())
33 typedef struct _PidginConvWindowMenu PidginConvWindowMenu;
34 typedef struct _PidginConvWindow PidginConvWindow;
37 /**************************************************************************
38 * Structures
39 **************************************************************************/
41 struct _PidginConvWindowMenu
43 GtkUIManager *ui;
44 GtkWidget *menubar;
46 GtkAction *view_log;
48 GtkAction *audio_call;
49 GtkAction *video_call;
50 GtkAction *audio_video_call;
52 GtkAction *send_file;
53 GtkAction *get_attention;
54 GtkAction *add_pounce;
55 GtkAction *get_info;
56 GtkAction *invite;
58 GtkAction *alias;
59 GtkAction *block;
60 GtkAction *unblock;
61 GtkAction *add;
62 GtkAction *remove;
64 GtkAction *insert_link;
65 GtkAction *insert_image;
67 GtkAction *logging;
68 GtkAction *sounds;
69 GtkAction *show_formatting_toolbar;
71 GtkWidget *send_to;
72 GtkWidget *e2ee;
74 GtkWidget *tray;
76 GtkWidget *typing_icon;
79 /**
80 * PidginConvWindow:
81 * @window: The window.
82 * @notebook: The notebook of conversations.
83 * @notebook_menu: The menu on the notebook.
84 * @clicked_tab: The menu currently clicked.
86 * A GTK+ representation of a graphical window containing one or more
87 * conversations.
89 struct _PidginConvWindow
91 /*< private >*/
92 gint box_count;
94 /*< public >*/
95 GtkWidget *window;
96 GtkWidget *notebook;
97 GtkWidget *notebook_menu;
98 PidginConversation *clicked_tab;
99 GList *gtkconvs;
101 PidginConvWindowMenu *menu;
103 /* Tab dragging stuff. */
104 gboolean in_drag;
105 gboolean in_predrag;
107 gint drag_tab;
109 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y;
111 gint drag_motion_signal;
112 gint drag_leave_signal;
115 G_BEGIN_DECLS
117 /**************************************************************************
118 * GTK+ Conversation Window API
119 **************************************************************************/
122 * pidgin_conv_window_get_type:
124 * Returns: The #GType for the #PidginConvWindow boxed structure.
126 GType pidgin_conv_window_get_type(void);
129 * pidgin_conv_window_new:
131 * Returns: A new #PidginConvWindow.
133 PidginConvWindow * pidgin_conv_window_new(void);
136 * pidgin_conv_window_destroy:
137 * @win: The conversation window to destroy
139 void pidgin_conv_window_destroy(PidginConvWindow *win);
142 * pidgin_conv_windows_get_list:
144 * Returns: (transfer none) (element-type Pidgin.ConvWindow): The list of
145 * windows.
147 GList *pidgin_conv_windows_get_list(void);
150 * pidgin_conv_window_show:
151 * @win: The conversation window to show
153 void pidgin_conv_window_show(PidginConvWindow *win);
156 * pidgin_conv_window_hide:
157 * @win: The conversation window to hide
159 void pidgin_conv_window_hide(PidginConvWindow *win);
162 * pidgin_conv_window_raise:
163 * @win: The conversation window to raise
165 void pidgin_conv_window_raise(PidginConvWindow *win);
168 * pidgin_conv_window_switch_gtkconv:
169 * @win: The conversation window
170 * @gtkconv: The pidgin conversation to switch to
172 void pidgin_conv_window_switch_gtkconv(PidginConvWindow *win, PidginConversation *gtkconv);
175 * pidgin_conv_window_add_gtkconv:
176 * @win: The conversation window
177 * @gtkconv: The pidgin conversation to add
179 void pidgin_conv_window_add_gtkconv(PidginConvWindow *win, PidginConversation *gtkconv);
182 * pidgin_conv_window_remove_gtkconv:
183 * @win: The conversation window
184 * @gtkconv: The pidgin conversation to remove
186 void pidgin_conv_window_remove_gtkconv(PidginConvWindow *win, PidginConversation *gtkconv);
189 * pidgin_conv_window_get_gtkconv_at_index:
190 * @win: The conversation window
191 * @index: The index in the window to get the conversation from
193 * Returns: The conversation in @win at @index
195 PidginConversation *pidgin_conv_window_get_gtkconv_at_index(const PidginConvWindow *win, int index);
198 * pidgin_conv_window_get_active_gtkconv:
199 * @win: The conversation window
201 * Returns: The active #PidginConversation in @win.
203 PidginConversation *pidgin_conv_window_get_active_gtkconv(const PidginConvWindow *win);
206 * pidgin_conv_window_get_active_conversation:
207 * @win: The conversation window
209 * Returns: The active #PurpleConversation in @win.
211 PurpleConversation *pidgin_conv_window_get_active_conversation(const PidginConvWindow *win);
214 * pidgin_conv_window_is_active_conversation:
215 * @conv: The conversation
217 * Returns: %TRUE if @conv is the active conversation, %FALSE otherwise.
219 gboolean pidgin_conv_window_is_active_conversation(const PurpleConversation *conv);
222 * pidgin_conv_window_has_focus:
223 * @win: The conversation window
225 * Returns: %TRUE if @win has focus, %FALSE otherwise.
227 gboolean pidgin_conv_window_has_focus(PidginConvWindow *win);
230 * pidgin_conv_window_get_at_event:
231 * @event: The event
233 * Returns: The #PidginConvWindow on which @event occured.
235 PidginConvWindow *pidgin_conv_window_get_at_event(GdkEvent *event);
238 * pidgin_conv_window_get_gtkconvs:
239 * @win: The conversation window
241 * Returns: (transfer none) (element-type Pidgin.Conversation): A list of
242 * #PidginConversation's in @win.
244 GList *pidgin_conv_window_get_gtkconvs(PidginConvWindow *win);
247 * pidgin_conv_window_get_gtkconv_count:
248 * @win: The conversation window
250 * Returns: The number of conversations in @win
252 guint pidgin_conv_window_get_gtkconv_count(PidginConvWindow *win);
255 * pidgin_conv_window_first_im:
257 * Returns: The window which has the first IM, %NULL if no IM is found.
259 PidginConvWindow *pidgin_conv_window_first_im(void);
262 * pidgin_conv_window_last_im:
264 * Returns: The window which has the last IM, %NULL if no IM is found.
266 PidginConvWindow *pidgin_conv_window_last_im(void);
269 * pidgin_conv_window_first_chat:
271 * Returns: The window which has the first chat, %NULL if no chat is found.
273 PidginConvWindow *pidgin_conv_window_first_chat(void);
276 * pidgin_conv_window_last_chat:
278 * Returns: The window which has the last chat, %NULL if no chat is found.
280 PidginConvWindow *pidgin_conv_window_last_chat(void);
282 /**************************************************************************
283 * GTK+ Conversation Placement API
284 **************************************************************************/
286 typedef void (*PidginConvPlacementFunc)(PidginConversation *);
288 GList *pidgin_conv_placement_get_options(void);
289 const char *pidgin_conv_placement_get_name(const char *id);
290 void pidgin_conv_placement_place(PidginConversation *gtkconv);
293 * pidgin_conv_placement_add_fnc: (skip)
295 void pidgin_conv_placement_add_fnc(const char *id, const char *name, PidginConvPlacementFunc fnc);
298 * pidgin_conv_placement_remove_fnc: (skip)
300 void pidgin_conv_placement_remove_fnc(const char *id);
303 * pidgin_conv_placement_get_fnc: (skip)
305 PidginConvPlacementFunc pidgin_conv_placement_get_fnc(const char *id);
308 * pidgin_conv_placement_set_current_func: (skip)
310 void pidgin_conv_placement_set_current_func(PidginConvPlacementFunc func);
313 * pidgin_conv_placement_get_current_func: (skip)
315 PidginConvPlacementFunc pidgin_conv_placement_get_current_func(void);
317 G_END_DECLS
319 #endif /* _PIDGIN_CONVERSATION_WINDOW_H_ */