diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2008-08-13 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:56 +0300 |
commit | 173c07e166fdf6fcd20f18ea73008f1b628945df (patch) | |
tree | 13ebea85cdc4c16ae93714ff0627ee9f91ad7e08 /CPP/7zip/UI/Common/ArchiveOpenCallback.h | |
parent | 3901bf0ab88106a5b031cba7bc18d60cdebf7eef (diff) |
4.59 beta
Diffstat (limited to 'CPP/7zip/UI/Common/ArchiveOpenCallback.h')
-rwxr-xr-x | CPP/7zip/UI/Common/ArchiveOpenCallback.h | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/CPP/7zip/UI/Common/ArchiveOpenCallback.h b/CPP/7zip/UI/Common/ArchiveOpenCallback.h index 12b2b325..ca445974 100755 --- a/CPP/7zip/UI/Common/ArchiveOpenCallback.h +++ b/CPP/7zip/UI/Common/ArchiveOpenCallback.h @@ -9,54 +9,61 @@ #ifndef _NO_CRYPTO #include "../../IPassword.h" -#endif +#endif #include "../../Archive/IArchive.h" +#ifdef _NO_CRYPTO + +#define INTERFACE_IOpenCallbackUI_Crypto(x) + +#else + +#define INTERFACE_IOpenCallbackUI_Crypto(x) \ + virtual HRESULT Open_CryptoGetTextPassword(BSTR *password) x; \ + virtual HRESULT Open_GetPasswordIfAny(UString &password) x; \ + virtual bool Open_WasPasswordAsked() x; \ + virtual void Open_ClearPasswordWasAskedFlag() x; \ + +#endif + +#define INTERFACE_IOpenCallbackUI(x) \ + virtual HRESULT Open_CheckBreak() x; \ + virtual HRESULT Open_SetTotal(const UInt64 *files, const UInt64 *bytes) x; \ + virtual HRESULT Open_SetCompleted(const UInt64 *files, const UInt64 *bytes) x; \ + INTERFACE_IOpenCallbackUI_Crypto(x) + struct IOpenCallbackUI { - virtual HRESULT CheckBreak() = 0; - virtual HRESULT SetTotal(const UInt64 *files, const UInt64 *bytes) = 0; - virtual HRESULT SetCompleted(const UInt64 *files, const UInt64 *bytes) = 0; - #ifndef _NO_CRYPTO - virtual HRESULT CryptoGetTextPassword(BSTR *password) = 0; - virtual HRESULT GetPasswordIfAny(UString &password) = 0; - virtual bool WasPasswordAsked() = 0; - virtual void ClearPasswordWasAskedFlag() = 0; - #endif + INTERFACE_IOpenCallbackUI(=0) }; -class COpenCallbackImp: +class COpenCallbackImp: public IArchiveOpenCallback, public IArchiveOpenVolumeCallback, public IArchiveOpenSetSubArchiveName, #ifndef _NO_CRYPTO public ICryptoGetTextPassword, - #endif + #endif public CMyUnknownImp { public: #ifndef _NO_CRYPTO MY_UNKNOWN_IMP3( - IArchiveOpenVolumeCallback, + IArchiveOpenVolumeCallback, ICryptoGetTextPassword, IArchiveOpenSetSubArchiveName ) #else MY_UNKNOWN_IMP2( - IArchiveOpenVolumeCallback, + IArchiveOpenVolumeCallback, IArchiveOpenSetSubArchiveName ) #endif - STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes); - STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes); - - // IArchiveOpenVolumeCallback - STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value); - STDMETHOD(GetStream)(const wchar_t *name, IInStream **inStream); + INTERFACE_IArchiveOpenCallback(;) + INTERFACE_IArchiveOpenVolumeCallback(;) #ifndef _NO_CRYPTO - // ICryptoGetTextPassword STDMETHOD(CryptoGetTextPassword)(BSTR *password); #endif @@ -75,6 +82,7 @@ private: public: UStringVector FileNames; IOpenCallbackUI *Callback; + CMyComPtr<IArchiveOpenCallback> ReOpenCallback; UInt64 TotalSize; COpenCallbackImp(): Callback(NULL) {} |