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 change21 // find conversion definition on APILookup.txt22 // implement new conversion functionalities on the wrap.utils pakage23 24 /*
25 * Conversion parameters:
26 * inFile = GZlibCompressor.html
27 * outPack = gio
28 * outFile = ZlibCompressor
29 * strct = GZlibCompressor
30 * realStrct=
31 * ctorStrct=
32 * clss = ZlibCompressor
33 * interf =
34 * class Code: Yes
35 * interface Code: No
36 * template for:
37 * extend =
38 * implements:
39 * - ConverterIF
40 * prefixes:
41 * - g_zlib_compressor_
42 * omit structs:
43 * omit prefixes:
44 * omit code:
45 * omit signals:
46 * imports:
47 * - gio.FileInfo
48 * - gio.ConverterT
49 * - gio.ConverterIF
50 * structWrap:
51 * - GFileInfo* -> FileInfo
52 * module aliases:
53 * local aliases:
54 * overrides:
55 */56 57 modulegio.ZlibCompressor;
58 59 publicimportgtkc.giotypes;
60 61 privateimportgtkc.gio;
62 privateimportglib.ConstructionException;
63 privateimportgobject.ObjectG;
64 65 66 privateimportgio.FileInfo;
67 privateimportgio.ConverterT;
68 privateimportgio.ConverterIF;
69 70 71 72 privateimportgobject.ObjectG;
73 74 /**
75 * Description
76 * GZlibCompressor is an implementation of GConverter that
77 * compresses data using zlib.
78 */79 publicclassZlibCompressor : ObjectG, ConverterIF80 {
81 82 /** the main Gtk struct */83 protectedGZlibCompressor* gZlibCompressor;
84 85 86 publicGZlibCompressor* getZlibCompressorStruct()
87 {
88 returngZlibCompressor;
89 }
90 91 92 /** the main Gtk struct as a void* */93 protectedoverridevoid* getStruct()
94 {
95 returncast(void*)gZlibCompressor;
96 }
97 98 /**
99 * Sets our main struct and passes it to the parent class
100 */101 publicthis (GZlibCompressor* gZlibCompressor)
102 {
103 super(cast(GObject*)gZlibCompressor);
104 this.gZlibCompressor = gZlibCompressor;
105 }
106 107 protectedoverridevoidsetStruct(GObject* obj)
108 {
109 super.setStruct(obj);
110 gZlibCompressor = cast(GZlibCompressor*)obj;
111 }
112 113 // add the Converter capabilities114 mixinConverterT!(GZlibCompressor);
115 116 /**
117 */118 119 /**
120 * Creates a new GZlibCompressor.
121 * Since 2.24
122 * Params:
123 * format = The format to use for the compressed data
124 * level = compression level (0-9), -1 for default
125 * Throws: ConstructionException GTK+ fails to create the object.
126 */127 publicthis (GZlibCompressorFormatformat, intlevel)
128 {
129 // GZlibCompressor * g_zlib_compressor_new (GZlibCompressorFormat format, int level);130 autop = g_zlib_compressor_new(format, level);
131 if(pisnull)
132 {
133 thrownewConstructionException("null returned by g_zlib_compressor_new(format, level)");
134 }
135 this(cast(GZlibCompressor*) p);
136 }
137 138 /**
139 * Returns the "file-info" property.
140 * Since 2.26
141 * Returns: a GFileInfo, or NULL. [transfer none]
142 */143 publicFileInfogetFileInfo()
144 {
145 // GFileInfo * g_zlib_compressor_get_file_info (GZlibCompressor *compressor);146 autop = g_zlib_compressor_get_file_info(gZlibCompressor);
147 148 if(pisnull)
149 {
150 returnnull;
151 }
152 153 returnObjectG.getDObject!(FileInfo)(cast(GFileInfo*) p);
154 }
155 156 /**
157 * Sets file_info in compressor. If non-NULL, and compressor's
158 * "format" property is G_ZLIB_COMPRESSOR_FORMAT_GZIP,
159 * it will be used to set the file name and modification time in
160 * the GZIP header of the compressed data.
161 * Note: it is an error to call this function while a compression is in
162 * progress; it may only be called immediately after creation of compressor,
163 * or after resetting it with g_converter_reset().
164 * Since 2.26
165 * Params:
166 * fileInfo = a GFileInfo. [allow-none]
167 */168 publicvoidsetFileInfo(FileInfofileInfo)
169 {
170 // void g_zlib_compressor_set_file_info (GZlibCompressor *compressor, GFileInfo *file_info);171 g_zlib_compressor_set_file_info(gZlibCompressor, (fileInfoisnull) ? null : fileInfo.getFileInfoStruct());
172 }
173 }