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_FLASH_SECURITY_POLICY_H_
22 #define _SWFDEC_FLASH_SECURITY_POLICY_H_
24 #include <swfdec/swfdec.h>
25 #include <swfdec/swfdec_player.h>
29 typedef struct _SwfdecPolicyFile SwfdecPolicyFile
;
30 typedef struct _SwfdecPolicyFileClass SwfdecPolicyFileClass
;
32 #define SWFDEC_TYPE_POLICY_FILE (swfdec_policy_file_get_type())
33 #define SWFDEC_IS_POLICY_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_POLICY_FILE))
34 #define SWFDEC_IS_POLICY_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_POLICY_FILE))
35 #define SWFDEC_POLICY_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_POLICY_FILE, SwfdecPolicyFile))
36 #define SWFDEC_POLICY_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_POLICY_FILE, SwfdecPolicyFileClass))
37 #define SWFDEC_POLICY_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_POLICY_FILE, SwfdecPolicyFileClass))
39 struct _SwfdecPolicyFile
{
42 SwfdecPlayer
* player
; /* player we're loaded from */
43 SwfdecURL
* load_url
; /* url we're loaded from */
44 SwfdecURL
* url
; /* parent url we check with */
45 SwfdecStream
* stream
; /* stream we are loading or NULL if done loading */
46 GSList
* allowed_hosts
; /* list of GPatternSpec of the allowed hosts */
48 GSList
* requests
; /* requests waiting for this file to finish loading */
51 struct _SwfdecPolicyFileClass
{
52 GObjectClass object_class
;
55 GType
swfdec_policy_file_get_type (void);
57 SwfdecPolicyFile
*swfdec_policy_file_new (SwfdecPlayer
* player
,
58 const SwfdecURL
* url
);
59 gboolean
swfdec_policy_file_is_loading (SwfdecPolicyFile
* file
);
60 gboolean
swfdec_policy_file_allow (SwfdecPolicyFile
* file
,
61 const SwfdecURL
* from
,
62 const SwfdecURL
* url
);