aboutsummaryrefslogtreecommitdiff
path: root/CPP/7zip/UI/Common/UpdateCallback.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--CPP/7zip/UI/Common/UpdateCallback.h177
1 files changed, 92 insertions, 85 deletions
diff --git a/CPP/7zip/UI/Common/UpdateCallback.h b/CPP/7zip/UI/Common/UpdateCallback.h
index 3719c1e..379b814 100644
--- a/CPP/7zip/UI/Common/UpdateCallback.h
+++ b/CPP/7zip/UI/Common/UpdateCallback.h
@@ -1,7 +1,7 @@
1// UpdateCallback.h 1// UpdateCallback.h
2 2
3#ifndef __UPDATE_CALLBACK_H 3#ifndef ZIP7_INC_UPDATE_CALLBACK_H
4#define __UPDATE_CALLBACK_H 4#define ZIP7_INC_UPDATE_CALLBACK_H
5 5
6#include "../../../Common/MyCom.h" 6#include "../../../Common/MyCom.h"
7 7
@@ -27,37 +27,38 @@ struct CArcToDoStat
27 } 27 }
28}; 28};
29 29
30#define INTERFACE_IUpdateCallbackUI(x) \ 30
31 virtual HRESULT WriteSfx(const wchar_t *name, UInt64 size) x; \ 31Z7_PURE_INTERFACES_BEGIN
32 virtual HRESULT SetTotal(UInt64 size) x; \ 32
33 virtual HRESULT SetCompleted(const UInt64 *completeValue) x; \ 33#define Z7_IFACEN_IUpdateCallbackUI(x) \
34 virtual HRESULT SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) x; \ 34 virtual HRESULT WriteSfx(const wchar_t *name, UInt64 size) x \
35 virtual HRESULT CheckBreak() x; \ 35 virtual HRESULT SetTotal(UInt64 size) x \
36 /* virtual HRESULT Finalize() x; */ \ 36 virtual HRESULT SetCompleted(const UInt64 *completeValue) x \
37 virtual HRESULT SetNumItems(const CArcToDoStat &stat) x; \ 37 virtual HRESULT SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) x \
38 virtual HRESULT GetStream(const wchar_t *name, bool isDir, bool isAnti, UInt32 mode) x; \ 38 virtual HRESULT CheckBreak() x \
39 virtual HRESULT OpenFileError(const FString &path, DWORD systemError) x; \ 39 /* virtual HRESULT Finalize() x */ \
40 virtual HRESULT ReadingFileError(const FString &path, DWORD systemError) x; \ 40 virtual HRESULT SetNumItems(const CArcToDoStat &stat) x \
41 virtual HRESULT SetOperationResult(Int32 opRes) x; \ 41 virtual HRESULT GetStream(const wchar_t *name, bool isDir, bool isAnti, UInt32 mode) x \
42 virtual HRESULT ReportExtractResult(Int32 opRes, Int32 isEncrypted, const wchar_t *name) x; \ 42 virtual HRESULT OpenFileError(const FString &path, DWORD systemError) x \
43 virtual HRESULT ReportUpdateOperation(UInt32 op, const wchar_t *name, bool isDir) x; \ 43 virtual HRESULT ReadingFileError(const FString &path, DWORD systemError) x \
44 /* virtual HRESULT SetPassword(const UString &password) x; */ \ 44 virtual HRESULT SetOperationResult(Int32 opRes) x \
45 virtual HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) x; \ 45 virtual HRESULT ReportExtractResult(Int32 opRes, Int32 isEncrypted, const wchar_t *name) x \
46 virtual HRESULT CryptoGetTextPassword(BSTR *password) x; \ 46 virtual HRESULT ReportUpdateOperation(UInt32 op, const wchar_t *name, bool isDir) x \
47 virtual HRESULT ShowDeleteFile(const wchar_t *name, bool isDir) x; \ 47 /* virtual HRESULT SetPassword(const UString &password) x */ \
48 virtual HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) x \
49 virtual HRESULT CryptoGetTextPassword(BSTR *password) x \
50 virtual HRESULT ShowDeleteFile(const wchar_t *name, bool isDir) x \
48 51
49 /* 52 /*
50 virtual HRESULT ReportProp(UInt32 indexType, UInt32 index, PROPID propID, const PROPVARIANT *value) x; \ 53 virtual HRESULT ReportProp(UInt32 indexType, UInt32 index, PROPID propID, const PROPVARIANT *value) x \
51 virtual HRESULT ReportRawProp(UInt32 indexType, UInt32 index, PROPID propID, const void *data, UInt32 dataSize, UInt32 propType) x; \ 54 virtual HRESULT ReportRawProp(UInt32 indexType, UInt32 index, PROPID propID, const void *data, UInt32 dataSize, UInt32 propType) x \
52 virtual HRESULT ReportFinished(UInt32 indexType, UInt32 index, Int32 opRes) x; \ 55 virtual HRESULT ReportFinished(UInt32 indexType, UInt32 index, Int32 opRes) x \
53 */ 56 */
54 57
55 /* virtual HRESULT CloseProgress() { return S_OK; } */ 58 /* virtual HRESULT CloseProgress() { return S_OK; } */
56 59
57struct IUpdateCallbackUI 60Z7_IFACE_DECL_PURE(IUpdateCallbackUI)
58{ 61Z7_PURE_INTERFACES_END
59 INTERFACE_IUpdateCallbackUI(=0)
60};
61 62
62struct CKeyKeyValPair 63struct CKeyKeyValPair
63{ 64{
@@ -74,11 +75,11 @@ struct CKeyKeyValPair
74}; 75};
75 76
76 77
77class CArchiveUpdateCallback: 78class CArchiveUpdateCallback Z7_final:
78 public IArchiveUpdateCallback2, 79 public IArchiveUpdateCallback2,
79 public IArchiveUpdateCallbackFile, 80 public IArchiveUpdateCallbackFile,
80 // public IArchiveUpdateCallbackArcProp, 81 // public IArchiveUpdateCallbackArcProp,
81 public IArchiveExtractCallbackMessage, 82 public IArchiveExtractCallbackMessage2,
82 public IArchiveGetRawProps, 83 public IArchiveGetRawProps,
83 public IArchiveGetRootProps, 84 public IArchiveGetRootProps,
84 public ICryptoGetTextPassword2, 85 public ICryptoGetTextPassword2,
@@ -87,54 +88,63 @@ class CArchiveUpdateCallback:
87 public IInFileStream_Callback, 88 public IInFileStream_Callback,
88 public CMyUnknownImp 89 public CMyUnknownImp
89{ 90{
90 #if defined(_WIN32) && !defined(UNDER_CE) 91 Z7_COM_QI_BEGIN2(IArchiveUpdateCallback2)
91 bool _saclEnabled; 92 Z7_COM_QI_ENTRY(IArchiveUpdateCallbackFile)
92 #endif 93 // Z7_COM_QI_ENTRY(IArchiveUpdateCallbackArcProp)
93 CRecordVector<CKeyKeyValPair> _map; 94 Z7_COM_QI_ENTRY(IArchiveExtractCallbackMessage2)
95 Z7_COM_QI_ENTRY(IArchiveGetRawProps)
96 Z7_COM_QI_ENTRY(IArchiveGetRootProps)
97 Z7_COM_QI_ENTRY(ICryptoGetTextPassword2)
98 Z7_COM_QI_ENTRY(ICryptoGetTextPassword)
99 Z7_COM_QI_ENTRY(ICompressProgressInfo)
100 Z7_COM_QI_END
101 Z7_COM_ADDREF_RELEASE
102
103 Z7_IFACE_COM7_IMP(ICompressProgressInfo)
104
105 Z7_IFACE_COM7_IMP(IProgress)
106 Z7_IFACE_COM7_IMP(IArchiveUpdateCallback)
107 Z7_IFACE_COM7_IMP(IArchiveUpdateCallback2)
108 Z7_IFACE_COM7_IMP(IArchiveUpdateCallbackFile)
109 // Z7_IFACE_COM7_IMP(IArchiveUpdateCallbackArcProp)
110 Z7_IFACE_COM7_IMP(IArchiveExtractCallbackMessage2)
111 Z7_IFACE_COM7_IMP(IArchiveGetRawProps)
112 Z7_IFACE_COM7_IMP(IArchiveGetRootProps)
113 Z7_IFACE_COM7_IMP(ICryptoGetTextPassword2)
114 Z7_IFACE_COM7_IMP(ICryptoGetTextPassword)
94 115
95 UInt32 _hardIndex_From;
96 UInt32 _hardIndex_To;
97 116
98 void UpdateProcessedItemStatus(unsigned dirIndex); 117 void UpdateProcessedItemStatus(unsigned dirIndex);
99 118
100public: 119public:
101 MY_QUERYINTERFACE_BEGIN2(IArchiveUpdateCallback2) 120 bool PreserveATime;
102 MY_QUERYINTERFACE_ENTRY(IArchiveUpdateCallbackFile) 121 bool ShareForWrite;
103 // MY_QUERYINTERFACE_ENTRY(IArchiveUpdateCallbackArcProp) 122 bool StopAfterOpenError;
104 MY_QUERYINTERFACE_ENTRY(IArchiveExtractCallbackMessage) 123 bool StdInMode;
105 MY_QUERYINTERFACE_ENTRY(IArchiveGetRawProps) 124
106 MY_QUERYINTERFACE_ENTRY(IArchiveGetRootProps) 125 bool KeepOriginalItemNames;
107 MY_QUERYINTERFACE_ENTRY(ICryptoGetTextPassword2) 126 bool StoreNtSecurity;
108 MY_QUERYINTERFACE_ENTRY(ICryptoGetTextPassword) 127 bool StoreHardLinks;
109 MY_QUERYINTERFACE_ENTRY(ICompressProgressInfo) 128 bool StoreSymLinks;
110 MY_QUERYINTERFACE_END 129
111 MY_ADDREF_RELEASE 130 bool StoreOwnerId;
112 131 bool StoreOwnerName;
113 132
114 STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize); 133 bool Need_LatestMTime;
115 134 bool LatestMTime_Defined;
116 INTERFACE_IArchiveUpdateCallback2(;) 135
117 INTERFACE_IArchiveUpdateCallbackFile(;) 136 /*
118 // INTERFACE_IArchiveUpdateCallbackArcProp(;) 137 bool Need_ArcMTime_Report;
119 INTERFACE_IArchiveExtractCallbackMessage(;) 138 bool ArcMTime_WasReported;
120 INTERFACE_IArchiveGetRawProps(;) 139 */
121 INTERFACE_IArchiveGetRootProps(;)
122
123 STDMETHOD(CryptoGetTextPassword2)(Int32 *passwordIsDefined, BSTR *password);
124 STDMETHOD(CryptoGetTextPassword)(BSTR *password);
125 140
126 CRecordVector<UInt32> _openFiles_Indexes; 141 CRecordVector<UInt32> _openFiles_Indexes;
127 FStringVector _openFiles_Paths; 142 FStringVector _openFiles_Paths;
128 // CRecordVector< CInFileStream* > _openFiles_Streams; 143 // CRecordVector< CInFileStream* > _openFiles_Streams;
129 144
130 bool AreAllFilesClosed() const { return _openFiles_Indexes.IsEmpty(); } 145 bool AreAllFilesClosed() const { return _openFiles_Indexes.IsEmpty(); }
131 virtual HRESULT InFileStream_On_Error(UINT_PTR val, DWORD error); 146 virtual HRESULT InFileStream_On_Error(UINT_PTR val, DWORD error) Z7_override;
132 virtual void InFileStream_On_Destroy(CInFileStream *stream, UINT_PTR val); 147 virtual void InFileStream_On_Destroy(CInFileStream *stream, UINT_PTR val) Z7_override;
133
134 CRecordVector<UInt64> VolumesSizes;
135 FString VolName;
136 FString VolExt;
137 UString ArcFileName; // without path prefix
138 148
139 IUpdateCallbackUI *Callback; 149 IUpdateCallbackUI *Callback;
140 150
@@ -145,36 +155,24 @@ public:
145 CMyComPtr<IInArchive> Archive; 155 CMyComPtr<IInArchive> Archive;
146 const CObjectVector<CArcItem> *ArcItems; 156 const CObjectVector<CArcItem> *ArcItems;
147 const CRecordVector<CUpdatePair2> *UpdatePairs; 157 const CRecordVector<CUpdatePair2> *UpdatePairs;
148 const UStringVector *NewNames;
149 int CommentIndex;
150 const UString *Comment;
151 158
152 bool PreserveATime; 159 CRecordVector<UInt64> VolumesSizes;
153 bool ShareForWrite; 160 FString VolName;
154 bool StopAfterOpenError; 161 FString VolExt;
155 bool StdInMode; 162 UString ArcFileName; // without path prefix
156
157 bool KeepOriginalItemNames;
158 bool StoreNtSecurity;
159 bool StoreHardLinks;
160 bool StoreSymLinks;
161 163
162 bool StoreOwnerId; 164 const UStringVector *NewNames;
163 bool StoreOwnerName; 165 const UString *Comment;
166 int CommentIndex;
164 167
165 /* 168 /*
166 bool Need_ArcMTime_Report;
167 bool ArcMTime_WasReported;
168 CArcTime Reported_ArcMTime; 169 CArcTime Reported_ArcMTime;
169 */ 170 */
170 bool Need_LatestMTime;
171 bool LatestMTime_Defined;
172 CFiTime LatestMTime; 171 CFiTime LatestMTime;
173 172
174 Byte *ProcessedItemsStatuses; 173 Byte *ProcessedItemsStatuses;
175 174
176 175
177
178 CArchiveUpdateCallback(); 176 CArchiveUpdateCallback();
179 177
180 bool IsDir(const CUpdatePair2 &up) const 178 bool IsDir(const CUpdatePair2 &up) const
@@ -185,6 +183,15 @@ public:
185 return (*ArcItems)[(unsigned)up.ArcIndex].IsDir; 183 return (*ArcItems)[(unsigned)up.ArcIndex].IsDir;
186 return false; 184 return false;
187 } 185 }
186
187private:
188 #if defined(_WIN32) && !defined(UNDER_CE)
189 bool _saclEnabled;
190 #endif
191 CRecordVector<CKeyKeyValPair> _map;
192
193 UInt32 _hardIndex_From;
194 UInt32 _hardIndex_To;
188}; 195};
189 196
190#endif 197#endif