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 65 private import glib.ErrorG; 66 private import glib.GException; 67 private import gio.Cancellable; 68 69 70 71 72 /** 73 * Description 74 * GSeekable is implemented by streams (implementations of 75 * GInputStream or GOutputStream) that support seeking. 76 */ 77 public interface SeekableIF 78 { 79 80 81 public GSeekable* getSeekableTStruct(); 82 83 /** the main Gtk struct as a void* */ 84 protected void* getStruct(); 85 86 87 /** 88 */ 89 90 /** 91 * Tells the current position within the stream. 92 * Returns: the offset from the beginning of the buffer. 93 */ 94 public long tell(); 95 96 /** 97 * Tests if the stream supports the GSeekableIface. 98 * Returns: TRUE if seekable can be seeked. FALSE otherwise. 99 */ 100 public int canSeek(); 101 102 /** 103 * Seeks in the stream by the given offset, modified by type. 104 * If cancellable is not NULL, then the operation can be cancelled by 105 * triggering the cancellable object from another thread. If the operation 106 * was cancelled, the error G_IO_ERROR_CANCELLED will be returned. 107 * Params: 108 * offset = a goffset. 109 * type = a GSeekType. 110 * cancellable = optional GCancellable object, NULL to ignore. [allow-none] 111 * Returns: TRUE if successful. If an error has occurred, this function will return FALSE and set error appropriately if present. 112 * Throws: GException on failure. 113 */ 114 public int seek(long offset, GSeekType type, Cancellable cancellable); 115 116 /** 117 * Tests if the stream can be truncated. 118 * Returns: TRUE if the stream can be truncated, FALSE otherwise. 119 */ 120 public int canTruncate(); 121 122 /** 123 * Truncates a stream with a given offset. 124 * If cancellable is not NULL, then the operation can be cancelled by 125 * triggering the cancellable object from another thread. If the operation 126 * was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an 127 * operation was partially finished when the operation was cancelled the 128 * partial result will be returned, without an error. 129 * Virtual: truncate_fn 130 * Params: 131 * offset = a goffset. 132 * cancellable = optional GCancellable object, NULL to ignore. [allow-none] 133 * Returns: TRUE if successful. If an error has occurred, this function will return FALSE and set error appropriately if present. 134 * Throws: GException on failure. 135 */ 136 public int truncate(long offset, Cancellable cancellable); 137 }