| 1 | /* gtkrichtext.h |
| 2 | * |
| 3 | * Copyright (C) 2006 Imendio AB |
| 4 | * Contact: Michael Natterer <mitch@imendio.com> |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Library General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Library General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Library General Public |
| 17 | * License along with this library; if not, write to the |
| 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | * Boston, MA 02111-1307, USA. |
| 20 | */ |
| 21 | |
| 22 | #ifndef __GTK_TEXT_BUFFER_RICH_TEXT_H__ |
| 23 | #define __GTK_TEXT_BUFFER_RICH_TEXT_H__ |
| 24 | |
| 25 | #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) |
| 26 | #error "Only <gtk/gtk.h> can be included directly." |
| 27 | #endif |
| 28 | |
| 29 | #include <gtk/gtktextbuffer.h> |
| 30 | |
| 31 | G_BEGIN_DECLS |
| 32 | |
| 33 | typedef guint8 * (* GtkTextBufferSerializeFunc) (GtkTextBuffer *register_buffer, |
| 34 | GtkTextBuffer *content_buffer, |
| 35 | const GtkTextIter *start, |
| 36 | const GtkTextIter *end, |
| 37 | gsize *length, |
| 38 | gpointer user_data); |
| 39 | typedef gboolean (* GtkTextBufferDeserializeFunc) (GtkTextBuffer *register_buffer, |
| 40 | GtkTextBuffer *content_buffer, |
| 41 | GtkTextIter *iter, |
| 42 | const guint8 *data, |
| 43 | gsize length, |
| 44 | gboolean create_tags, |
| 45 | gpointer user_data, |
| 46 | GError **error); |
| 47 | |
| 48 | GdkAtom gtk_text_buffer_register_serialize_format (GtkTextBuffer *buffer, |
| 49 | const gchar *mime_type, |
| 50 | GtkTextBufferSerializeFunc function, |
| 51 | gpointer user_data, |
| 52 | GDestroyNotify user_data_destroy); |
| 53 | GdkAtom gtk_text_buffer_register_serialize_tagset (GtkTextBuffer *buffer, |
| 54 | const gchar *tagset_name); |
| 55 | |
| 56 | GdkAtom gtk_text_buffer_register_deserialize_format (GtkTextBuffer *buffer, |
| 57 | const gchar *mime_type, |
| 58 | GtkTextBufferDeserializeFunc function, |
| 59 | gpointer user_data, |
| 60 | GDestroyNotify user_data_destroy); |
| 61 | GdkAtom gtk_text_buffer_register_deserialize_tagset (GtkTextBuffer *buffer, |
| 62 | const gchar *tagset_name); |
| 63 | |
| 64 | void gtk_text_buffer_unregister_serialize_format (GtkTextBuffer *buffer, |
| 65 | GdkAtom format); |
| 66 | void gtk_text_buffer_unregister_deserialize_format (GtkTextBuffer *buffer, |
| 67 | GdkAtom format); |
| 68 | |
| 69 | void gtk_text_buffer_deserialize_set_can_create_tags (GtkTextBuffer *buffer, |
| 70 | GdkAtom format, |
| 71 | gboolean can_create_tags); |
| 72 | gboolean gtk_text_buffer_deserialize_get_can_create_tags (GtkTextBuffer *buffer, |
| 73 | GdkAtom format); |
| 74 | |
| 75 | GdkAtom * gtk_text_buffer_get_serialize_formats (GtkTextBuffer *buffer, |
| 76 | gint *n_formats); |
| 77 | GdkAtom * gtk_text_buffer_get_deserialize_formats (GtkTextBuffer *buffer, |
| 78 | gint *n_formats); |
| 79 | |
| 80 | guint8 * gtk_text_buffer_serialize (GtkTextBuffer *register_buffer, |
| 81 | GtkTextBuffer *content_buffer, |
| 82 | GdkAtom format, |
| 83 | const GtkTextIter *start, |
| 84 | const GtkTextIter *end, |
| 85 | gsize *length); |
| 86 | gboolean gtk_text_buffer_deserialize (GtkTextBuffer *register_buffer, |
| 87 | GtkTextBuffer *content_buffer, |
| 88 | GdkAtom format, |
| 89 | GtkTextIter *iter, |
| 90 | const guint8 *data, |
| 91 | gsize length, |
| 92 | GError **error); |
| 93 | |
| 94 | G_END_DECLS |
| 95 | |
| 96 | #endif /* __GTK_TEXT_BUFFER_RICH_TEXT_H__ */ |
| 97 | |