xref: /trunk/main/offapi/com/sun/star/packages/zip/ZipConstants.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_package_zip_ZipConstants_idl__
28#define __com_sun_star_package_zip_ZipConstants_idl__
29
30
31
32//=============================================================================
33
34module com {  module sun {  module star {   module packages {  module zip {
35
36//=============================================================================
37
38/** defines the constants used by the ZIP interfaces.
39 */
40published constants ZipConstants
41{
42    //-------------------------------------------------------------------------
43    /** Compression method for the deflate algorithm (the only one currently
44       supported).
45     */
46    const short DEFLATED = 8;
47
48    //-------------------------------------------------------------------------
49    /** Compression level for no compression.
50     */
51    const short NO_COMPRESSION = 0;
52
53    //-------------------------------------------------------------------------
54    /** Compression level for fastest compression
55     */
56    const short BEST_SPEED = 1;
57
58    //-------------------------------------------------------------------------
59    /** Compression level for best compression
60     */
61    const short BEST_COMPRESSION = 9;
62
63    //-------------------------------------------------------------------------
64    /** Default compression level.
65     */
66    const short DEFAULT_COMPRESSION = -1;
67
68    //-------------------------------------------------------------------------
69    /** Compression strategy best used for data consisting mostly of small
70      values with a somewhat random distribution. Forces more Huffman
71      coding and less string matching.
72     */
73    const short FILTERED = 1;
74
75    //-------------------------------------------------------------------------
76    /** Compression strategy for Huffman coding only.
77     */
78    const short HUFFMAN_ONLY = 2;
79
80    //-------------------------------------------------------------------------
81    /** Default compression strategy
82     */
83    const short DEFAULT_STRATEGY = 0;
84
85    //-------------------------------------------------------------------------
86    /** entry is uncompressed
87     */
88    const short STORED = 0;
89
90    //-------------------------------------------------------------------------
91    /** entry is uncompressed
92     */
93    const short DEF_MEM_LEVEL = 8;
94
95    //-------------------------------------------------------------------------
96    /** Header Signature: "PK\003\004"
97     */
98    const long LOCSIG  = 0x04034b50;
99
100    //-------------------------------------------------------------------------
101    /** Header Signature: "PK\007\008"
102     */
103    const long EXTSIG  = 0x08074b50;
104
105    //-------------------------------------------------------------------------
106    /** Header Signature: "PK\001\002"
107     */
108    const long CENSIG  = 0x02014b50;
109
110    //-------------------------------------------------------------------------
111    /** Header Signature: "PK\005\006"
112     */
113    const long ENDSIG  = 0x06054b50;
114
115    //-------------------------------------------------------------------------
116    /** Header Signature: "PK\007\008"
117     */
118    const long SPANSIG = 0x08074b50;
119
120    //-------------------------------------------------------------------------
121    /** LOC header size in bytes (including signatures)
122     */
123    const short LOCHDR = 30;
124
125    //-------------------------------------------------------------------------
126    /** EXT header size in bytes (including signatures)
127     */
128    const short EXTHDR = 16;
129
130    //-------------------------------------------------------------------------
131    /** CEN header size in bytes (including signatures)
132     */
133    const short CENHDR = 46;
134
135    //-------------------------------------------------------------------------
136    /** END header size in bytes (including signatures)
137     */
138    const short ENDHDR = 22;
139
140    //-------------------------------------------------------------------------
141    /// LOC LOC LOC
142    /** LOC header field "version needed to extract" offset
143     */
144    const short LOCVER = 4;
145
146    //-------------------------------------------------------------------------
147    /** LOC header field "general purpose bit flags" offset
148     */
149    const short LOCFLG = 6;
150
151    //-------------------------------------------------------------------------
152    /** LOC header field "compression method" offset
153     */
154    const short LOCHOW = 8;
155
156    //-------------------------------------------------------------------------
157    /** LOC header field "modification time" offset
158     */
159    const short LOCTIM = 10;
160
161    //-------------------------------------------------------------------------
162    /** LOC header field "crc of uncompressed data" offset
163     */
164    const short LOCCRC = 14;
165
166    //-------------------------------------------------------------------------
167    /** LOC header field "compressed data size" offset
168     */
169    const short LOCSIZ = 18;
170
171    //-------------------------------------------------------------------------
172    /** LOC header field "uncompressed data size" offset
173     */
174    const short LOCLEN = 22;
175
176    //-------------------------------------------------------------------------
177    /** LOC header field "filename length" offset
178     */
179    const short LOCNAM = 26;
180
181    //-------------------------------------------------------------------------
182    /** LOC header field "extra field length" offset
183     */
184    const short LOCEXT = 28;
185
186    //-------------------------------------------------------------------------
187    /** EXT header field "crc of uncompressed data" offsets
188     */
189    const short EXTCRC = 4;
190
191    //-------------------------------------------------------------------------
192    /** EXT header field "compressed size" offsets
193     */
194    const short EXTSIZ = 8;
195
196    //-------------------------------------------------------------------------
197    /** EXT header field "uncompressed size" offsets
198     */
199    const short EXTLEN = 12;
200
201    //-------------------------------------------------------------------------
202    /** CEN header field "version made by" offset
203     */
204    const short CENVEM = 4;
205
206    //-------------------------------------------------------------------------
207    /** CEN header field "version needed to extract" offset
208     */
209    const short CENVER = 6;
210
211    //-------------------------------------------------------------------------
212    /** CEN header field "general purpose bit flags" offset
213     */
214    const short CENFLG = 8;
215
216    //-------------------------------------------------------------------------
217    /** CEN header field "compression method" offset
218     */
219    const short CENHOW = 10;
220
221    //-------------------------------------------------------------------------
222    /** CEN header field "modification time" offset
223     */
224    const short CENTIM = 12;
225
226    //-------------------------------------------------------------------------
227    /** CEN header field "modification time" offset
228     */
229    const short CENDAT = 14;
230
231    //-------------------------------------------------------------------------
232    /** CEN header field "crc of uncompressed data" offset
233     */
234    const short CENCRC = 16;
235
236    //-------------------------------------------------------------------------
237    /** CEN header field "compressed size" offset
238     */
239    const short CENSIZ = 20;
240
241    //-------------------------------------------------------------------------
242    /** CEN header field "uncompressed size" offset
243     */
244    const short CENLEN = 24;
245
246    //-------------------------------------------------------------------------
247    /** CEN header field "length of filename" offset
248     */
249    const short CENNAM = 28;
250
251    //-------------------------------------------------------------------------
252    /** CEN header field "length of extra field" offset
253     */
254    const short CENEXT = 30;
255
256    //-------------------------------------------------------------------------
257    /** CEN header field "file comment length" offset
258     */
259    const short CENCOM = 32;
260
261    //-------------------------------------------------------------------------
262    /** CEN header field "disk number start" offset
263     */
264    const short CENDSK = 34;
265
266    //-------------------------------------------------------------------------
267    /** CEN header field "internal file attributes" offset
268     */
269    const short CENATT = 36;
270
271    //-------------------------------------------------------------------------
272    /** CEN header field "external file attributes" offset
273     */
274    const short CENATX = 38;
275
276    //-------------------------------------------------------------------------
277    /** CEN header field "offset of local header" offset
278     */
279    const short CENOFF = 42;
280
281    //-------------------------------------------------------------------------
282    /** END header field "number of entries on this disk" offset
283     */
284    const short ENDSUB = 8;
285
286    //-------------------------------------------------------------------------
287    /** END header field "total number of entries" offset
288     */
289    const short ENDTOT = 10;
290
291    //-------------------------------------------------------------------------
292    /** END header field "central directory size" offset
293     */
294    const short ENDSIZ = 12;
295
296    //-------------------------------------------------------------------------
297    /** END header field "central directory offset" offset
298     */
299    const short ENDOFF = 16;
300
301    //-------------------------------------------------------------------------
302    /** END header field "size of zip file comment" offset
303     */
304    const short ENDCOM = 20;
305
306};
307//=============================================================================
308
309}; }; }; }; };
310
311#endif
312