1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * gsf-open-pkg-utils.h: Utilities for handling Open Package zip files
4 * from MS Office 2007 or XPS.
6 * Copyright (C) 2006-2008 Jody Goldberg (jody@gnome.org)
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of version 2.1 of the GNU Lesser General Public
10 * License as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 #ifndef GSF_OPEN_PKG_UTILS_H
24 #define GSF_OPEN_PKG_UTILS_H
27 #include <gsf/gsf-libxml.h>
31 typedef struct _GsfOpenPkgRel GsfOpenPkgRel;
32 typedef struct _GsfOpenPkgRels GsfOpenPkgRels;
33 typedef void (*GsfOpenPkgIter)(GsfInput *opkg,
34 GsfOpenPkgRel const *rel,
37 gboolean gsf_open_pkg_rel_is_extern (GsfOpenPkgRel const *rel);
38 char const *gsf_open_pkg_rel_get_target (GsfOpenPkgRel const *rel);
39 char const *gsf_open_pkg_rel_get_type (GsfOpenPkgRel const *rel);
41 GsfOpenPkgRel *gsf_open_pkg_lookup_rel_by_type (GsfInput *opkg, char const *type);
42 GsfOpenPkgRel *gsf_open_pkg_lookup_rel_by_id (GsfInput *opkg, char const *id);
43 void gsf_open_pkg_foreach_rel (GsfInput *opkg,
46 GsfInput *gsf_open_pkg_open_rel (GsfInput *opkg, GsfOpenPkgRel const *rel,
49 GsfInput *gsf_open_pkg_open_rel_by_type (GsfInput *opkg, char const *type,
51 GsfInput *gsf_open_pkg_open_rel_by_id (GsfInput *opkg, char const *id,
53 GError *gsf_open_pkg_parse_rel_by_id (GsfXMLIn *xin, char const *id,
54 GsfXMLInNode const *dtd,
55 GsfXMLInNS const *ns);
57 /* DEPRECATED in 1.14.6 */
58 GsfInput *gsf_open_pkg_get_rel_by_type (GsfInput *opkg, char const *type);
59 GsfInput *gsf_open_pkg_get_rel_by_id (GsfInput *opkg, char const *id);
61 typedef struct _GsfOutfileOpenPkg GsfOutfileOpenPkg;
63 #define GSF_OUTFILE_OPEN_PKG_TYPE (gsf_outfile_open_pkg_get_type ())
64 #define GSF_OUTFILE_OPEN_PKG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSF_OUTFILE_OPEN_PKG_TYPE, GsfOutfileOpenPkg))
65 #define GSF_IS_OUTFILE_OPEN_PKG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSF_OUTFILE_OPEN_PKG_TYPE))
67 GType gsf_outfile_open_pkg_get_type (void) G_GNUC_CONST;
68 /* void gsf_outfile_open_pkg_register_type (GTypeModule *module); glib dynamic types are not thread safe */
70 GsfOutfile *gsf_outfile_open_pkg_new (GsfOutfile *sink);
71 void gsf_outfile_open_pkg_set_sink (GsfOutfileOpenPkg *open_pkg,
73 void gsf_outfile_open_pkg_set_content_type (GsfOutfileOpenPkg *open_pkg,
74 char const *content_type);
76 char const *gsf_outfile_open_pkg_relate (GsfOutfileOpenPkg *child,
77 GsfOutfileOpenPkg *parent,
79 GsfOutput *gsf_outfile_open_pkg_add_rel (GsfOutfile *dir,
81 char const *content_type,
84 char const *gsf_outfile_open_pkg_add_extern_rel (GsfOutfileOpenPkg *parent,
86 char const *content_type);
88 gint gsf_open_pkg_error_id (void);
92 #endif /* GSF_OPEN_PKG_UTILS_H */