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