2 * Copyright (C) 2007-2008 Benjamin Otte <otte@gnome.org>
3 * 2007 Pekka Lampila <pekka.lampila@iki.fi>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA
21 #ifndef _SWFDEC_LOAD_OBJECT_H_
22 #define _SWFDEC_LOAD_OBJECT_H_
24 #include <swfdec/swfdec.h>
25 #include <swfdec/swfdec_as_object.h>
26 #include <swfdec/swfdec_resource.h>
31 typedef struct _SwfdecLoadObject SwfdecLoadObject
;
32 typedef struct _SwfdecLoadObjectClass SwfdecLoadObjectClass
;
34 typedef void (* SwfdecLoadObjectProgress
) (SwfdecPlayer
*player
,
35 const SwfdecAsValue
*target
, glong loaded
, glong size
);
36 typedef void (* SwfdecLoadObjectFinish
) (SwfdecPlayer
*player
,
37 const SwfdecAsValue
*target
, const char *text
);
39 #define SWFDEC_TYPE_LOAD_OBJECT (swfdec_load_object_get_type())
40 #define SWFDEC_IS_LOAD_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_LOAD_OBJECT))
41 #define SWFDEC_IS_LOAD_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_LOAD_OBJECT))
42 #define SWFDEC_LOAD_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_LOAD_OBJECT, SwfdecLoadObject))
43 #define SWFDEC_LOAD_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_LOAD_OBJECT, SwfdecLoadObjectClass))
44 #define SWFDEC_LOAD_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_LOAD_OBJECT, SwfdecLoadObjectClass))
46 struct _SwfdecLoadObject
{
47 SwfdecGcObject object
;
49 const char * url
; /* GC'ed url to request */
50 SwfdecBuffer
* buffer
; /* data to send */
51 guint header_count
; /* number of headers */
52 char ** header_names
; /* names of headers */
53 char ** header_values
; /* values of headers */
54 SwfdecLoader
* loader
; /* loader when loading or NULL */
56 SwfdecSandbox
* sandbox
; /* sandbox that inited the loading */
57 guint version
; /* version used when initiating the load - for parsing the data */
58 SwfdecAsValue target
; /* target (either movie or object) */
59 SwfdecLoadObjectProgress progress
; /* progress callback */
60 SwfdecLoadObjectFinish finish
; /* finish callback */
63 struct _SwfdecLoadObjectClass
{
64 SwfdecGcObjectClass object_class
;
67 GType
swfdec_load_object_get_type (void);
69 void swfdec_load_object_create (SwfdecPlayer
* player
,
70 const SwfdecAsValue
* target
,
75 char ** header_values
,
76 SwfdecLoadObjectProgress progress
,
77 SwfdecLoadObjectFinish finish
);