Mercurial > pidgin
annotate src/gtkimhtml.h @ 12553:9d7fb0b21d9f
[gaim-migrate @ 14871]
one reactionary pref down, eleventy billion to go
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Mon, 19 Dec 2005 05:55:30 +0000 |
parents | 3726ff9022f3 |
children | adf79d8ceb2d |
rev | line source |
---|---|
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5012
diff
changeset
|
1 /** |
5967 | 2 * @file gtkimhtml.h GTK+ IM/HTML rendering component |
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5012
diff
changeset
|
3 * @ingroup gtkui |
1428 | 4 * |
8046 | 5 * Gaim is the legal property of its developers, whose names are too numerous |
6 * to list here. Please refer to the COPYRIGHT file distributed with this | |
7 * source distribution. | |
1428 | 8 * |
9 * This program is free software; you can redistribute it and/or modify | |
10 * under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 */ | |
9713 | 23 #ifndef _GAIM_GTKIMHTML_H_ |
24 #define _GAIM_GTKIMHTML_H_ | |
1428 | 25 |
26 #include <gdk/gdk.h> | |
3922 | 27 #include <gtk/gtktextview.h> |
4735 | 28 #include <gtk/gtktooltips.h> |
5012 | 29 #include <gtk/gtkimage.h> |
1428 | 30 |
31 #ifdef __cplusplus | |
32 extern "C" { | |
33 #endif | |
34 | |
9033 | 35 /************************************************************************** |
36 * @name Structures | |
37 **************************************************************************/ | |
38 /*@{*/ | |
39 | |
1428 | 40 #define GTK_TYPE_IMHTML (gtk_imhtml_get_type ()) |
41 #define GTK_IMHTML(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IMHTML, GtkIMHtml)) | |
42 #define GTK_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMHTML, GtkIMHtmlClass)) | |
43 #define GTK_IS_IMHTML(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IMHTML)) | |
44 #define GTK_IS_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMHTML)) | |
5967 | 45 #define GTK_IMHTML_SCALABLE(obj) ((GtkIMHtmlScalable *)obj) |
1428 | 46 |
5967 | 47 typedef struct _GtkIMHtml GtkIMHtml; |
48 typedef struct _GtkIMHtmlClass GtkIMHtmlClass; | |
49 typedef struct _GtkIMHtmlFontDetail GtkIMHtmlFontDetail; /* The five elements contained in a FONT tag */ | |
50 typedef struct _GtkSmileyTree GtkSmileyTree; | |
51 typedef struct _GtkIMHtmlSmiley GtkIMHtmlSmiley; | |
52 typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; | |
53 typedef struct _GtkIMHtmlImage GtkIMHtmlImage; | |
54 typedef struct _GtkIMHtmlHr GtkIMHtmlHr; | |
8962 | 55 typedef struct _GtkIMHtmlFuncs GtkIMHtmlFuncs; |
8061 | 56 |
8420 | 57 typedef enum { |
10776 | 58 GTK_IMHTML_BOLD = 1 << 0, |
59 GTK_IMHTML_ITALIC = 1 << 1, | |
60 GTK_IMHTML_UNDERLINE = 1 << 2, | |
61 GTK_IMHTML_GROW = 1 << 3, | |
62 GTK_IMHTML_SHRINK = 1 << 4, | |
63 GTK_IMHTML_FACE = 1 << 5, | |
64 GTK_IMHTML_FORECOLOR = 1 << 6, | |
65 GTK_IMHTML_BACKCOLOR = 1 << 7, | |
66 GTK_IMHTML_BACKGROUND = 1 << 8, | |
67 GTK_IMHTML_LINK = 1 << 9, | |
68 GTK_IMHTML_IMAGE = 1 << 10, | |
69 GTK_IMHTML_SMILEY = 1 << 11, | |
70 GTK_IMHTML_LINKDESC = 1 << 12, | |
71 GTK_IMHTML_STRIKE = 1 << 13, | |
72 GTK_IMHTML_ALL = -1 | |
8420 | 73 } GtkIMHtmlButtons; |
8061 | 74 |
11525 | 75 typedef enum { |
76 GTK_IMHTML_SMILEY_CUSTOM = 1 << 0 | |
77 } GtkIMHtmlSmileyFlags; | |
78 | |
1428 | 79 struct _GtkIMHtml { |
3922 | 80 GtkTextView text_view; |
81 GtkTextBuffer *text_buffer; | |
1428 | 82 GdkCursor *hand_cursor; |
83 GdkCursor *arrow_cursor; | |
8061 | 84 GdkCursor *text_cursor; |
4032 | 85 GHashTable *smiley_data; |
86 GtkSmileyTree *default_smilies; | |
8456 | 87 char *protocol_name; |
10798 | 88 guint scroll_src; |
89 GTimer *scroll_time; | |
4254 | 90 |
6124 | 91 gboolean show_comments; |
4735 | 92 |
93 GtkWidget *tip_window; | |
94 char *tip; | |
95 guint tip_timer; | |
10799 | 96 GtkTextTag *prelit_tag; |
4895 | 97 |
98 GList *scalables; | |
4947 | 99 GdkRectangle old_rect; |
7295 | 100 |
8061 | 101 gchar *search_string; |
7694 | 102 |
8061 | 103 gboolean editable; |
8420 | 104 GtkIMHtmlButtons format_functions; |
8677 | 105 gboolean wbfo; /* Whole buffer formatting only. */ |
106 | |
107 gint insert_offset; | |
8420 | 108 |
8061 | 109 struct { |
8677 | 110 gboolean bold:1; |
111 gboolean italic:1; | |
112 gboolean underline:1; | |
9924 | 113 gboolean strike:1; |
8677 | 114 gchar *forecolor; |
115 gchar *backcolor; | |
10776 | 116 gchar *background; |
8677 | 117 gchar *fontface; |
8061 | 118 int fontsize; |
8677 | 119 GtkTextTag *link; |
8061 | 120 } edit; |
8740
61a090413b93
[gaim-migrate @ 9495]
Christian Hammond <chipx86@chipx86.com>
parents:
8735
diff
changeset
|
121 |
8681 | 122 char *clipboard_text_string; |
123 char *clipboard_html_string; | |
8962 | 124 |
125 GSList *im_images; | |
126 GtkIMHtmlFuncs *funcs; | |
1428 | 127 }; |
128 | |
129 struct _GtkIMHtmlClass { | |
3922 | 130 GtkTextViewClass parent_class; |
1428 | 131 |
5967 | 132 void (*url_clicked)(GtkIMHtml *, const gchar *); |
8420 | 133 void (*buttons_update)(GtkIMHtml *, GtkIMHtmlButtons); |
134 void (*toggle_format)(GtkIMHtml *, GtkIMHtmlButtons); | |
8427 | 135 void (*clear_format)(GtkIMHtml *); |
8506 | 136 void (*update_format)(GtkIMHtml *); |
10108 | 137 gboolean (*message_send)(GtkIMHtml *); |
5967 | 138 }; |
139 | |
140 struct _GtkIMHtmlFontDetail { | |
141 gushort size; | |
142 gchar *face; | |
143 gchar *fore; | |
144 gchar *back; | |
10776 | 145 gchar *bg; |
5967 | 146 gchar *sml; |
9950 | 147 gboolean underline; |
5967 | 148 }; |
149 | |
150 struct _GtkSmileyTree { | |
151 GString *values; | |
152 GtkSmileyTree **children; | |
153 GtkIMHtmlSmiley *image; | |
1428 | 154 }; |
155 | |
4263 | 156 struct _GtkIMHtmlSmiley { |
157 gchar *smile; | |
158 gchar *file; | |
6814
782907a6ae65
[gaim-migrate @ 7354]
Christian Hammond <chipx86@chipx86.com>
parents:
6282
diff
changeset
|
159 GdkPixbufAnimation *icon; |
4263 | 160 gboolean hidden; |
10526 | 161 GdkPixbufLoader *loader; |
11525 | 162 GSList *anchors; |
12335 | 163 GtkIMHtmlSmileyFlags flags; |
164 GtkIMHtml *imhtml; | |
4263 | 165 }; |
166 | |
5967 | 167 struct _GtkIMHtmlScalable { |
4895 | 168 void (*scale)(struct _GtkIMHtmlScalable *, int, int); |
169 void (*add_to)(struct _GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
170 void (*free)(struct _GtkIMHtmlScalable *); | |
171 }; | |
172 | |
5967 | 173 struct _GtkIMHtmlImage { |
4895 | 174 GtkIMHtmlScalable scalable; |
5012 | 175 GtkImage *image; |
5046 | 176 GdkPixbuf *pixbuf; |
4895 | 177 GtkTextMark *mark; |
5012 | 178 gchar *filename; |
4895 | 179 int width; |
180 int height; | |
8962 | 181 int id; |
9573 | 182 GtkWidget *filesel; |
5967 | 183 }; |
4895 | 184 |
5967 | 185 struct _GtkIMHtmlHr { |
4895 | 186 GtkIMHtmlScalable scalable; |
187 GtkWidget *sep; | |
5967 | 188 }; |
189 | |
190 typedef enum { | |
12553 | 191 GTK_IMHTML_NO_COLOURS = 1 << 0, |
192 GTK_IMHTML_NO_FONTS = 1 << 1, | |
193 GTK_IMHTML_NO_COMMENTS = 1 << 2, /* Remove */ | |
194 GTK_IMHTML_NO_TITLE = 1 << 3, | |
195 GTK_IMHTML_NO_NEWLINE = 1 << 4, | |
196 GTK_IMHTML_NO_SIZES = 1 << 5, | |
197 GTK_IMHTML_NO_SCROLL = 1 << 6, | |
198 GTK_IMHTML_RETURN_LOG = 1 << 7, | |
199 GTK_IMHTML_USE_POINTSIZE = 1 << 8, | |
200 GTK_IMHTML_NO_FORMATTING = 1 << 9, | |
201 GTK_IMHTML_USE_SMOOTHSCROLLING = 1 << 10 | |
5967 | 202 } GtkIMHtmlOptions; |
203 | |
10145 | 204 enum { |
205 GTK_IMHTML_DRAG_URL = 0, | |
206 GTK_IMHTML_DRAG_HTML, | |
207 GTK_IMHTML_DRAG_UTF8_STRING, | |
208 GTK_IMHTML_DRAG_COMPOUND_TEXT, | |
209 GTK_IMHTML_DRAG_STRING, | |
210 GTK_IMHTML_DRAG_TEXT, | |
211 GTK_IMHTML_DRAG_NUM | |
212 }; | |
213 | |
214 #define GTK_IMHTML_DND_TARGETS \ | |
10345 | 215 { "text/uri-list", 0, GTK_IMHTML_DRAG_URL }, \ |
10243 | 216 { "_NETSCAPE_URL", 0, GTK_IMHTML_DRAG_URL }, \ |
10145 | 217 { "text/html", 0, GTK_IMHTML_DRAG_HTML }, \ |
218 { "x-url/ftp", 0, GTK_IMHTML_DRAG_URL }, \ | |
219 { "x-url/http", 0, GTK_IMHTML_DRAG_URL }, \ | |
220 { "UTF8_STRING", 0, GTK_IMHTML_DRAG_UTF8_STRING }, \ | |
221 { "COMPOUND_TEXT", 0, GTK_IMHTML_DRAG_COMPOUND_TEXT }, \ | |
222 { "STRING", 0, GTK_IMHTML_DRAG_STRING }, \ | |
223 { "text/plain", 0, GTK_IMHTML_DRAG_TEXT }, \ | |
224 { "TEXT", 0, GTK_IMHTML_DRAG_TEXT } | |
225 | |
8962 | 226 typedef gpointer (*GtkIMHtmlGetImageFunc) (int id); |
227 typedef gpointer (*GtkIMHtmlGetImageDataFunc) (gpointer i); | |
228 typedef size_t (*GtkIMHtmlGetImageSizeFunc) (gpointer i); | |
229 typedef const char *(*GtkIMHtmlGetImageFilenameFunc)(gpointer i); | |
230 typedef void (*GtkIMHtmlImageRefFunc) (int id); | |
231 typedef void (*GtkIMHtmlImageUnrefFunc) (int id); | |
232 | |
233 struct _GtkIMHtmlFuncs { | |
234 GtkIMHtmlGetImageFunc image_get; | |
235 GtkIMHtmlGetImageDataFunc image_get_data; | |
236 GtkIMHtmlGetImageSizeFunc image_get_size; | |
237 GtkIMHtmlGetImageFilenameFunc image_get_filename; | |
238 GtkIMHtmlImageRefFunc image_ref; | |
239 GtkIMHtmlImageUnrefFunc image_unref; | |
240 }; | |
241 | |
9033 | 242 /*@}*/ |
8962 | 243 |
9033 | 244 /************************************************************************** |
245 * @name GTK+ IM/HTML rendering component API | |
246 **************************************************************************/ | |
247 /*@{*/ | |
248 | |
249 /** | |
9037 | 250 * Returns the GType object for an IM/HTML widget. |
9033 | 251 * |
9037 | 252 * @return The GType for an IM/HTML widget. |
9033 | 253 */ |
9037 | 254 GType gtk_imhtml_get_type(void); |
5967 | 255 |
9033 | 256 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
257 * Creates and returns a new GTK+ IM/HTML widget. |
9033 | 258 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
259 * @return The GTK+ IM/HTML widget created. |
9033 | 260 */ |
261 GtkWidget *gtk_imhtml_new(void *, void *); | |
5967 | 262 |
9033 | 263 /** |
10526 | 264 * Returns the smiley object associated with the text. |
265 * | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
266 * @param imhtml The GTK+ IM/HTML. |
10526 | 267 * @param sml The name of the smiley category. |
268 * @param text The text associated with the smiley. | |
269 */ | |
270 | |
271 GtkIMHtmlSmiley *gtk_imhtml_smiley_get(GtkIMHtml * imhtml, | |
272 const gchar * sml, const gchar * text); | |
273 | |
274 | |
275 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
276 * Associates a smiley with a GTK+ IM/HTML. |
9033 | 277 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
278 * @param imhtml The GTK+ IM/HTML. |
9033 | 279 * @param sml The name of the smiley category. |
280 * @param smiley The GtkIMSmiley to associate. | |
281 */ | |
10537 | 282 void gtk_imhtml_associate_smiley(GtkIMHtml *imhtml, const gchar *sml, GtkIMHtmlSmiley *smiley); |
9033 | 283 |
284 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
285 * Removes all smileys associated with a GTK+ IM/HTML. |
9033 | 286 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
287 * @param imhtml The GTK+ IM/HTML. |
9033 | 288 */ |
289 void gtk_imhtml_remove_smileys(GtkIMHtml *imhtml); | |
5967 | 290 |
9033 | 291 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
292 * Sets the function callbacks to use with a GTK+ IM/HTML instance. |
9033 | 293 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
294 * @param imhtml The GTK+ IM/HTML. |
9033 | 295 * @param f The GtkIMHTMLFuncs struct containing the functions to use. |
296 */ | |
297 void gtk_imhtml_set_funcs(GtkIMHtml *imhtml, GtkIMHtmlFuncs *f); | |
5967 | 298 |
9033 | 299 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
300 * Enables or disables showing the contents of HTML comments in a GTK+ IM/HTML. |
9033 | 301 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
302 * @param imhtml The GTK+ IM/HTML. |
9033 | 303 * @param show @c TRUE if comments should be shown, or @c FALSE otherwise. |
304 */ | |
305 void gtk_imhtml_show_comments(GtkIMHtml *imhtml, gboolean show); | |
8962 | 306 |
9033 | 307 /** |
11814
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11525
diff
changeset
|
308 * Gets the protocol name associated with this GTK+ IM/HTML. |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11525
diff
changeset
|
309 * |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11525
diff
changeset
|
310 * @param imhtml The GTK+ IM/HTML |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11525
diff
changeset
|
311 */ |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11525
diff
changeset
|
312 const char *gtk_imhtml_get_protocol_name(GtkIMHtml *imhtml); |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11525
diff
changeset
|
313 |
fa17fc619f17
[gaim-migrate @ 14105]
Richard Laager <rlaager@wiktel.com>
parents:
11525
diff
changeset
|
314 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
315 * Associates a protocol name with a GTK+ IM/HTML. |
9033 | 316 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
317 * @param imhtml The GTK+ IM/HTML. |
9033 | 318 * @param protocol_name The protocol name to associate with the IM/HTML. |
319 */ | |
320 void gtk_imhtml_set_protocol_name(GtkIMHtml *imhtml, const gchar *protocol_name); | |
8456 | 321 |
9033 | 322 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
323 * Appends HTML formatted text to a GTK+ IM/HTML. |
9033 | 324 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
325 * @param imhtml The GTK+ IM/HTML. |
9033 | 326 * @param text The formatted text to append. |
327 * @param options A GtkIMHtmlOptions object indicating insert behavior. | |
328 */ | |
9307 | 329 #define gtk_imhtml_append_text(imhtml, text, options) \ |
330 gtk_imhtml_append_text_with_images(imhtml, text, options, NULL) | |
6982 | 331 |
9033 | 332 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
333 * Appends HTML formatted text to a GTK+ IM/HTML. |
9033 | 334 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
335 * @param imhtml The GTK+ IM/HTML. |
9033 | 336 * @param text The formatted text to append. |
337 * @param options A GtkIMHtmlOptions object indicating insert behavior. | |
9185 | 338 * @param unused Use @c NULL value. |
9033 | 339 */ |
340 void gtk_imhtml_append_text_with_images(GtkIMHtml *imhtml, | |
341 const gchar *text, | |
342 GtkIMHtmlOptions options, | |
343 GSList *unused); | |
344 | |
345 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
346 * Inserts HTML formatted text to a GTK+ IM/HTML at a given iter. |
9033 | 347 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
348 * @param imhtml The GTK+ IM/HTML. |
9033 | 349 * @param text The formatted text to append. |
350 * @param options A GtkIMHtmlOptions object indicating insert behavior. | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
351 * @param iter A GtkTextIter in the GTK+ IM/HTML at which to insert text. |
9033 | 352 */ |
8677 | 353 void gtk_imhtml_insert_html_at_iter(GtkIMHtml *imhtml, |
354 const gchar *text, | |
355 GtkIMHtmlOptions options, | |
356 GtkTextIter *iter); | |
9033 | 357 |
358 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
359 * Scrolls a GTK+ IM/HTML to the end of its contents. |
9033 | 360 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
361 * @param imhtml The GTK+ IM/HTML. |
9033 | 362 */ |
12553 | 363 void gtk_imhtml_scroll_to_end(GtkIMHtml *imhtml, gboolean smooth); |
9033 | 364 |
365 /** | |
11224
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
366 * Delete the contents of a GTK+ IM/HTML between start and end. |
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
367 * |
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
368 * @param imhtml The GTK+ IM/HTML. |
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
369 * @param start a postition in the imhtml's buffer |
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
370 * @param end another postition in the imhtml's buffer |
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
371 */ |
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
372 void gtk_imhtml_delete(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *end); |
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
373 |
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
374 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
375 * Purges the contents from a GTK+ IM/HTML and resets formatting. |
9033 | 376 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
377 * @param imhtml The GTK+ IM/HTML. |
9033 | 378 */ |
11224
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
379 #define gtk_imhtml_clear(imhtml) \ |
409d6a11da51
[gaim-migrate @ 13360]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10814
diff
changeset
|
380 gtk_imhtml_delete(imhtml, NULL, NULL) |
4895 | 381 |
9033 | 382 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
383 * Scrolls a GTK+ IM/HTML up by one page. |
9033 | 384 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
385 * @param imhtml The GTK+ IM/HTML. |
9033 | 386 */ |
387 void gtk_imhtml_page_up(GtkIMHtml *imhtml); | |
388 | |
389 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
390 * Scrolls a GTK+ IM/HTML down by one page. |
9033 | 391 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
392 * @param imhtml The GTK+ IM/HTML. |
9033 | 393 */ |
394 void gtk_imhtml_page_down(GtkIMHtml *imhtml); | |
395 | |
396 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
397 * Creates and returns an new GTK+ IM/HTML scalable object. |
9033 | 398 * |
399 * @return A new IM/HTML Scalable object. | |
400 */ | |
12323
fc464a0abccc
[gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents:
11814
diff
changeset
|
401 GtkIMHtmlScalable *gtk_imhtml_scalable_new(void); |
9033 | 402 |
403 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
404 * Creates and returns an new GTK+ IM/HTML scalable object with an image. |
9033 | 405 * |
406 * @param img A GdkPixbuf of the image to add. | |
407 * @param filename The filename to associate with the image. | |
408 * @param id The id to associate with the image. | |
409 * | |
410 * @return A new IM/HTML Scalable object with an image. | |
411 */ | |
8962 | 412 GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, const gchar *filename, int id); |
9033 | 413 |
414 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
415 * Destroys and frees a GTK+ IM/HTML scalable image. |
9033 | 416 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
417 * @param scale The GTK+ IM/HTML scalable. |
9033 | 418 */ |
419 void gtk_imhtml_image_free(GtkIMHtmlScalable *scale); | |
4895 | 420 |
9033 | 421 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
422 * Rescales a GTK+ IM/HTML scalable image to a given size. |
9033 | 423 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
424 * @param scale The GTK+ IM/HTML scalable. |
9033 | 425 * @param width The new width. |
426 * @param height The new height. | |
427 */ | |
428 void gtk_imhtml_image_scale(GtkIMHtmlScalable *scale, int width, int height); | |
429 | |
430 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
431 * Adds a GTK+ IM/HTML scalable image to a given GTK+ IM/HTML at a given iter. |
9033 | 432 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
433 * @param scale The GTK+ IM/HTML scalable. |
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
434 * @param imhtml The GTK+ IM/HTML. |
9033 | 435 * @param iter The GtkTextIter at which to add the scalable. |
436 */ | |
437 void gtk_imhtml_image_add_to(GtkIMHtmlScalable *scale, GtkIMHtml *imhtml, GtkTextIter *iter); | |
438 | |
439 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
440 * Creates and returns an new GTK+ IM/HTML scalable with a horizontal rule. |
9033 | 441 * |
442 * @return A new IM/HTML Scalable object with an image. | |
443 */ | |
12323
fc464a0abccc
[gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents:
11814
diff
changeset
|
444 GtkIMHtmlScalable *gtk_imhtml_hr_new(void); |
9033 | 445 |
446 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
447 * Destroys and frees a GTK+ IM/HTML scalable horizontal rule. |
9033 | 448 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
449 * @param scale The GTK+ IM/HTML scalable. |
9033 | 450 */ |
9034 | 451 void gtk_imhtml_hr_free(GtkIMHtmlScalable *scale); |
9033 | 452 |
453 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
454 * Rescales a GTK+ IM/HTML scalable horizontal rule to a given size. |
9033 | 455 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
456 * @param scale The GTK+ IM/HTML scalable. |
9033 | 457 * @param width The new width. |
458 * @param height The new height. | |
459 */ | |
9034 | 460 void gtk_imhtml_hr_scale(GtkIMHtmlScalable *scale, int width, int height); |
4895 | 461 |
9033 | 462 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
463 * Adds a GTK+ IM/HTML scalable horizontal rule to a given GTK+ IM/HTML at |
9033 | 464 * a given iter. |
465 * | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
466 * @param scale The GTK+ IM/HTML scalable. |
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
467 * @param imhtml The GTK+ IM/HTML. |
9033 | 468 * @param iter The GtkTextIter at which to add the scalable. |
469 */ | |
9307 | 470 void gtk_imhtml_hr_add_to(GtkIMHtmlScalable *scale, GtkIMHtml *imhtml, GtkTextIter *iter); |
9033 | 471 |
472 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
473 * Finds and highlights a given string in a GTK+ IM/HTML. |
9033 | 474 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
475 * @param imhtml The GTK+ IM/HTML. |
9033 | 476 * @param text The string to search for. |
477 * | |
478 * @return @c TRUE if a search was performed, or @c FALSE if not. | |
479 */ | |
7295 | 480 gboolean gtk_imhtml_search_find(GtkIMHtml *imhtml, const gchar *text); |
9033 | 481 |
482 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
483 * Clears the highlighting from a prior search in a GTK+ IM/HTML. |
9033 | 484 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
485 * @param imhtml The GTK+ IM/HTML. |
9033 | 486 */ |
7295 | 487 void gtk_imhtml_search_clear(GtkIMHtml *imhtml); |
4895 | 488 |
9033 | 489 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
490 * Enables or disables editing in a GTK+ IM/HTML. |
9033 | 491 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
492 * @param imhtml The GTK+ IM/HTML. |
9033 | 493 * @param editable @c TRUE to make the widget editable, or @c FALSE otherwise. |
494 */ | |
8061 | 495 void gtk_imhtml_set_editable(GtkIMHtml *imhtml, gboolean editable); |
9033 | 496 |
497 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
498 * Enables or disables whole buffer formatting only (wbfo) in a GTK+ IM/HTML. |
9033 | 499 * In this mode formatting options to the buffer take effect for the entire |
500 * buffer instead of specific text. | |
501 * | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
502 * @param imhtml The GTK+ IM/HTML. |
9033 | 503 * @param wbfo @c TRUE to enable the mode, or @c FALSE otherwise. |
504 */ | |
8677 | 505 void gtk_imhtml_set_whole_buffer_formatting_only(GtkIMHtml *imhtml, gboolean wbfo); |
9033 | 506 |
507 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
508 * Indicates which formatting functions to enable and disable in a GTK+ IM/HTML. |
9033 | 509 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
510 * @param imhtml The GTK+ IM/HTML. |
9185 | 511 * @param buttons A GtkIMHtmlButtons bitmask indicating which functions to use. |
9033 | 512 */ |
8420 | 513 void gtk_imhtml_set_format_functions(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons); |
9033 | 514 |
515 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
516 * Returns which formatting functions are enabled in a GTK+ IM/HTML. |
9033 | 517 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
518 * @param imhtml The GTK+ IM/HTML. |
9033 | 519 * |
9185 | 520 * @return A GtkIMHtmlButtons bitmask indicating which functions to are enabled. |
9033 | 521 */ |
8788 | 522 GtkIMHtmlButtons gtk_imhtml_get_format_functions(GtkIMHtml *imhtml); |
9033 | 523 |
524 /** | |
525 * Sets each boolean to TRUE if that formatting option is enabled at the | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
526 * current position in a GTK+ IM/HTML. |
9033 | 527 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
528 * @param imhtml The GTK+ IM/HTML. |
9033 | 529 * @param bold A reference to a boolean for bold. |
530 * @param italic A reference to a boolean for italic. | |
531 * @param underline A reference to a boolean for underline. | |
532 */ | |
8516 | 533 void gtk_imhtml_get_current_format(GtkIMHtml *imhtml, gboolean *bold, gboolean *italic, gboolean *underline); |
9033 | 534 |
535 /** | |
536 * Returns a string containing the selected font face at the current position | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
537 * in a GTK+ IM/HTML. |
9033 | 538 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
539 * @param imhtml The GTK+ IM/HTML. |
9033 | 540 * |
541 * @return A string containg the font face or @c NULL if none is set. | |
542 */ | |
9025 | 543 char *gtk_imhtml_get_current_fontface(GtkIMHtml *imhtml); |
9033 | 544 |
545 /** | |
546 * Returns a string containing the selected foreground color at the current | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
547 * position in a GTK+ IM/HTML. |
9033 | 548 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
549 * @param imhtml The GTK+ IM/HTML. |
9033 | 550 * |
551 * @return A string containg the foreground color or @c NULL if none is set. | |
552 */ | |
9025 | 553 char *gtk_imhtml_get_current_forecolor(GtkIMHtml *imhtml); |
9033 | 554 |
555 /** | |
10776 | 556 * Returns a string containing the selected font background color at the current |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
557 * position in a GTK+ IM/HTML. |
10776 | 558 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
559 * @param imhtml The GTK+ IM/HTML. |
10776 | 560 * |
561 * @return A string containg the font background color or @c NULL if none is set. | |
562 */ | |
563 char *gtk_imhtml_get_current_backcolor(GtkIMHtml *imhtml); | |
564 | |
565 /** | |
9033 | 566 * Returns a string containing the selected background color at the current |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
567 * position in a GTK+ IM/HTML. |
9033 | 568 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
569 * @param imhtml The GTK+ IM/HTML. |
9033 | 570 * |
571 * @return A string containg the background color or @c NULL if none is set. | |
572 */ | |
10776 | 573 char *gtk_imhtml_get_current_background(GtkIMHtml *imhtml); |
9033 | 574 |
575 /** | |
576 * Returns a integer containing the selected HTML font size at the current | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
577 * position in a GTK+ IM/HTML. |
9033 | 578 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
579 * @param imhtml The GTK+ IM/HTML. |
9033 | 580 * |
581 * @return The HTML font size. | |
582 */ | |
9025 | 583 gint gtk_imhtml_get_current_fontsize(GtkIMHtml *imhtml); |
9033 | 584 |
585 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
586 * Checks whether a GTK+ IM/HTML is marked as editable. |
9033 | 587 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
588 * @param imhtml The GTK+ IM/HTML. |
9033 | 589 * |
590 * @return @c TRUE if the IM/HTML is editable, or @c FALSE otherwise. | |
591 */ | |
8061 | 592 gboolean gtk_imhtml_get_editable(GtkIMHtml *imhtml); |
9033 | 593 |
594 /** | |
11269
1cbe76d30e81
[gaim-migrate @ 13451]
Richard Laager <rlaager@wiktel.com>
parents:
11267
diff
changeset
|
595 * Clear all the formatting on a GTK+ IM/HTML. |
1cbe76d30e81
[gaim-migrate @ 13451]
Richard Laager <rlaager@wiktel.com>
parents:
11267
diff
changeset
|
596 * |
1cbe76d30e81
[gaim-migrate @ 13451]
Richard Laager <rlaager@wiktel.com>
parents:
11267
diff
changeset
|
597 * @param imhtml The GTK+ IM/HTML. |
1cbe76d30e81
[gaim-migrate @ 13451]
Richard Laager <rlaager@wiktel.com>
parents:
11267
diff
changeset
|
598 */ |
1cbe76d30e81
[gaim-migrate @ 13451]
Richard Laager <rlaager@wiktel.com>
parents:
11267
diff
changeset
|
599 void gtk_imhtml_clear_formatting(GtkIMHtml *imhtml); |
1cbe76d30e81
[gaim-migrate @ 13451]
Richard Laager <rlaager@wiktel.com>
parents:
11267
diff
changeset
|
600 |
1cbe76d30e81
[gaim-migrate @ 13451]
Richard Laager <rlaager@wiktel.com>
parents:
11267
diff
changeset
|
601 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
602 * Toggles bold at the cursor location or selection in a GTK+ IM/HTML. |
9033 | 603 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
604 * @param imhtml The GTK+ IM/HTML. |
9033 | 605 */ |
11267
477e5cca8287
[gaim-migrate @ 13449]
Richard Laager <rlaager@wiktel.com>
parents:
11224
diff
changeset
|
606 void gtk_imhtml_toggle_bold(GtkIMHtml *imhtml); |
9033 | 607 |
608 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
609 * Toggles italic at the cursor location or selection in a GTK+ IM/HTML. |
9033 | 610 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
611 * @param imhtml The GTK+ IM/HTML. |
9033 | 612 */ |
11267
477e5cca8287
[gaim-migrate @ 13449]
Richard Laager <rlaager@wiktel.com>
parents:
11224
diff
changeset
|
613 void gtk_imhtml_toggle_italic(GtkIMHtml *imhtml); |
9033 | 614 |
615 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
616 * Toggles underline at the cursor location or selection in a GTK+ IM/HTML. |
9033 | 617 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
618 * @param imhtml The GTK+ IM/HTML. |
9033 | 619 */ |
11267
477e5cca8287
[gaim-migrate @ 13449]
Richard Laager <rlaager@wiktel.com>
parents:
11224
diff
changeset
|
620 void gtk_imhtml_toggle_underline(GtkIMHtml *imhtml); |
9033 | 621 |
622 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
623 * Toggles strikethrough at the cursor location or selection in a GTK+ IM/HTML. |
9924 | 624 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
625 * @param imhtml The GTK+ IM/HTML. |
9924 | 626 */ |
11267
477e5cca8287
[gaim-migrate @ 13449]
Richard Laager <rlaager@wiktel.com>
parents:
11224
diff
changeset
|
627 void gtk_imhtml_toggle_strike(GtkIMHtml *imhtml); |
9924 | 628 |
629 /** | |
9033 | 630 * Toggles a foreground color at the current location or selection in a GTK |
631 * IM/HTML. | |
632 * | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
633 * @param imhtml The GTK+ IM/HTML. |
9185 | 634 * @param color The HTML-style color, or @c NULL or "" to clear the color. |
9033 | 635 * |
636 * @return @c TRUE if a color was set, or @c FALSE if it was cleared. | |
637 */ | |
8061 | 638 gboolean gtk_imhtml_toggle_forecolor(GtkIMHtml *imhtml, const char *color); |
9033 | 639 |
640 /** | |
641 * Toggles a background color at the current location or selection in a GTK | |
642 * IM/HTML. | |
643 * | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
644 * @param imhtml The GTK+ IM/HTML. |
9185 | 645 * @param color The HTML-style color, or @c NULL or "" to clear the color. |
9033 | 646 * |
647 * @return @c TRUE if a color was set, or @c FALSE if it was cleared. | |
648 */ | |
8061 | 649 gboolean gtk_imhtml_toggle_backcolor(GtkIMHtml *imhtml, const char *color); |
9033 | 650 |
651 /** | |
10776 | 652 * Toggles a background color at the current location or selection in a GTK |
653 * IM/HTML. | |
654 * | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
655 * @param imhtml The GTK+ IM/HTML. |
10776 | 656 * @param color The HTML-style color, or @c NULL or "" to clear the color. |
657 * | |
658 * @return @c TRUE if a color was set, or @c FALSE if it was cleared. | |
659 */ | |
660 gboolean gtk_imhtml_toggle_background(GtkIMHtml *imhtml, const char *color); | |
661 | |
662 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
663 * Toggles a font face at the current location or selection in a GTK+ IM/HTML. |
9033 | 664 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
665 * @param imhtml The GTK+ IM/HTML. |
9185 | 666 * @param face The font face name, or @c NULL or "" to clear the font. |
9033 | 667 * |
668 * @return @c TRUE if a font name was set, or @c FALSE if it was cleared. | |
669 */ | |
8061 | 670 gboolean gtk_imhtml_toggle_fontface(GtkIMHtml *imhtml, const char *face); |
9033 | 671 |
672 /** | |
673 * Toggles a link tag with the given URL at the current location or selection | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
674 * in a GTK+ IM/HTML. |
9033 | 675 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
676 * @param imhtml The GTK+ IM/HTML. |
9185 | 677 * @param url The URL for the link or @c NULL to terminate the link. |
9033 | 678 */ |
8677 | 679 void gtk_imhtml_toggle_link(GtkIMHtml *imhtml, const char *url); |
9033 | 680 |
681 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
682 * Inserts a link to the given url at the given GtkTextMark in a GTK+ IM/HTML. |
9033 | 683 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
684 * @param imhtml The GTK+ IM/HTML. |
9033 | 685 * @param mark The GtkTextMark to insert the link at. |
686 * @param url The URL for the link. | |
687 * @param text The string to use for the link description. | |
688 */ | |
8677 | 689 void gtk_imhtml_insert_link(GtkIMHtml *imhtml, GtkTextMark *mark, const char *url, const char *text); |
9033 | 690 |
691 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
692 * Inserts a smiley at the current location or selection in a GTK+ IM/HTML. |
9033 | 693 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
694 * @param imhtml The GTK+ IM/HTML. |
9033 | 695 * @param sml The category of the smiley. |
696 * @param smiley The text of the smiley to insert. | |
697 */ | |
8061 | 698 void gtk_imhtml_insert_smiley(GtkIMHtml *imhtml, const char *sml, char *smiley); |
9033 | 699 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
700 * Inserts a smiley at the given iter in a GTK+ IM/HTML. |
9033 | 701 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
702 * @param imhtml The GTK+ IM/HTML. |
9033 | 703 * @param sml The category of the smiley. |
704 * @param smiley The text of the smiley to insert. | |
705 * @param iter The GtkTextIter in the IM/HTML to insert the smiley at. | |
706 */ | |
8677 | 707 void gtk_imhtml_insert_smiley_at_iter(GtkIMHtml *imhtml, const char *sml, char *smiley, GtkTextIter *iter); |
9033 | 708 |
709 /** | |
710 * Inserts the IM/HTML scalable image with the given id at the given iter in a | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
711 * GTK+ IM/HTML. |
9033 | 712 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
713 * @param imhtml The GTK+ IM/HTML. |
9033 | 714 * @param id The id of the IM/HTML scalable. |
715 * @param iter The GtkTextIter in the IM/HTML to insert the image at. | |
716 */ | |
8962 | 717 void gtk_imhtml_insert_image_at_iter(GtkIMHtml *imhtml, int id, GtkTextIter *iter); |
9033 | 718 |
719 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
720 * Sets the font size at the current location or selection in a GTK+ IM/HTML. |
9033 | 721 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
722 * @param imhtml The GTK+ IM/HTML. |
9033 | 723 * @param size The HTML font size to use. |
724 */ | |
8061 | 725 void gtk_imhtml_font_set_size(GtkIMHtml *imhtml, gint size); |
9033 | 726 |
727 /** | |
728 * Decreases the font size by 1 at the current location or selection in a GTK | |
729 * IM/HTML. | |
730 * | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
731 * @param imhtml The GTK+ IM/HTML. |
9033 | 732 */ |
8061 | 733 void gtk_imhtml_font_shrink(GtkIMHtml *imhtml); |
9033 | 734 |
735 /** | |
736 * Increases the font size by 1 at the current location or selection in a GTK | |
737 * IM/HTML. | |
738 * | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
739 * @param imhtml The GTK+ IM/HTML. |
9033 | 740 */ |
8061 | 741 void gtk_imhtml_font_grow(GtkIMHtml *imhtml); |
9033 | 742 |
743 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
744 * Returns the HTML formatted contents between two iters in a GTK+ IM/HTML. |
9033 | 745 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
746 * @param imhtml The GTK+ IM/HTML. |
9033 | 747 * @param start The GtkTextIter indicating the start point in the IM/HTML. |
748 * @param end The GtkTextIter indicating the end point in the IM/HTML. | |
749 * | |
750 * @return A string containing the HTML formatted text. | |
751 */ | |
8061 | 752 char *gtk_imhtml_get_markup_range(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *end); |
9033 | 753 |
754 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
755 * Returns the entire HTML formatted contents of a GTK+ IM/HTML. |
9033 | 756 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
757 * @param imhtml The GTK+ IM/HTML. |
9033 | 758 * |
759 * @return A string containing the HTML formatted text. | |
760 */ | |
8061 | 761 char *gtk_imhtml_get_markup(GtkIMHtml *imhtml); |
9033 | 762 |
763 /** | |
764 * Returns a null terminated array of pointers to null terminated strings, each | |
765 * string for each line. g_strfreev() should be called to free it when done. | |
766 * | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
767 * @param imhtml The GTK+ IM/HTML. |
9033 | 768 * |
769 * @return A null terminated array of null terminated HTML formatted strings. | |
770 */ | |
8677 | 771 char **gtk_imhtml_get_markup_lines(GtkIMHtml *imhtml); |
9033 | 772 |
773 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
774 * Returns the entire unformatted (plain text) contents of a GTK+ IM/HTML |
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
775 * between two iters in a GTK+ IM/HTML. |
9033 | 776 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10799
diff
changeset
|
777 * @param imhtml The GTK+ IM/HTML. |
9033 | 778 * @param start The GtkTextIter indicating the start point in the IM/HTML. |
9185 | 779 * @param stop The GtkTextIter indicating the end point in the IM/HTML. |
9033 | 780 * |
781 * @return A string containing the unformatted text. | |
782 */ | |
8677 | 783 char *gtk_imhtml_get_text(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *stop); |
8061 | 784 |
9033 | 785 /*@}*/ |
786 | |
1428 | 787 #ifdef __cplusplus |
788 } | |
789 #endif | |
790 | |
9713 | 791 #endif /* _GAIM_GTKIMHTML_H_ */ |