1 /* ATK - Accessibility Toolkit
2 * Copyright 2001 Sun Microsystems Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #include "atkstreamablecontent.h"
23 atk_streamable_content_get_type ()
25 static GType type = 0;
30 sizeof (AtkStreamableContentIface),
32 (GBaseFinalizeFunc) NULL,
36 type = g_type_register_static (G_TYPE_INTERFACE, "AtkStreamableContent", &tinfo, 0);
43 * atk_streamable_content_get_n_mime_types:
44 * @streamable: a GObject instance that implements AtkStreamableContentIface
46 * Gets the number of mime types supported by this object.
48 * Returns: a gint which is the number of mime types supported by the object.
51 atk_streamable_content_get_n_mime_types (AtkStreamableContent *streamable)
53 AtkStreamableContentIface *iface;
55 g_return_val_if_fail (streamable != NULL, 0);
56 g_return_val_if_fail (ATK_IS_STREAMABLE_CONTENT (streamable), 0);
58 iface = ATK_STREAMABLE_CONTENT_GET_IFACE (streamable);
60 if (iface->get_n_mime_types)
61 return (iface->get_n_mime_types) (streamable);
67 * atk_streamable_content_get_mime_type:
68 * @streamable: a GObject instance that implements AtkStreamableContent
69 * @i: a gint representing the position of the mime type starting from 0
71 * Gets the character string of the specified mime type. The first mime
72 * type is at position 0, the second at position 1, and so on.
74 * Returns : a gchar* representing the specified mime type; the caller
75 * should not free the character string.
78 atk_streamable_content_get_mime_type (AtkStreamableContent *streamable,
81 AtkStreamableContentIface *iface;
83 g_return_val_if_fail (streamable != NULL, NULL);
84 g_return_val_if_fail (i >= 0, NULL);
85 g_return_val_if_fail (ATK_IS_STREAMABLE_CONTENT (streamable), NULL);
87 iface = ATK_STREAMABLE_CONTENT_GET_IFACE (streamable);
89 if (iface->get_mime_type)
90 return (iface->get_mime_type) (streamable, i);
96 * atk_streamable_content_get_stream:
97 * @streamable: a GObject instance that implements AtkStreamableContentIface
98 * @mime_type: a gchar* representing the mime type
100 * Gets the content in the specified mime type
102 * Returns: A #GIOChannel which contains the content in the specified mime
106 atk_streamable_content_get_stream (AtkStreamableContent *streamable,
107 const gchar *mime_type)
109 AtkStreamableContentIface *iface;
111 g_return_val_if_fail (streamable != NULL, NULL);
112 g_return_val_if_fail (mime_type != NULL, NULL);
113 g_return_val_if_fail (ATK_IS_STREAMABLE_CONTENT (streamable), NULL);
115 iface = ATK_STREAMABLE_CONTENT_GET_IFACE (streamable);
117 if (iface->get_stream)
118 return (iface->get_stream) (streamable, mime_type);