other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractCallback.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractCallback.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,96 @@
     1.4 +// ExtractCallback.h
     1.5 +
     1.6 +#ifndef __EXTRACTCALLBACK_H
     1.7 +#define __EXTRACTCALLBACK_H
     1.8 +
     1.9 +#include "resource.h"
    1.10 +
    1.11 +#include "Common/String.h"
    1.12 +#include "Windows/ResourceString.h"
    1.13 +
    1.14 +#include "../../Archive/IArchive.h"
    1.15 +
    1.16 +#include "../../Common/FileStreams.h"
    1.17 +#include "../../ICoder.h"
    1.18 +
    1.19 +#ifndef _NO_PROGRESS
    1.20 +#include "../../FileManager/Resource/ProgressDialog/ProgressDialog.h"
    1.21 +#endif
    1.22 +
    1.23 +class CExtractCallbackImp: 
    1.24 +  public IArchiveExtractCallback,
    1.25 +  public CMyUnknownImp
    1.26 +{
    1.27 +public:
    1.28 +  
    1.29 +  MY_UNKNOWN_IMP
    1.30 +
    1.31 +  // IProgress
    1.32 +  STDMETHOD(SetTotal)(UInt64 size);
    1.33 +  STDMETHOD(SetCompleted)(const UInt64 *completeValue);
    1.34 +
    1.35 +  // IExtractCallback
    1.36 +  STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream, 
    1.37 +      Int32 askExtractMode);
    1.38 +  STDMETHOD(PrepareOperation)(Int32 askExtractMode);
    1.39 +  STDMETHOD(SetOperationResult)(Int32 resultEOperationResult);
    1.40 +
    1.41 +private:
    1.42 +  CMyComPtr<IInArchive> _archiveHandler;
    1.43 +  UString _directoryPath;
    1.44 +
    1.45 +  UString _filePath;
    1.46 +
    1.47 +  UString _diskFilePath;
    1.48 +
    1.49 +  bool _extractMode;
    1.50 +  struct CProcessedFileInfo
    1.51 +  {
    1.52 +    FILETIME UTCLastWriteTime;
    1.53 +    bool IsDirectory;
    1.54 +    UInt32 Attributes;
    1.55 +  } _processedFileInfo;
    1.56 +
    1.57 +  COutFileStream *_outFileStreamSpec;
    1.58 +  CMyComPtr<ISequentialOutStream> _outFileStream;
    1.59 +
    1.60 +  UString _itemDefaultName;
    1.61 +  FILETIME _utcLastWriteTimeDefault;
    1.62 +  UInt32 _attributesDefault;
    1.63 +
    1.64 +  void CreateComplexDirectory(const UStringVector &dirPathParts);
    1.65 +public:
    1.66 +  #ifndef _NO_PROGRESS
    1.67 +  CProgressDialog ProgressDialog;
    1.68 +  #endif
    1.69 +
    1.70 +  bool _isCorrupt;
    1.71 +  UString _message;
    1.72 +
    1.73 +  void Init(IInArchive *archiveHandler,     
    1.74 +    const UString &directoryPath, 
    1.75 +    const UString &itemDefaultName,
    1.76 +    const FILETIME &utcLastWriteTimeDefault,
    1.77 +    UInt32 attributesDefault);
    1.78 +
    1.79 +  #ifndef _NO_PROGRESS
    1.80 +  HRESULT StartProgressDialog(const UString &title)
    1.81 +  {
    1.82 +    ProgressDialog.Create(title, 0);
    1.83 +    {
    1.84 +      #ifdef LANG        
    1.85 +      ProgressDialog.SetText(LangLoadString(IDS_PROGRESS_EXTRACTING, 0x02000890));
    1.86 +      #else
    1.87 +      ProgressDialog.SetText(NWindows::MyLoadStringW(IDS_PROGRESS_EXTRACTING));
    1.88 +      #endif
    1.89 +    }
    1.90 +
    1.91 +    ProgressDialog.Show(SW_SHOWNORMAL);    
    1.92 +    return S_OK;
    1.93 +  }
    1.94 +  virtual ~CExtractCallbackImp() { ProgressDialog.Destroy(); }
    1.95 +  #endif
    1.96 +
    1.97 +};
    1.98 +
    1.99 +#endif

mercurial