misc/libphysfs/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.h
changeset 13881 99b265e0d1d0
parent 13880 5f819b90d479
child 13882 b172a5d40eee
equal deleted inserted replaced
13880:5f819b90d479 13881:99b265e0d1d0
     1 // ExtractCallbackConsole.h
       
     2 
       
     3 #ifndef __EXTRACTCALLBACKCONSOLE_H
       
     4 #define __EXTRACTCALLBACKCONSOLE_H
       
     5 
       
     6 #include "Common/MyString.h"
       
     7 #include "Common/StdOutStream.h"
       
     8 #include "../../Common/FileStreams.h"
       
     9 #include "../../IPassword.h"
       
    10 #include "../../Archive/IArchive.h"
       
    11 #include "../Common/ArchiveExtractCallback.h"
       
    12 
       
    13 class CExtractCallbackConsole: 
       
    14   public IExtractCallbackUI,
       
    15   public ICryptoGetTextPassword,
       
    16   public CMyUnknownImp
       
    17 {
       
    18 public:
       
    19   MY_UNKNOWN_IMP2(IFolderArchiveExtractCallback, ICryptoGetTextPassword)
       
    20 
       
    21   STDMETHOD(SetTotal)(UInt64 total);
       
    22   STDMETHOD(SetCompleted)(const UInt64 *completeValue);
       
    23 
       
    24   // IFolderArchiveExtractCallback
       
    25   STDMETHOD(AskOverwrite)(
       
    26       const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
       
    27       const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
       
    28       Int32 *answer);
       
    29   STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position);
       
    30 
       
    31   STDMETHOD(MessageError)(const wchar_t *message);
       
    32   STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted);
       
    33 
       
    34   // ICryptoGetTextPassword
       
    35   STDMETHOD(CryptoGetTextPassword)(BSTR *password);
       
    36 
       
    37   HRESULT BeforeOpen(const wchar_t *name);
       
    38   HRESULT OpenResult(const wchar_t *name, HRESULT result, bool encrypted);
       
    39   HRESULT ThereAreNoFiles();
       
    40   HRESULT ExtractResult(HRESULT result);
       
    41 
       
    42   HRESULT SetPassword(const UString &password);
       
    43 
       
    44 public:
       
    45   bool PasswordIsDefined;
       
    46   UString Password;
       
    47   
       
    48   UInt64 NumArchives;
       
    49   UInt64 NumArchiveErrors;
       
    50   UInt64 NumFileErrors;
       
    51   UInt64 NumFileErrorsInCurrentArchive;
       
    52 
       
    53   CStdOutStream *OutStream;
       
    54 
       
    55   void Init()
       
    56   {
       
    57     NumArchives = 0;
       
    58     NumArchiveErrors = 0;
       
    59     NumFileErrors = 0;
       
    60     NumFileErrorsInCurrentArchive = 0;
       
    61   }
       
    62 
       
    63 };
       
    64 
       
    65 #endif