"Initial commit to Gerrit"
[profile/ivi/libgsf.git] / gsf / gsf-input-impl.h
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * gsf-input-impl.h: implementation details of GsfInput
4  *
5  * Copyright (C) 2002-2006 Jody Goldberg (jody@gnome.org)
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of version 2.1 of the GNU Lesser General Public
9  * License as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
19  * USA
20  */
21
22 #ifndef GSF_INPUT_IMPL_H
23 #define GSF_INPUT_IMPL_H
24
25 #include <gsf/gsf.h>
26 #include <gsf/gsf-input.h>
27 #include <glib-object.h>
28
29 G_BEGIN_DECLS
30
31 struct _GsfInput {
32         GObject   g_object;
33
34         gsf_off_t    size, cur_offset;
35         char      *name;
36         GsfInfile *container;
37 };
38
39 typedef struct {
40         GObjectClass g_object_class;
41
42         GsfInput     *(*Dup)  (GsfInput *input, GError **err);
43         const guint8 *(*Read) (GsfInput *input, size_t num_bytes,
44                                guint8 *optional_buffer);
45         gboolean      (*Seek) (GsfInput *input, gsf_off_t offset,
46                                GSeekType whence);
47         GsfInput     *(*OpenSibling)  (GsfInput const *input,
48                                        char const *path, GError **err);
49
50         /* Padding for future expansion */
51         void (*_gsf_reserved0) (void);
52         void (*_gsf_reserved1) (void);
53         void (*_gsf_reserved2) (void);
54         void (*_gsf_reserved3) (void);
55 } GsfInputClass;
56
57 #define GSF_INPUT_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST ((k), GSF_INPUT_TYPE, GsfInputClass))
58 #define GSF_IS_INPUT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSF_INPUT_TYPE))
59
60 /* protected */
61 gboolean gsf_input_set_name      (GsfInput *input, char const *name);
62 gboolean gsf_input_set_name_from_filename (GsfInput *input, char const *filename);
63 gboolean gsf_input_set_container (GsfInput *input, GsfInfile *container);
64 gboolean gsf_input_set_size      (GsfInput *input, gsf_off_t size);
65 gboolean gsf_input_seek_emulate  (GsfInput *input, gsf_off_t pos);
66
67 G_END_DECLS
68
69 #endif /* GSF_INPUT_IMPL_H */