Mercurial > pidgin.yaz
comparison src/gtkimhtml.h @ 9033:4ef4d3220f81
[gaim-migrate @ 9809]
Kevin went and documented gtkimhtml.h for us. Now you have no excuse.
Read Kevin's documentation. Start fixing imhtml bugs.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Sun, 23 May 2004 18:15:15 +0000 |
parents | 697e169dac12 |
children | bbb8733c7818 |
comparison
equal
deleted
inserted
replaced
9032:7e8b94266500 | 9033:4ef4d3220f81 |
---|---|
30 #include <gtk/gtkimage.h> | 30 #include <gtk/gtkimage.h> |
31 | 31 |
32 #ifdef __cplusplus | 32 #ifdef __cplusplus |
33 extern "C" { | 33 extern "C" { |
34 #endif | 34 #endif |
35 | |
36 /************************************************************************** | |
37 * @name Structures | |
38 **************************************************************************/ | |
39 /*@{*/ | |
35 | 40 |
36 #define GTK_TYPE_IMHTML (gtk_imhtml_get_type ()) | 41 #define GTK_TYPE_IMHTML (gtk_imhtml_get_type ()) |
37 #define GTK_IMHTML(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IMHTML, GtkIMHtml)) | 42 #define GTK_IMHTML(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IMHTML, GtkIMHtml)) |
38 #define GTK_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMHTML, GtkIMHtmlClass)) | 43 #define GTK_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMHTML, GtkIMHtmlClass)) |
39 #define GTK_IS_IMHTML(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IMHTML)) | 44 #define GTK_IS_IMHTML(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IMHTML)) |
197 GtkIMHtmlGetImageFilenameFunc image_get_filename; | 202 GtkIMHtmlGetImageFilenameFunc image_get_filename; |
198 GtkIMHtmlImageRefFunc image_ref; | 203 GtkIMHtmlImageRefFunc image_ref; |
199 GtkIMHtmlImageUnrefFunc image_unref; | 204 GtkIMHtmlImageUnrefFunc image_unref; |
200 }; | 205 }; |
201 | 206 |
202 | 207 /*@}*/ |
203 GtkType gtk_imhtml_get_type (void); | 208 |
204 GtkWidget* gtk_imhtml_new (void *, void *); | 209 /************************************************************************** |
205 | 210 * @name GTK+ IM/HTML rendering component API |
206 void gtk_imhtml_set_adjustments (GtkIMHtml *imhtml, | 211 **************************************************************************/ |
207 GtkAdjustment *hadj, | 212 /*@{*/ |
208 GtkAdjustment *vadj); | 213 |
209 | 214 /** |
210 void gtk_imhtml_associate_smiley (GtkIMHtml *imhtml, | 215 * Returns the GtkType object for an IM/HTML widget. |
211 gchar *sml, GtkIMHtmlSmiley *smiley); | 216 * |
212 | 217 * @return The GtkType for an IM/HTML widget. |
213 void gtk_imhtml_remove_smileys (GtkIMHtml *imhtml); | 218 */ |
214 | 219 GtkType gtk_imhtml_get_type(void); |
215 void gtk_imhtml_set_funcs (GtkIMHtml *imhtml, GtkIMHtmlFuncs *f); | 220 |
216 | 221 /** |
217 void gtk_imhtml_show_comments (GtkIMHtml *imhtml, gboolean show); | 222 * Creates and returns a new GTK IM/HTML widget. |
218 | 223 * |
219 void gtk_imhtml_html_shortcuts(GtkIMHtml *imhtml, gboolean allow); | 224 * @return The GTK IM/HTML widget created. |
220 | 225 */ |
221 void gtk_imhtml_smiley_shortcuts (GtkIMHtml *imhtml, gboolean allow); | 226 GtkWidget *gtk_imhtml_new(void *, void *); |
222 | 227 |
223 void gtk_imhtml_set_protocol_name(GtkIMHtml *imhtml, const gchar *protocol_name); | 228 /** |
224 | 229 * Associates a smiley with a GTK IM/HTML. |
225 #define gtk_imhtml_append_text(x, y, z) \ | 230 * |
231 * @param imhtml The GTK IM/HTML. | |
232 * @param sml The name of the smiley category. | |
233 * @param smiley The GtkIMSmiley to associate. | |
234 */ | |
235 void gtk_imhtml_associate_smiley(GtkIMHtml *imhtml, gchar *sml, GtkIMHtmlSmiley *smiley); | |
236 | |
237 /** | |
238 * Removes all smileys associated with a GTK IM/HTML. | |
239 * | |
240 * @param imhtml The GTK IM/HTML. | |
241 */ | |
242 void gtk_imhtml_remove_smileys(GtkIMHtml *imhtml); | |
243 | |
244 /** | |
245 * Sets the function callbacks to use with a GTK IM/HTML instance. | |
246 * | |
247 * @param imhtml The GTK IM/HTML. | |
248 * @param f The GtkIMHTMLFuncs struct containing the functions to use. | |
249 */ | |
250 void gtk_imhtml_set_funcs(GtkIMHtml *imhtml, GtkIMHtmlFuncs *f); | |
251 | |
252 /** | |
253 * Enables or disables showing the contents of HTML comments in a GTK IM/HTML. | |
254 * | |
255 * @param imhtml The GTK IM/HTML. | |
256 * @param show @c TRUE if comments should be shown, or @c FALSE otherwise. | |
257 */ | |
258 void gtk_imhtml_show_comments(GtkIMHtml *imhtml, gboolean show); | |
259 | |
260 /** | |
261 * Enables or disables formatting shortcut keys in a GTK IM/HTML. | |
262 * | |
263 * @param imhtml The GTK IM/HTML. | |
264 * @param allow @c TRUE if shortcut keys are allowed, or @c FALSE otherwise. | |
265 */ | |
266 void gtk_imhtml_html_shortcuts(GtkIMHtml *imhtml, gboolean allow); | |
267 | |
268 /** | |
269 * Enables or disables smiley insertion shortcut keys in a GTK IM/HTML. | |
270 * | |
271 * @param imhtml The GTK IM/HTML. | |
272 * @param allow @c TRUE if shortcut keys are allowed, or @c FALSE otherwise. | |
273 */ | |
274 void gtk_imhtml_smiley_shortcuts(GtkIMHtml *imhtml, gboolean allow); | |
275 | |
276 /** | |
277 * Associates a protocol name with a GTK IM/HTML. | |
278 * | |
279 * @param imhtml The GTK IM/HTML. | |
280 * @param protocol_name The protocol name to associate with the IM/HTML. | |
281 */ | |
282 void gtk_imhtml_set_protocol_name(GtkIMHtml *imhtml, const gchar *protocol_name); | |
283 | |
284 /** | |
285 * Appends HTML formatted text to a GTK IM/HTML. | |
286 * | |
287 * @param imhtml The GTK IM/HTML. | |
288 * @param text The formatted text to append. | |
289 * @param options A GtkIMHtmlOptions object indicating insert behavior. | |
290 */ | |
291 #define gtk_imhtml_append_text(x, y, z) \ | |
226 gtk_imhtml_append_text_with_images(x, y, z, NULL) | 292 gtk_imhtml_append_text_with_images(x, y, z, NULL) |
227 | 293 |
228 void gtk_imhtml_append_text_with_images (GtkIMHtml *imhtml, | 294 /** |
229 const gchar *text, | 295 * Appends HTML formatted text to a GTK IM/HTML. |
230 GtkIMHtmlOptions options, | 296 * |
231 GSList *images); | 297 * @param imhtml The GTK IM/HTML. |
298 * @param text The formatted text to append. | |
299 * @param options A GtkIMHtmlOptions object indicating insert behavior. | |
300 * @param unused Use NULL value. | |
301 */ | |
302 void gtk_imhtml_append_text_with_images(GtkIMHtml *imhtml, | |
303 const gchar *text, | |
304 GtkIMHtmlOptions options, | |
305 GSList *unused); | |
306 | |
307 /** | |
308 * Inserts HTML formatted text to a GTK IM/HTML at a given iter. | |
309 * | |
310 * @param imhtml The GTK IM/HTML. | |
311 * @param text The formatted text to append. | |
312 * @param options A GtkIMHtmlOptions object indicating insert behavior. | |
313 * @param iter A GtkTextIter in the GTK IM/HTML at which to insert text. | |
314 */ | |
232 void gtk_imhtml_insert_html_at_iter(GtkIMHtml *imhtml, | 315 void gtk_imhtml_insert_html_at_iter(GtkIMHtml *imhtml, |
233 const gchar *text, | 316 const gchar *text, |
234 GtkIMHtmlOptions options, | 317 GtkIMHtmlOptions options, |
235 GtkTextIter *iter); | 318 GtkTextIter *iter); |
319 | |
320 /** | |
321 * Scrolls a GTK IM/HTML to the end of its contents. | |
322 * | |
323 * @param imhtml The GTK IM/HTML. | |
324 */ | |
236 void gtk_imhtml_scroll_to_end(GtkIMHtml *imhtml); | 325 void gtk_imhtml_scroll_to_end(GtkIMHtml *imhtml); |
237 void gtk_imhtml_clear (GtkIMHtml *imhtml); | 326 |
238 void gtk_imhtml_page_up (GtkIMHtml *imhtml); | 327 /** |
239 void gtk_imhtml_page_down (GtkIMHtml *imhtml); | 328 * Purges the contents from a GTK IM/HTML and resets formatting. |
240 | 329 * |
330 * @param imhtml The GTK IM/HTML. | |
331 */ | |
332 void gtk_imhtml_clear(GtkIMHtml *imhtml); | |
333 | |
334 /** | |
335 * Scrolls a GTK IM/HTML up by one page. | |
336 * | |
337 * @param imhtml The GTK IM/HTML. | |
338 */ | |
339 void gtk_imhtml_page_up(GtkIMHtml *imhtml); | |
340 | |
341 /** | |
342 * Scrolls a GTK IM/HTML down by one page. | |
343 * | |
344 * @param imhtml The GTK IM/HTML. | |
345 */ | |
346 void gtk_imhtml_page_down(GtkIMHtml *imhtml); | |
347 | |
348 /** | |
349 * Scales the font sizes in a GTK IM/HTML by a given factor. | |
350 * | |
351 * @param imhtml The GTK IM/HTML. | |
352 * @param zoom The factor by which to scale the font sizes. | |
353 */ | |
241 void gtk_imhtml_font_zoom(GtkIMHtml *imhtml, double zoom); | 354 void gtk_imhtml_font_zoom(GtkIMHtml *imhtml, double zoom); |
242 | 355 |
356 /** | |
357 * Creates and returns an new GTK IM/HTML scalable object. | |
358 * | |
359 * @return A new IM/HTML Scalable object. | |
360 */ | |
243 GtkIMHtmlScalable *gtk_imhtml_scalable_new(); | 361 GtkIMHtmlScalable *gtk_imhtml_scalable_new(); |
362 | |
363 /** | |
364 * Creates and returns an new GTK IM/HTML scalable object with an image. | |
365 * | |
366 * @param img A GdkPixbuf of the image to add. | |
367 * @param filename The filename to associate with the image. | |
368 * @param id The id to associate with the image. | |
369 * | |
370 * @return A new IM/HTML Scalable object with an image. | |
371 */ | |
244 GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, const gchar *filename, int id); | 372 GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, const gchar *filename, int id); |
245 void gtk_imhtml_image_free(GtkIMHtmlScalable *); | 373 |
246 void gtk_imhtml_image_scale(GtkIMHtmlScalable *, int, int); | 374 /** |
247 void gtk_imhtml_image_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | 375 * Destroys and frees a GTK IM/HTML scalable image. |
248 | 376 * |
377 * @param scale The GTK IM/HTML scalable. | |
378 */ | |
379 void gtk_imhtml_image_free(GtkIMHtmlScalable *scale); | |
380 | |
381 /** | |
382 * Rescales a GTK IM/HTML scalable image to a given size. | |
383 * | |
384 * @param scale The GTK IM/HTML scalable. | |
385 * @param width The new width. | |
386 * @param height The new height. | |
387 */ | |
388 void gtk_imhtml_image_scale(GtkIMHtmlScalable *scale, int width, int height); | |
389 | |
390 /** | |
391 * Adds a GTK IM/HTML scalable image to a given GTK IM/HTML at a given iter. | |
392 * | |
393 * @param scale The GTK IM/HTML scalable. | |
394 * @param imhtml The GTK IM/HTML. | |
395 * @param iter The GtkTextIter at which to add the scalable. | |
396 */ | |
397 void gtk_imhtml_image_add_to(GtkIMHtmlScalable *scale, GtkIMHtml *imhtml, GtkTextIter *iter); | |
398 | |
399 /** | |
400 * Creates and returns an new GTK IM/HTML scalable with a horizontal rule. | |
401 * | |
402 * @return A new IM/HTML Scalable object with an image. | |
403 */ | |
249 GtkIMHtmlScalable *gtk_imhtml_hr_new(); | 404 GtkIMHtmlScalable *gtk_imhtml_hr_new(); |
250 void gtk_imhtml_hr_free(GtkIMHtmlScalable *); | 405 |
251 void gtk_imhtml_hr_scale(GtkIMHtmlScalable *, int, int); | 406 /** |
252 void gtk_imhtml_hr_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | 407 * Destroys and frees a GTK IM/HTML scalable horizontal rule. |
253 | 408 * |
254 /* Search functions */ | 409 * @param scale The GTK IM/HTML scalable. |
410 */ | |
411 void gtk_imhtml_hr_free(GtkIMHtmlScalable scale*); | |
412 | |
413 /** | |
414 * Rescales a GTK IM/HTML scalable horizontal rule to a given size. | |
415 * | |
416 * @param scale The GTK IM/HTML scalable. | |
417 * @param width The new width. | |
418 * @param height The new height. | |
419 */ | |
420 void gtk_imhtml_hr_scale(GtkIMHtmlScalable scale*, int width, int height); | |
421 | |
422 /** | |
423 * Adds a GTK IM/HTML scalable horizontal rule to a given GTK IM/HTML at | |
424 * a given iter. | |
425 * | |
426 * @param scale The GTK IM/HTML scalable. | |
427 * @param imhtml The GTK IM/HTML. | |
428 * @param iter The GtkTextIter at which to add the scalable. | |
429 */ | |
430 void gtk_imhtml_hr_add_to(GtkIMHtmlScalable scale*, GtkIMHtml *, GtkTextIter *); | |
431 | |
432 /** | |
433 * Finds and highlights a given string in a GTK IM/HTML. | |
434 * | |
435 * @param imhtml The GTK IM/HTML. | |
436 * @param text The string to search for. | |
437 * | |
438 * @return @c TRUE if a search was performed, or @c FALSE if not. | |
439 */ | |
255 gboolean gtk_imhtml_search_find(GtkIMHtml *imhtml, const gchar *text); | 440 gboolean gtk_imhtml_search_find(GtkIMHtml *imhtml, const gchar *text); |
441 | |
442 /** | |
443 * Clears the highlighting from a prior search in a GTK IM/HTML. | |
444 * | |
445 * @param imhtml The GTK IM/HTML. | |
446 */ | |
256 void gtk_imhtml_search_clear(GtkIMHtml *imhtml); | 447 void gtk_imhtml_search_clear(GtkIMHtml *imhtml); |
257 | 448 |
258 /* Editable stuff */ | 449 /** |
450 * Enables or disables editing in a GTK IM/HTML. | |
451 * | |
452 * @param imhtml The GTK IM/HTML. | |
453 * @param editable @c TRUE to make the widget editable, or @c FALSE otherwise. | |
454 */ | |
259 void gtk_imhtml_set_editable(GtkIMHtml *imhtml, gboolean editable); | 455 void gtk_imhtml_set_editable(GtkIMHtml *imhtml, gboolean editable); |
456 | |
457 /** | |
458 * Enables or disables whole buffer formatting only (wbfo) in a GTK IM/HTML. | |
459 * In this mode formatting options to the buffer take effect for the entire | |
460 * buffer instead of specific text. | |
461 * | |
462 * @param imhtml The GTK IM/HTML. | |
463 * @param wbfo @c TRUE to enable the mode, or @c FALSE otherwise. | |
464 */ | |
260 void gtk_imhtml_set_whole_buffer_formatting_only(GtkIMHtml *imhtml, gboolean wbfo); | 465 void gtk_imhtml_set_whole_buffer_formatting_only(GtkIMHtml *imhtml, gboolean wbfo); |
466 | |
467 /** | |
468 * Indicates which formatting fuctions to enable and disable in a GTK IM/HTML. | |
469 * | |
470 * @param imhtml The GTK IM/HTML. | |
471 * @param buttons A GtkIMHtmlButtons bitmask indicating which fuctions to use. | |
472 */ | |
261 void gtk_imhtml_set_format_functions(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons); | 473 void gtk_imhtml_set_format_functions(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons); |
474 | |
475 /** | |
476 * Returns which formatting fuctions are enabled in a GTK IM/HTML. | |
477 * | |
478 * @param imhtml The GTK IM/HTML. | |
479 * | |
480 * @return A GtkIMHtmlButtons bitmask indicating which fuctions to are enabled. | |
481 */ | |
262 GtkIMHtmlButtons gtk_imhtml_get_format_functions(GtkIMHtml *imhtml); | 482 GtkIMHtmlButtons gtk_imhtml_get_format_functions(GtkIMHtml *imhtml); |
483 | |
484 /** | |
485 * Sets each boolean to TRUE if that formatting option is enabled at the | |
486 * current position in a GTK IM/HTML. | |
487 * | |
488 * @param imhtml The GTK IM/HTML. | |
489 * @param bold A reference to a boolean for bold. | |
490 * @param italic A reference to a boolean for italic. | |
491 * @param underline A reference to a boolean for underline. | |
492 */ | |
263 void gtk_imhtml_get_current_format(GtkIMHtml *imhtml, gboolean *bold, gboolean *italic, gboolean *underline); | 493 void gtk_imhtml_get_current_format(GtkIMHtml *imhtml, gboolean *bold, gboolean *italic, gboolean *underline); |
494 | |
495 /** | |
496 * Returns a string containing the selected font face at the current position | |
497 * in a GTK IM/HTML. | |
498 * | |
499 * @param imhtml The GTK IM/HTML. | |
500 * | |
501 * @return A string containg the font face or @c NULL if none is set. | |
502 */ | |
264 char *gtk_imhtml_get_current_fontface(GtkIMHtml *imhtml); | 503 char *gtk_imhtml_get_current_fontface(GtkIMHtml *imhtml); |
504 | |
505 /** | |
506 * Returns a string containing the selected foreground color at the current | |
507 * position in a GTK IM/HTML. | |
508 * | |
509 * @param imhtml The GTK IM/HTML. | |
510 * | |
511 * @return A string containg the foreground color or @c NULL if none is set. | |
512 */ | |
265 char *gtk_imhtml_get_current_forecolor(GtkIMHtml *imhtml); | 513 char *gtk_imhtml_get_current_forecolor(GtkIMHtml *imhtml); |
514 | |
515 /** | |
516 * Returns a string containing the selected background color at the current | |
517 * position in a GTK IM/HTML. | |
518 * | |
519 * @param imhtml The GTK IM/HTML. | |
520 * | |
521 * @return A string containg the background color or @c NULL if none is set. | |
522 */ | |
266 char *gtk_imhtml_get_current_backcolor(GtkIMHtml *imhtml); | 523 char *gtk_imhtml_get_current_backcolor(GtkIMHtml *imhtml); |
524 | |
525 /** | |
526 * Returns a integer containing the selected HTML font size at the current | |
527 * position in a GTK IM/HTML. | |
528 * | |
529 * @param imhtml The GTK IM/HTML. | |
530 * | |
531 * @return The HTML font size. | |
532 */ | |
267 gint gtk_imhtml_get_current_fontsize(GtkIMHtml *imhtml); | 533 gint gtk_imhtml_get_current_fontsize(GtkIMHtml *imhtml); |
534 | |
535 /** | |
536 * Checks whether a GTK IM/HTML is marked as editable. | |
537 * | |
538 * @param imhtml The GTK IM/HTML. | |
539 * | |
540 * @return @c TRUE if the IM/HTML is editable, or @c FALSE otherwise. | |
541 */ | |
268 gboolean gtk_imhtml_get_editable(GtkIMHtml *imhtml); | 542 gboolean gtk_imhtml_get_editable(GtkIMHtml *imhtml); |
543 | |
544 /** | |
545 * Toggles bold at the cursor location or selection in a GTK IM/HTML. | |
546 * | |
547 * @param imhtml The GTK IM/HTML. | |
548 * | |
549 * @return @c TRUE if bold was turned on, or @c FALSE if it was turned off. | |
550 */ | |
269 gboolean gtk_imhtml_toggle_bold(GtkIMHtml *imhtml); | 551 gboolean gtk_imhtml_toggle_bold(GtkIMHtml *imhtml); |
552 | |
553 /** | |
554 * Toggles italic at the cursor location or selection in a GTK IM/HTML. | |
555 * | |
556 * @param imhtml The GTK IM/HTML. | |
557 * | |
558 * @return @c TRUE if italic was turned on, or @c FALSE if it was turned off. | |
559 */ | |
270 gboolean gtk_imhtml_toggle_italic(GtkIMHtml *imhtml); | 560 gboolean gtk_imhtml_toggle_italic(GtkIMHtml *imhtml); |
561 | |
562 /** | |
563 * Toggles underline at the cursor location or selection in a GTK IM/HTML. | |
564 * | |
565 * @param imhtml The GTK IM/HTML. | |
566 * | |
567 * @return @c TRUE if underline was turned on, or @c FALSE if it was turned off. | |
568 */ | |
271 gboolean gtk_imhtml_toggle_underline(GtkIMHtml *imhtml); | 569 gboolean gtk_imhtml_toggle_underline(GtkIMHtml *imhtml); |
570 | |
571 /** | |
572 * Toggles a foreground color at the current location or selection in a GTK | |
573 * IM/HTML. | |
574 * | |
575 * @param imhtml The GTK IM/HTML. | |
576 * @param color The HTML-style color, or NULL or "" to clear the color. | |
577 * | |
578 * @return @c TRUE if a color was set, or @c FALSE if it was cleared. | |
579 */ | |
272 gboolean gtk_imhtml_toggle_forecolor(GtkIMHtml *imhtml, const char *color); | 580 gboolean gtk_imhtml_toggle_forecolor(GtkIMHtml *imhtml, const char *color); |
581 | |
582 /** | |
583 * Toggles a background color at the current location or selection in a GTK | |
584 * IM/HTML. | |
585 * | |
586 * @param imhtml The GTK IM/HTML. | |
587 * @param color The HTML-style color, or NULL or "" to clear the color. | |
588 * | |
589 * @return @c TRUE if a color was set, or @c FALSE if it was cleared. | |
590 */ | |
273 gboolean gtk_imhtml_toggle_backcolor(GtkIMHtml *imhtml, const char *color); | 591 gboolean gtk_imhtml_toggle_backcolor(GtkIMHtml *imhtml, const char *color); |
592 | |
593 /** | |
594 * Toggles a font face at the current location or selection in a GTK IM/HTML. | |
595 * | |
596 * @param imhtml The GTK IM/HTML. | |
597 * @param face The font face name, or NULL or "" to clear the font. | |
598 * | |
599 * @return @c TRUE if a font name was set, or @c FALSE if it was cleared. | |
600 */ | |
274 gboolean gtk_imhtml_toggle_fontface(GtkIMHtml *imhtml, const char *face); | 601 gboolean gtk_imhtml_toggle_fontface(GtkIMHtml *imhtml, const char *face); |
602 | |
603 /** | |
604 * Toggles a link tag with the given URL at the current location or selection | |
605 * in a GTK IM/HTML. | |
606 * | |
607 * @param imhtml The GTK IM/HTML. | |
608 * @param url The URL for the link or NULL to terminate the link. | |
609 */ | |
275 void gtk_imhtml_toggle_link(GtkIMHtml *imhtml, const char *url); | 610 void gtk_imhtml_toggle_link(GtkIMHtml *imhtml, const char *url); |
611 | |
612 /** | |
613 * Inserts a link to the given url at the given GtkTextMark in a GTK IM/HTML. | |
614 * | |
615 * @param imhtml The GTK IM/HTML. | |
616 * @param mark The GtkTextMark to insert the link at. | |
617 * @param url The URL for the link. | |
618 * @param text The string to use for the link description. | |
619 */ | |
276 void gtk_imhtml_insert_link(GtkIMHtml *imhtml, GtkTextMark *mark, const char *url, const char *text); | 620 void gtk_imhtml_insert_link(GtkIMHtml *imhtml, GtkTextMark *mark, const char *url, const char *text); |
621 | |
622 /** | |
623 * Inserts a smiley at the current location or selection in a GTK IM/HTML. | |
624 * | |
625 * @param imhtml The GTK IM/HTML. | |
626 * @param sml The category of the smiley. | |
627 * @param smiley The text of the smiley to insert. | |
628 */ | |
277 void gtk_imhtml_insert_smiley(GtkIMHtml *imhtml, const char *sml, char *smiley); | 629 void gtk_imhtml_insert_smiley(GtkIMHtml *imhtml, const char *sml, char *smiley); |
630 /** | |
631 * Inserts a smiley at the given iter in a GTK IM/HTML. | |
632 * | |
633 * @param imhtml The GTK IM/HTML. | |
634 * @param sml The category of the smiley. | |
635 * @param smiley The text of the smiley to insert. | |
636 * @param iter The GtkTextIter in the IM/HTML to insert the smiley at. | |
637 */ | |
278 void gtk_imhtml_insert_smiley_at_iter(GtkIMHtml *imhtml, const char *sml, char *smiley, GtkTextIter *iter); | 638 void gtk_imhtml_insert_smiley_at_iter(GtkIMHtml *imhtml, const char *sml, char *smiley, GtkTextIter *iter); |
639 | |
640 /** | |
641 * Inserts the IM/HTML scalable image with the given id at the given iter in a | |
642 * GTK IM/HTML. | |
643 * | |
644 * @param imhtml The GTK IM/HTML. | |
645 * @param id The id of the IM/HTML scalable. | |
646 * @param iter The GtkTextIter in the IM/HTML to insert the image at. | |
647 */ | |
279 void gtk_imhtml_insert_image_at_iter(GtkIMHtml *imhtml, int id, GtkTextIter *iter); | 648 void gtk_imhtml_insert_image_at_iter(GtkIMHtml *imhtml, int id, GtkTextIter *iter); |
649 | |
650 /** | |
651 * Sets the font size at the current location or selection in a GTK IM/HTML. | |
652 * | |
653 * @param imhtml The GTK IM/HTML. | |
654 * @param size The HTML font size to use. | |
655 */ | |
280 void gtk_imhtml_font_set_size(GtkIMHtml *imhtml, gint size); | 656 void gtk_imhtml_font_set_size(GtkIMHtml *imhtml, gint size); |
657 | |
658 /** | |
659 * Decreases the font size by 1 at the current location or selection in a GTK | |
660 * IM/HTML. | |
661 * | |
662 * @param imhtml The GTK IM/HTML. | |
663 */ | |
281 void gtk_imhtml_font_shrink(GtkIMHtml *imhtml); | 664 void gtk_imhtml_font_shrink(GtkIMHtml *imhtml); |
665 | |
666 /** | |
667 * Increases the font size by 1 at the current location or selection in a GTK | |
668 * IM/HTML. | |
669 * | |
670 * @param imhtml The GTK IM/HTML. | |
671 */ | |
282 void gtk_imhtml_font_grow(GtkIMHtml *imhtml); | 672 void gtk_imhtml_font_grow(GtkIMHtml *imhtml); |
673 | |
674 /** | |
675 * Returns the HTML formatted contents between two iters in a GTK IM/HTML. | |
676 * | |
677 * @param imhtml The GTK IM/HTML. | |
678 * @param start The GtkTextIter indicating the start point in the IM/HTML. | |
679 * @param end The GtkTextIter indicating the end point in the IM/HTML. | |
680 * | |
681 * @return A string containing the HTML formatted text. | |
682 */ | |
283 char *gtk_imhtml_get_markup_range(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *end); | 683 char *gtk_imhtml_get_markup_range(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *end); |
684 | |
685 /** | |
686 * Returns the entire HTML formatted contents of a GTK IM/HTML. | |
687 * | |
688 * @param imhtml The GTK IM/HTML. | |
689 * | |
690 * @return A string containing the HTML formatted text. | |
691 */ | |
284 char *gtk_imhtml_get_markup(GtkIMHtml *imhtml); | 692 char *gtk_imhtml_get_markup(GtkIMHtml *imhtml); |
285 /* returns a null terminated array of pointers to null terminated strings, each string for each line */ | 693 |
286 /* g_strfreev() should be called on it */ | 694 /** |
695 * Returns a null terminated array of pointers to null terminated strings, each | |
696 * string for each line. g_strfreev() should be called to free it when done. | |
697 * | |
698 * @param imhtml The GTK IM/HTML. | |
699 * | |
700 * @return A null terminated array of null terminated HTML formatted strings. | |
701 */ | |
287 char **gtk_imhtml_get_markup_lines(GtkIMHtml *imhtml); | 702 char **gtk_imhtml_get_markup_lines(GtkIMHtml *imhtml); |
703 | |
704 /** | |
705 * Returns the entire unformatted (plain text) contents of a GTK IM/HTML | |
706 * between two iters in a GTK IM/HTML. | |
707 * | |
708 * @param imhtml The GTK IM/HTML. | |
709 * @param start The GtkTextIter indicating the start point in the IM/HTML. | |
710 * @param end The GtkTextIter indicating the end point in the IM/HTML. | |
711 * | |
712 * @return A string containing the unformatted text. | |
713 */ | |
288 char *gtk_imhtml_get_text(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *stop); | 714 char *gtk_imhtml_get_text(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *stop); |
715 | |
716 /*@}*/ | |
289 | 717 |
290 #ifdef __cplusplus | 718 #ifdef __cplusplus |
291 } | 719 } |
292 #endif | 720 #endif |
293 | 721 |