diff --git a/librsvg/rsvg.h b/librsvg/rsvg.h index 6432df67b156d9aea06a40daedd3aa2e111fa58f..7227781d6c4d475dfc7098cce552443d438c8692 100644 --- a/librsvg/rsvg.h +++ b/librsvg/rsvg.h @@ -958,6 +958,42 @@ RsvgHandle *rsvg_handle_new_with_flags (RsvgHandleFlags flags); RSVG_API void rsvg_handle_set_base_gfile (RsvgHandle *handle, GFile *base_file); + +/** + * RsvgLoadingPolicy: + * @base_only: Only allow to load content from the same base URL. By default + this restriction is enabled and requires to use rsvg_handle_set_base_uri(). + * @include_xml: Allows to use xi:include with XML. Enabled by default. + * @include_text: Allows to use xi:include with text. Enabled by default. + * @local_only: Only allow to load content from the local filesystem. + Enabled by default. + * + * A data structure used in rsvg_handle_set_loading_policy(). + * + * Since: 2.52 + */ +typedef struct { + gboolean base_only; + gboolean include_xml; + gboolean include_text; + gboolean local_only; +} RsvgLoadingPolicy; + +/** + * rsvg_handle_set_loading_policy: + * @handle: a #RsvgHandle + * @policy: a #RsvgLoadingPolicy + * + * Set the loading policy for @handle from @policy. + * + * Note: This function may only be called before + * rsvg_handle_read_stream_sync() have been called. + * + * Since: 2.52 + */ +RSVG_API +void rsvg_handle_set_loading_policy (RsvgHandle *handle, + RsvgLoadingPolicy *policy); /** * rsvg_handle_read_stream_sync: