IFileExtractCallback.h revision cd66d540cead3f8200b0c73bad9c276d67896c3d
1// IFileExtractCallback.h
2
3#ifndef __I_FILE_EXTRACT_CALLBACK_H
4#define __I_FILE_EXTRACT_CALLBACK_H
5
6#include "../../../Common/MyString.h"
7
8#include "../../IDecl.h"
9
10namespace NOverwriteAnswer
11{
12  enum EEnum
13  {
14    kYes,
15    kYesToAll,
16    kNo,
17    kNoToAll,
18    kAutoRename,
19    kCancel
20  };
21}
22
23DECL_INTERFACE_SUB(IFolderArchiveExtractCallback, IProgress, 0x01, 0x07)
24{
25public:
26  STDMETHOD(AskOverwrite)(
27      const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
28      const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
29      Int32 *answer) PURE;
30  STDMETHOD(PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position) PURE;
31  STDMETHOD(MessageError)(const wchar_t *message) PURE;
32  STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted) PURE;
33};
34
35struct IExtractCallbackUI: IFolderArchiveExtractCallback
36{
37  virtual HRESULT BeforeOpen(const wchar_t *name) = 0;
38  virtual HRESULT OpenResult(const wchar_t *name, HRESULT result, bool encrypted) = 0;
39  virtual HRESULT SetError(int level, const wchar_t *name,
40      UInt32 errorFlags, const wchar_t *errors,
41      UInt32 warningFlags, const wchar_t *warnings) = 0;
42  virtual HRESULT ThereAreNoFiles() = 0;
43  virtual HRESULT ExtractResult(HRESULT result) = 0;
44  virtual HRESULT OpenTypeWarning(const wchar_t *name, const wchar_t *okType, const wchar_t *errorType) = 0;
45
46  #ifndef _NO_CRYPTO
47  virtual HRESULT SetPassword(const UString &password) = 0;
48  #endif
49};
50
51
52#define INTERFACE_IGetProp(x) \
53  STDMETHOD(GetProp)(PROPID propID, PROPVARIANT *value) x; \
54
55DECL_INTERFACE_SUB(IGetProp, IUnknown, 0x01, 0x20)
56{
57  INTERFACE_IGetProp(PURE)
58};
59
60#define INTERFACE_IFolderExtractToStreamCallback(x) \
61  STDMETHOD(UseExtractToStream)(Int32 *res) x; \
62  STDMETHOD(GetStream7)(const wchar_t *name, Int32 isDir, ISequentialOutStream **outStream, Int32 askExtractMode, IGetProp *getProp) x; \
63  STDMETHOD(PrepareOperation7)(Int32 askExtractMode) x; \
64  STDMETHOD(SetOperationResult7)(Int32 resultEOperationResult, bool encrypted) x; \
65
66DECL_INTERFACE_SUB(IFolderExtractToStreamCallback, IUnknown, 0x01, 0x30)
67{
68  INTERFACE_IFolderExtractToStreamCallback(PURE)
69};
70
71
72#endif
73