other-licenses/7zstub/src/7zip/Archive/IArchive.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/7zstub/src/7zip/Archive/IArchive.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,173 @@
     1.4 +// IArchive.h
     1.5 +
     1.6 +#ifndef __IARCHIVE_H
     1.7 +#define __IARCHIVE_H
     1.8 +
     1.9 +#include "../IStream.h"
    1.10 +#include "../IProgress.h"
    1.11 +#include "../PropID.h"
    1.12 +
    1.13 +// MIDL_INTERFACE("23170F69-40C1-278A-0000-000600xx0000")
    1.14 +#define ARCHIVE_INTERFACE_SUB(i, base,  x) \
    1.15 +DEFINE_GUID(IID_ ## i, \
    1.16 +0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x06, 0x00, x, 0x00, 0x00); \
    1.17 +struct i: public base
    1.18 +
    1.19 +#define ARCHIVE_INTERFACE(i, x) ARCHIVE_INTERFACE_SUB(i, IUnknown, x)
    1.20 +
    1.21 +namespace NFileTimeType
    1.22 +{
    1.23 +  enum EEnum
    1.24 +  {
    1.25 +    kWindows,
    1.26 +    kUnix,
    1.27 +    kDOS
    1.28 +  };
    1.29 +}
    1.30 +
    1.31 +namespace NArchive
    1.32 +{
    1.33 +  enum 
    1.34 +  {
    1.35 +    kName = 0,
    1.36 +    kClassID,
    1.37 +    kExtension,
    1.38 +    kAddExtension,
    1.39 +    kUpdate,
    1.40 +    kKeepName,
    1.41 +    kStartSignature,
    1.42 +    kFinishSignature,
    1.43 +    kAssociate
    1.44 +  };
    1.45 +
    1.46 +  namespace NExtract
    1.47 +  {
    1.48 +    namespace NAskMode
    1.49 +    {
    1.50 +      enum 
    1.51 +      {
    1.52 +        kExtract = 0,
    1.53 +        kTest,
    1.54 +        kSkip,
    1.55 +      };
    1.56 +    }
    1.57 +    namespace NOperationResult
    1.58 +    {
    1.59 +      enum 
    1.60 +      {
    1.61 +        kOK = 0,
    1.62 +        kUnSupportedMethod,
    1.63 +        kDataError,
    1.64 +        kCRCError,
    1.65 +      };
    1.66 +    }
    1.67 +  }
    1.68 +  namespace NUpdate
    1.69 +  {
    1.70 +    namespace NOperationResult
    1.71 +    {
    1.72 +      enum 
    1.73 +      {
    1.74 +        kOK = 0,
    1.75 +        kError,
    1.76 +      };
    1.77 +    }
    1.78 +  }
    1.79 +}
    1.80 +
    1.81 +ARCHIVE_INTERFACE(IArchiveOpenCallback, 0x10)
    1.82 +{
    1.83 +  STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes) PURE;
    1.84 +  STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes) PURE;
    1.85 +};
    1.86 +
    1.87 +
    1.88 +ARCHIVE_INTERFACE_SUB(IArchiveExtractCallback, IProgress, 0x20)
    1.89 +{
    1.90 +  STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream, 
    1.91 +      Int32 askExtractMode) PURE;
    1.92 +  // GetStream OUT: S_OK - OK, S_FALSE - skeep this file
    1.93 +  STDMETHOD(PrepareOperation)(Int32 askExtractMode) PURE;
    1.94 +  STDMETHOD(SetOperationResult)(Int32 resultEOperationResult) PURE;
    1.95 +};
    1.96 +
    1.97 +
    1.98 +ARCHIVE_INTERFACE(IArchiveOpenVolumeCallback, 0x30)
    1.99 +{
   1.100 +  STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value) PURE;
   1.101 +  STDMETHOD(GetStream)(const wchar_t *name, IInStream **inStream) PURE;
   1.102 +};
   1.103 +
   1.104 +
   1.105 +ARCHIVE_INTERFACE(IInArchiveGetStream, 0x40)
   1.106 +{
   1.107 +  STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream) PURE;  
   1.108 +};
   1.109 +
   1.110 +
   1.111 +ARCHIVE_INTERFACE(IArchiveOpenSetSubArchiveName, 0x50)
   1.112 +{
   1.113 +  STDMETHOD(SetSubArchiveName)(const wchar_t *name) PURE;
   1.114 +};
   1.115 +
   1.116 +
   1.117 +ARCHIVE_INTERFACE(IInArchive, 0x60)
   1.118 +{
   1.119 +  STDMETHOD(Open)(IInStream *stream, const UInt64 *maxCheckStartPosition,
   1.120 +      IArchiveOpenCallback *openArchiveCallback) PURE;  
   1.121 +  STDMETHOD(Close)() PURE;  
   1.122 +  STDMETHOD(GetNumberOfItems)(UInt32 *numItems) PURE;  
   1.123 +  STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE;
   1.124 +  STDMETHOD(Extract)(const UInt32* indices, UInt32 numItems, 
   1.125 +      Int32 testMode, IArchiveExtractCallback *extractCallback) PURE;
   1.126 +  // indices must be sorted 
   1.127 +  // numItems = 0xFFFFFFFF means all files
   1.128 +  // testMode != 0 means "test files operation"
   1.129 +
   1.130 +  STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) PURE;
   1.131 +
   1.132 +  STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties) PURE;  
   1.133 +  STDMETHOD(GetPropertyInfo)(UInt32 index,     
   1.134 +      BSTR *name, PROPID *propID, VARTYPE *varType) PURE;
   1.135 +
   1.136 +  STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProperties) PURE;  
   1.137 +  STDMETHOD(GetArchivePropertyInfo)(UInt32 index,     
   1.138 +      BSTR *name, PROPID *propID, VARTYPE *varType) PURE;
   1.139 +};
   1.140 +
   1.141 +
   1.142 +ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback, IProgress, 0x80)
   1.143 +{
   1.144 +  STDMETHOD(GetUpdateItemInfo)(UInt32 index, 
   1.145 +      Int32 *newData, // 1 - new data, 0 - old data
   1.146 +      Int32 *newProperties, // 1 - new properties, 0 - old properties
   1.147 +      UInt32 *indexInArchive // -1 if there is no in archive, or if doesn't matter
   1.148 +      ) PURE;
   1.149 +  STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE;
   1.150 +  STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **inStream) PURE;
   1.151 +  STDMETHOD(SetOperationResult)(Int32 operationResult) PURE;
   1.152 +};
   1.153 +
   1.154 +
   1.155 +ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback2, IArchiveUpdateCallback, 0x82)
   1.156 +{
   1.157 +  STDMETHOD(GetVolumeSize)(UInt32 index, UInt64 *size) PURE;
   1.158 +  STDMETHOD(GetVolumeStream)(UInt32 index, ISequentialOutStream **volumeStream) PURE;
   1.159 +};
   1.160 +
   1.161 +
   1.162 +ARCHIVE_INTERFACE(IOutArchive, 0xA0)
   1.163 +{
   1.164 +  STDMETHOD(UpdateItems)(ISequentialOutStream *outStream, UInt32 numItems,
   1.165 +      IArchiveUpdateCallback *updateCallback) PURE;
   1.166 +  STDMETHOD(GetFileTimeType)(UInt32 *type) PURE;  
   1.167 +};
   1.168 +
   1.169 +
   1.170 +ARCHIVE_INTERFACE(ISetProperties, 0x03)
   1.171 +{
   1.172 +  STDMETHOD(SetProperties)(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties) PURE;
   1.173 +};
   1.174 +
   1.175 +
   1.176 +#endif

mercurial