Bug 22803 - Make header conform to implementation
[swfdec.git] / swfdec / swfdec_loader.h
blobd5e4cd2308ecad24d123b660d8df91b95059c5b4
1 /* Swfdec
2 * Copyright (C) 2006-2007 Benjamin Otte <otte@gnome.org>
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.1 of the License, or (at your option) any later version.
8 *
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 Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301 USA
20 #ifndef _SWFDEC_LOADER_H_
21 #define _SWFDEC_LOADER_H_
23 #include <glib-object.h>
24 #include <swfdec/swfdec_buffer.h>
25 #include <swfdec/swfdec_player.h>
26 #include <swfdec/swfdec_stream.h>
27 #include <swfdec/swfdec_url.h>
29 G_BEGIN_DECLS
31 typedef enum {
32 SWFDEC_LOADER_DATA_UNKNOWN,
33 SWFDEC_LOADER_DATA_SWF,
34 SWFDEC_LOADER_DATA_FLV,
35 SWFDEC_LOADER_DATA_XML,
36 SWFDEC_LOADER_DATA_TEXT,
37 SWFDEC_LOADER_DATA_JPEG,
38 SWFDEC_LOADER_DATA_PNG
39 } SwfdecLoaderDataType;
41 typedef struct _SwfdecLoader SwfdecLoader;
42 typedef struct _SwfdecLoaderClass SwfdecLoaderClass;
44 #define SWFDEC_TYPE_LOADER (swfdec_loader_get_type())
45 #define SWFDEC_IS_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_LOADER))
46 #define SWFDEC_IS_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_LOADER))
47 #define SWFDEC_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_LOADER, SwfdecLoader))
48 #define SWFDEC_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_LOADER, SwfdecLoaderClass))
49 #define SWFDEC_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_LOADER, SwfdecLoaderClass))
51 struct _SwfdecLoader
53 SwfdecStream stream;
55 /*< protected >*/
56 SwfdecURL * url; /* the URL for this loader in UTF-8 - must be set on creation */
57 glong size; /* number of bytes in stream or -1 if unknown */
58 SwfdecLoaderDataType data_type; /* type this stream is in (identified by swfdec) */
61 struct _SwfdecLoaderClass
63 /*< private >*/
64 SwfdecStreamClass stream_class;
66 /*< public >*/
67 void (* load) (SwfdecLoader * loader,
68 SwfdecPlayer * player,
69 const char * url,
70 SwfdecBuffer * buffer,
71 guint n_headers,
72 const char ** header_names,
73 const char ** header_values);
76 GType swfdec_loader_get_type (void);
78 void swfdec_loader_set_url (SwfdecLoader * loader,
79 const char * url);
80 const SwfdecURL *
81 swfdec_loader_get_url (SwfdecLoader * loader);
82 void swfdec_loader_set_size (SwfdecLoader * loader,
83 gulong size);
84 glong swfdec_loader_get_size (SwfdecLoader * loader);
85 gulong swfdec_loader_get_loaded (SwfdecLoader * loader);
86 SwfdecLoaderDataType
87 swfdec_loader_get_data_type (SwfdecLoader * loader);
89 const char * swfdec_loader_data_type_get_extension
90 (SwfdecLoaderDataType type);
93 G_END_DECLS
94 #endif