fix the name of "Helix Code, Inc." in all the copyrights
[platform/upstream/evolution-data-server.git] / camel / camel-seekable-substream.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-seekable-substream.h : stream */
3
4 /* 
5  *
6  * Author : 
7  *  Bertrand Guiheneuf <bertrand@helixcode.com>
8  *
9  * Copyright 1999, 2000 Helix Code, Inc. (http://www.helixcode.com)
10  *
11  * This program is free software; you can redistribute it and/or 
12  * modify it under the terms of the GNU General Public License as 
13  * published by the Free Software Foundation; either version 2 of the
14  * License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24  * USA
25  */
26
27
28 #ifndef CAMEL_SEEKABLE_SUBSTREAM_H
29 #define CAMEL_SEEKABLE_SUBSTREAM_H 1
30
31
32 #ifdef __cplusplus
33 extern "C" {
34 #pragma }
35 #endif /* __cplusplus }*/
36
37 #include <gtk/gtk.h>
38 #include "camel-types.h"
39 #include "camel-seekable-stream.h"
40
41
42 #define CAMEL_SEEKABLE_SUBSTREAM_TYPE       (camel_seekable_substream_get_type ())
43 #define CAMEL_SEEKABLE_SUBSTREAM(obj)       (GTK_CHECK_CAST((obj), CAMEL_SEEKABLE_SUBSTREAM_TYPE, CamelSeekableSubstream))
44 #define CAMEL_SEEKABLE_SUBSTREAM_CLASS(k)   (GTK_CHECK_CLASS_CAST ((k), CAMEL_SEEKABLE_SUBSTREAM_TYPE, CamelSeekableSubstreamClass))
45 #define CAMEL_IS_SEEKABLE_SUBSTREAM(o)      (GTK_CHECK_TYPE((o), CAMEL_SEEKABLE_SUBSTREAM_TYPE))
46
47
48
49
50 struct _CamelSeekableSubstream
51 {
52         CamelSeekableStream parent_object;
53
54         /*  --**-- Private fields --**--  */
55         CamelSeekableStream *parent_stream;   /* the stream this substream uses */ 
56         guint32 cur_pos;                      /* current postion in the stream */
57         guint32 inf_bound;                    /* first valid position */
58         gint64  sup_bound;                    /* first invalid position */
59         gboolean open;
60         gboolean eos;
61         
62 };
63
64
65
66 typedef struct {
67         CamelSeekableStreamClass parent_class;
68         
69         /* Virtual methods */   
70         void (*init_with_seekable_stream_and_bounds) (CamelSeekableSubstream *seekable_substream, 
71                                                       CamelSeekableStream    *parent_stream,
72                                                       guint32 inf_bound, 
73                                                       gint64  sup_bound);
74
75 } CamelSeekableSubstreamClass;
76
77
78
79 /* Standard Gtk function */
80 GtkType camel_seekable_substream_get_type (void);
81
82
83 /* public methods */
84
85 /* obtain a new seekable substream */
86 CamelSeekableSubstream *
87 camel_seekable_substream_new_with_seekable_stream_and_bounds (CamelSeekableStream    *parent_stream,
88                                                               guint32                 inf_bound, 
89                                                               gint64                  sup_bound);
90
91 #ifdef __cplusplus
92 }
93 #endif /* __cplusplus */
94
95 #endif /* CAMEL_SEEKABLE_SUBSTREAM_H */