Upload 2.0.2
[physicsfs] / lzma / CPP / 7zip / UI / Common / UpdateCallback.h
1 // UpdateCallback.h
2
3 #ifndef __UPDATECALLBACK_H
4 #define __UPDATECALLBACK_H
5
6 #include "Common/MyCom.h"
7 #include "Common/MyString.h"
8
9 #include "../../IPassword.h"
10 #include "../../ICoder.h"
11
12 #include "../Common/UpdatePair.h"
13 #include "../Common/UpdateProduce.h"
14
15 #define INTERFACE_IUpdateCallbackUI(x) \
16   virtual HRESULT SetTotal(UInt64 size) x; \
17   virtual HRESULT SetCompleted(const UInt64 *completeValue) x; \
18   virtual HRESULT SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) x; \
19   virtual HRESULT CheckBreak() x; \
20   virtual HRESULT Finilize() x; \
21   virtual HRESULT SetNumFiles(UInt64 numFiles) x; \
22   virtual HRESULT GetStream(const wchar_t *name, bool isAnti) x; \
23   virtual HRESULT OpenFileError(const wchar_t *name, DWORD systemError) x; \
24   virtual HRESULT SetOperationResult(Int32 operationResult) x; \
25   virtual HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) x; \
26
27   // virtual HRESULT CloseProgress() { return S_OK; };
28
29 struct IUpdateCallbackUI
30 {
31   INTERFACE_IUpdateCallbackUI(=0)
32 };
33
34 class CArchiveUpdateCallback: 
35   public IArchiveUpdateCallback2,
36   public ICryptoGetTextPassword2,
37   public ICompressProgressInfo,
38   public CMyUnknownImp
39 {
40 public:
41   MY_UNKNOWN_IMP3(
42       IArchiveUpdateCallback2, 
43       ICryptoGetTextPassword2,
44       ICompressProgressInfo)
45
46   // IProgress
47   STDMETHOD(SetTotal)(UInt64 size);
48   STDMETHOD(SetCompleted)(const UInt64 *completeValue);
49   STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
50
51   // IUpdateCallback
52   STDMETHOD(EnumProperties)(IEnumSTATPROPSTG **enumerator);  
53   STDMETHOD(GetUpdateItemInfo)(UInt32 index, 
54       Int32 *newData, Int32 *newProperties, UInt32 *indexInArchive);
55   STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value);
56   STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **inStream);
57   STDMETHOD(SetOperationResult)(Int32 operationResult);
58
59   STDMETHOD(GetVolumeSize)(UInt32 index, UInt64 *size);
60   STDMETHOD(GetVolumeStream)(UInt32 index, ISequentialOutStream **volumeStream);
61
62   STDMETHOD(CryptoGetTextPassword2)(Int32 *passwordIsDefined, BSTR *password);
63
64 public:
65   CRecordVector<UInt64> VolumesSizes;
66   UString VolName;
67   UString VolExt;
68
69   IUpdateCallbackUI *Callback;
70
71   UString DirPrefix;
72   bool ShareForWrite;
73   bool StdInMode;
74   const CObjectVector<CDirItem> *DirItems;
75   const CObjectVector<CArchiveItem> *ArchiveItems;
76   const CObjectVector<CUpdatePair2> *UpdatePairs;
77   CMyComPtr<IInArchive> Archive;
78
79   CArchiveUpdateCallback();
80 };
81
82 #endif