UpdateCallback.h 2.4 KB

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