|
1 // ICoder.h |
|
2 |
|
3 #ifndef __ICODER_H |
|
4 #define __ICODER_H |
|
5 |
|
6 #include "IStream.h" |
|
7 |
|
8 #define CODER_INTERFACE(i, x) DECL_INTERFACE(i, 4, x) |
|
9 |
|
10 CODER_INTERFACE(ICompressProgressInfo, 0x04) |
|
11 { |
|
12 STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize) PURE; |
|
13 }; |
|
14 |
|
15 CODER_INTERFACE(ICompressCoder, 0x05) |
|
16 { |
|
17 STDMETHOD(Code)(ISequentialInStream *inStream, |
|
18 ISequentialOutStream *outStream, |
|
19 const UInt64 *inSize, |
|
20 const UInt64 *outSize, |
|
21 ICompressProgressInfo *progress) PURE; |
|
22 }; |
|
23 |
|
24 CODER_INTERFACE(ICompressCoder2, 0x18) |
|
25 { |
|
26 STDMETHOD(Code)(ISequentialInStream **inStreams, |
|
27 const UInt64 **inSizes, |
|
28 UInt32 numInStreams, |
|
29 ISequentialOutStream **outStreams, |
|
30 const UInt64 **outSizes, |
|
31 UInt32 numOutStreams, |
|
32 ICompressProgressInfo *progress) PURE; |
|
33 }; |
|
34 |
|
35 namespace NCoderPropID |
|
36 { |
|
37 enum EEnum |
|
38 { |
|
39 kDictionarySize = 0x400, |
|
40 kUsedMemorySize, |
|
41 kOrder, |
|
42 kPosStateBits = 0x440, |
|
43 kLitContextBits, |
|
44 kLitPosBits, |
|
45 kNumFastBytes = 0x450, |
|
46 kMatchFinder, |
|
47 kMatchFinderCycles, |
|
48 kNumPasses = 0x460, |
|
49 kAlgorithm = 0x470, |
|
50 kMultiThread = 0x480, |
|
51 kNumThreads, |
|
52 kEndMarker = 0x490 |
|
53 }; |
|
54 } |
|
55 |
|
56 CODER_INTERFACE(ICompressSetCoderProperties, 0x20) |
|
57 { |
|
58 STDMETHOD(SetCoderProperties)(const PROPID *propIDs, |
|
59 const PROPVARIANT *properties, UInt32 numProperties) PURE; |
|
60 }; |
|
61 |
|
62 /* |
|
63 CODER_INTERFACE(ICompressSetCoderProperties, 0x21) |
|
64 { |
|
65 STDMETHOD(SetDecoderProperties)(ISequentialInStream *inStream) PURE; |
|
66 }; |
|
67 */ |
|
68 |
|
69 CODER_INTERFACE(ICompressSetDecoderProperties2, 0x22) |
|
70 { |
|
71 STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size) PURE; |
|
72 }; |
|
73 |
|
74 CODER_INTERFACE(ICompressWriteCoderProperties, 0x23) |
|
75 { |
|
76 STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStreams) PURE; |
|
77 }; |
|
78 |
|
79 CODER_INTERFACE(ICompressGetInStreamProcessedSize, 0x24) |
|
80 { |
|
81 STDMETHOD(GetInStreamProcessedSize)(UInt64 *value) PURE; |
|
82 }; |
|
83 |
|
84 CODER_INTERFACE(ICompressSetCoderMt, 0x25) |
|
85 { |
|
86 STDMETHOD(SetNumberOfThreads)(UInt32 numThreads) PURE; |
|
87 }; |
|
88 |
|
89 CODER_INTERFACE(ICompressGetSubStreamSize, 0x30) |
|
90 { |
|
91 STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value) PURE; |
|
92 }; |
|
93 |
|
94 CODER_INTERFACE(ICompressSetInStream, 0x31) |
|
95 { |
|
96 STDMETHOD(SetInStream)(ISequentialInStream *inStream) PURE; |
|
97 STDMETHOD(ReleaseInStream)() PURE; |
|
98 }; |
|
99 |
|
100 CODER_INTERFACE(ICompressSetOutStream, 0x32) |
|
101 { |
|
102 STDMETHOD(SetOutStream)(ISequentialOutStream *outStream) PURE; |
|
103 STDMETHOD(ReleaseOutStream)() PURE; |
|
104 }; |
|
105 |
|
106 CODER_INTERFACE(ICompressSetInStreamSize, 0x33) |
|
107 { |
|
108 STDMETHOD(SetInStreamSize)(const UInt64 *inSize) PURE; |
|
109 }; |
|
110 |
|
111 CODER_INTERFACE(ICompressSetOutStreamSize, 0x34) |
|
112 { |
|
113 STDMETHOD(SetOutStreamSize)(const UInt64 *outSize) PURE; |
|
114 }; |
|
115 |
|
116 CODER_INTERFACE(ICompressFilter, 0x40) |
|
117 { |
|
118 STDMETHOD(Init)() PURE; |
|
119 STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size) PURE; |
|
120 // Filter return outSize (UInt32) |
|
121 // if (outSize <= size): Filter have converted outSize bytes |
|
122 // if (outSize > size): Filter have not converted anything. |
|
123 // and it needs at least outSize bytes to convert one block |
|
124 // (it's for crypto block algorithms). |
|
125 }; |
|
126 |
|
127 CODER_INTERFACE(ICompressCodecsInfo, 0x60) |
|
128 { |
|
129 STDMETHOD(GetNumberOfMethods)(UInt32 *numMethods) PURE; |
|
130 STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE; |
|
131 STDMETHOD(CreateDecoder)(UInt32 index, const GUID *iid, void **coder) PURE; |
|
132 STDMETHOD(CreateEncoder)(UInt32 index, const GUID *iid, void **coder) PURE; |
|
133 }; |
|
134 CODER_INTERFACE(ISetCompressCodecsInfo, 0x61) |
|
135 { |
|
136 STDMETHOD(SetCompressCodecsInfo)(ICompressCodecsInfo *compressCodecsInfo) PURE; |
|
137 }; |
|
138 |
|
139 CODER_INTERFACE(ICryptoProperties, 0x80) |
|
140 { |
|
141 STDMETHOD(SetKey)(const Byte *data, UInt32 size) PURE; |
|
142 STDMETHOD(SetInitVector)(const Byte *data, UInt32 size) PURE; |
|
143 }; |
|
144 |
|
145 /* |
|
146 CODER_INTERFACE(ICryptoResetSalt, 0x88) |
|
147 { |
|
148 STDMETHOD(ResetSalt)() PURE; |
|
149 }; |
|
150 */ |
|
151 |
|
152 CODER_INTERFACE(ICryptoResetInitVector, 0x8C) |
|
153 { |
|
154 STDMETHOD(ResetInitVector)() PURE; |
|
155 }; |
|
156 |
|
157 CODER_INTERFACE(ICryptoSetPassword, 0x90) |
|
158 { |
|
159 STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size) PURE; |
|
160 }; |
|
161 |
|
162 CODER_INTERFACE(ICryptoSetCRC, 0xA0) |
|
163 { |
|
164 STDMETHOD(CryptoSetCRC)(UInt32 crc) PURE; |
|
165 }; |
|
166 |
|
167 ////////////////////// |
|
168 // It's for DLL file |
|
169 namespace NMethodPropID |
|
170 { |
|
171 enum EEnum |
|
172 { |
|
173 kID, |
|
174 kName, |
|
175 kDecoder, |
|
176 kEncoder, |
|
177 kInStreams, |
|
178 kOutStreams, |
|
179 kDescription, |
|
180 kDecoderIsAssigned, |
|
181 kEncoderIsAssigned |
|
182 }; |
|
183 } |
|
184 |
|
185 #endif |