1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD 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
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GSeekable.html
27  * outPack = gio
28  * outFile = SeekableIF
29  * strct   = GSeekable
30  * realStrct=
31  * ctorStrct=
32  * clss    = SeekableT
33  * interf  = SeekableIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_seekable_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.ErrorG
47  * 	- glib.GException
48  * 	- gio.Cancellable
49  * structWrap:
50  * 	- GCancellable* -> Cancellable
51  * module aliases:
52  * local aliases:
53  * overrides:
54  */
55 
56 module gio.SeekableIF;
57 
58 public  import gtkc.giotypes;
59 
60 private import gtkc.gio;
61 private import glib.ConstructionException;
62 private import gobject.ObjectG;
63 
64 private import glib.ErrorG;
65 private import glib.GException;
66 private import gio.Cancellable;
67 
68 
69 
70 /**
71  * GSeekable is implemented by streams (implementations of
72  * GInputStream or GOutputStream) that support seeking.
73  */
74 public interface SeekableIF
75 {
76 	
77 	
78 	/** Get the main Gtk struct */
79 	public GSeekable* getSeekableTStruct();
80 	
81 	/** the main Gtk struct as a void* */
82 	protected void* getStruct();
83 	
84 	
85 	/**
86 	 */
87 	
88 	/**
89 	 * Tells the current position within the stream.
90 	 * Returns: the offset from the beginning of the buffer.
91 	 */
92 	public long tell();
93 	
94 	/**
95 	 * Tests if the stream supports the GSeekableIface.
96 	 * Returns: TRUE if seekable can be seeked. FALSE otherwise.
97 	 */
98 	public int canSeek();
99 	
100 	/**
101 	 * Seeks in the stream by the given offset, modified by type.
102 	 * If cancellable is not NULL, then the operation can be cancelled by
103 	 * triggering the cancellable object from another thread. If the operation
104 	 * was cancelled, the error G_IO_ERROR_CANCELLED will be returned.
105 	 * Params:
106 	 * offset = a goffset.
107 	 * type = a GSeekType.
108 	 * cancellable = optional GCancellable object, NULL to ignore. [allow-none]
109 	 * Returns: TRUE if successful. If an error has occurred, this function will return FALSE and set error appropriately if present.
110 	 * Throws: GException on failure.
111 	 */
112 	public int seek(long offset, GSeekType type, Cancellable cancellable);
113 	
114 	/**
115 	 * Tests if the stream can be truncated.
116 	 * Returns: TRUE if the stream can be truncated, FALSE otherwise.
117 	 */
118 	public int canTruncate();
119 	
120 	/**
121 	 * Truncates a stream with a given offset.
122 	 * If cancellable is not NULL, then the operation can be cancelled by
123 	 * triggering the cancellable object from another thread. If the operation
124 	 * was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an
125 	 * operation was partially finished when the operation was cancelled the
126 	 * partial result will be returned, without an error.
127 	 * Virtual: truncate_fn
128 	 * Params:
129 	 * offset = a goffset.
130 	 * cancellable = optional GCancellable object, NULL to ignore. [allow-none]
131 	 * Returns: TRUE if successful. If an error has occurred, this function will return FALSE and set error appropriately if present.
132 	 * Throws: GException on failure.
133 	 */
134 	public int truncate(long offset, Cancellable cancellable);
135 }