|
1 // IArchive.h |
|
2 |
|
3 #ifndef __IARCHIVE_H |
|
4 #define __IARCHIVE_H |
|
5 |
|
6 #include "../IStream.h" |
|
7 #include "../IProgress.h" |
|
8 #include "../PropID.h" |
|
9 |
|
10 // MIDL_INTERFACE("23170F69-40C1-278A-0000-000600xx0000") |
|
11 #define ARCHIVE_INTERFACE_SUB(i, base, x) \ |
|
12 DEFINE_GUID(IID_ ## i, \ |
|
13 0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x06, 0x00, x, 0x00, 0x00); \ |
|
14 struct i: public base |
|
15 |
|
16 #define ARCHIVE_INTERFACE(i, x) ARCHIVE_INTERFACE_SUB(i, IUnknown, x) |
|
17 |
|
18 namespace NFileTimeType |
|
19 { |
|
20 enum EEnum |
|
21 { |
|
22 kWindows, |
|
23 kUnix, |
|
24 kDOS |
|
25 }; |
|
26 } |
|
27 |
|
28 namespace NArchive |
|
29 { |
|
30 enum |
|
31 { |
|
32 kName = 0, |
|
33 kClassID, |
|
34 kExtension, |
|
35 kAddExtension, |
|
36 kUpdate, |
|
37 kKeepName, |
|
38 kStartSignature, |
|
39 kFinishSignature, |
|
40 kAssociate |
|
41 }; |
|
42 |
|
43 namespace NExtract |
|
44 { |
|
45 namespace NAskMode |
|
46 { |
|
47 enum |
|
48 { |
|
49 kExtract = 0, |
|
50 kTest, |
|
51 kSkip, |
|
52 }; |
|
53 } |
|
54 namespace NOperationResult |
|
55 { |
|
56 enum |
|
57 { |
|
58 kOK = 0, |
|
59 kUnSupportedMethod, |
|
60 kDataError, |
|
61 kCRCError, |
|
62 }; |
|
63 } |
|
64 } |
|
65 namespace NUpdate |
|
66 { |
|
67 namespace NOperationResult |
|
68 { |
|
69 enum |
|
70 { |
|
71 kOK = 0, |
|
72 kError, |
|
73 }; |
|
74 } |
|
75 } |
|
76 } |
|
77 |
|
78 ARCHIVE_INTERFACE(IArchiveOpenCallback, 0x10) |
|
79 { |
|
80 STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes) PURE; |
|
81 STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes) PURE; |
|
82 }; |
|
83 |
|
84 |
|
85 ARCHIVE_INTERFACE_SUB(IArchiveExtractCallback, IProgress, 0x20) |
|
86 { |
|
87 STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream, |
|
88 Int32 askExtractMode) PURE; |
|
89 // GetStream OUT: S_OK - OK, S_FALSE - skeep this file |
|
90 STDMETHOD(PrepareOperation)(Int32 askExtractMode) PURE; |
|
91 STDMETHOD(SetOperationResult)(Int32 resultEOperationResult) PURE; |
|
92 }; |
|
93 |
|
94 |
|
95 ARCHIVE_INTERFACE(IArchiveOpenVolumeCallback, 0x30) |
|
96 { |
|
97 STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value) PURE; |
|
98 STDMETHOD(GetStream)(const wchar_t *name, IInStream **inStream) PURE; |
|
99 }; |
|
100 |
|
101 |
|
102 ARCHIVE_INTERFACE(IInArchiveGetStream, 0x40) |
|
103 { |
|
104 STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream) PURE; |
|
105 }; |
|
106 |
|
107 |
|
108 ARCHIVE_INTERFACE(IArchiveOpenSetSubArchiveName, 0x50) |
|
109 { |
|
110 STDMETHOD(SetSubArchiveName)(const wchar_t *name) PURE; |
|
111 }; |
|
112 |
|
113 |
|
114 ARCHIVE_INTERFACE(IInArchive, 0x60) |
|
115 { |
|
116 STDMETHOD(Open)(IInStream *stream, const UInt64 *maxCheckStartPosition, |
|
117 IArchiveOpenCallback *openArchiveCallback) PURE; |
|
118 STDMETHOD(Close)() PURE; |
|
119 STDMETHOD(GetNumberOfItems)(UInt32 *numItems) PURE; |
|
120 STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE; |
|
121 STDMETHOD(Extract)(const UInt32* indices, UInt32 numItems, |
|
122 Int32 testMode, IArchiveExtractCallback *extractCallback) PURE; |
|
123 // indices must be sorted |
|
124 // numItems = 0xFFFFFFFF means all files |
|
125 // testMode != 0 means "test files operation" |
|
126 |
|
127 STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) PURE; |
|
128 |
|
129 STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties) PURE; |
|
130 STDMETHOD(GetPropertyInfo)(UInt32 index, |
|
131 BSTR *name, PROPID *propID, VARTYPE *varType) PURE; |
|
132 |
|
133 STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProperties) PURE; |
|
134 STDMETHOD(GetArchivePropertyInfo)(UInt32 index, |
|
135 BSTR *name, PROPID *propID, VARTYPE *varType) PURE; |
|
136 }; |
|
137 |
|
138 |
|
139 ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback, IProgress, 0x80) |
|
140 { |
|
141 STDMETHOD(GetUpdateItemInfo)(UInt32 index, |
|
142 Int32 *newData, // 1 - new data, 0 - old data |
|
143 Int32 *newProperties, // 1 - new properties, 0 - old properties |
|
144 UInt32 *indexInArchive // -1 if there is no in archive, or if doesn't matter |
|
145 ) PURE; |
|
146 STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE; |
|
147 STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **inStream) PURE; |
|
148 STDMETHOD(SetOperationResult)(Int32 operationResult) PURE; |
|
149 }; |
|
150 |
|
151 |
|
152 ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback2, IArchiveUpdateCallback, 0x82) |
|
153 { |
|
154 STDMETHOD(GetVolumeSize)(UInt32 index, UInt64 *size) PURE; |
|
155 STDMETHOD(GetVolumeStream)(UInt32 index, ISequentialOutStream **volumeStream) PURE; |
|
156 }; |
|
157 |
|
158 |
|
159 ARCHIVE_INTERFACE(IOutArchive, 0xA0) |
|
160 { |
|
161 STDMETHOD(UpdateItems)(ISequentialOutStream *outStream, UInt32 numItems, |
|
162 IArchiveUpdateCallback *updateCallback) PURE; |
|
163 STDMETHOD(GetFileTimeType)(UInt32 *type) PURE; |
|
164 }; |
|
165 |
|
166 |
|
167 ARCHIVE_INTERFACE(ISetProperties, 0x03) |
|
168 { |
|
169 STDMETHOD(SetProperties)(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties) PURE; |
|
170 }; |
|
171 |
|
172 |
|
173 #endif |