~ubuntu-branches/ubuntu/precise/p7zip/precise-updates

« back to all changes in this revision

Viewing changes to CPP/7zip/UI/Common/ArchiveOpenCallback.h

  • Committer: Bazaar Package Importer
  • Author(s): Mohammed Adnène Trojette
  • Date: 2009-02-14 20:12:27 UTC
  • mfrom: (1.1.11 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090214201227-go63qxm9ozfdma60
Tags: 4.65~dfsg.1-1
* New upstream release.
* Remove wx2.8 Build-Depends added by mistakes (7zG is not yet
  intended to be built).
* Use dh_clean without -k.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
#ifndef _NO_CRYPTO
11
11
#include "../../IPassword.h"
12
 
#endif  
 
12
#endif
13
13
#include "../../Archive/IArchive.h"
14
14
 
 
15
#ifdef _NO_CRYPTO
 
16
 
 
17
#define INTERFACE_IOpenCallbackUI_Crypto(x)
 
18
 
 
19
#else
 
20
 
 
21
#define INTERFACE_IOpenCallbackUI_Crypto(x) \
 
22
  virtual HRESULT Open_CryptoGetTextPassword(BSTR *password) x; \
 
23
  virtual HRESULT Open_GetPasswordIfAny(UString &password) x; \
 
24
  virtual bool Open_WasPasswordAsked() x; \
 
25
  virtual void Open_ClearPasswordWasAskedFlag() x; \
 
26
  
 
27
#endif
 
28
 
 
29
#define INTERFACE_IOpenCallbackUI(x) \
 
30
  virtual HRESULT Open_CheckBreak() x; \
 
31
  virtual HRESULT Open_SetTotal(const UInt64 *files, const UInt64 *bytes) x; \
 
32
  virtual HRESULT Open_SetCompleted(const UInt64 *files, const UInt64 *bytes) x; \
 
33
  INTERFACE_IOpenCallbackUI_Crypto(x)
 
34
 
15
35
struct IOpenCallbackUI
16
36
{
17
 
  virtual HRESULT CheckBreak() = 0;
18
 
  virtual HRESULT SetTotal(const UInt64 *files, const UInt64 *bytes) = 0;
19
 
  virtual HRESULT SetCompleted(const UInt64 *files, const UInt64 *bytes) = 0;
20
 
  #ifndef _NO_CRYPTO
21
 
  virtual HRESULT CryptoGetTextPassword(BSTR *password) = 0;
22
 
  virtual HRESULT GetPasswordIfAny(UString &password) = 0;
23
 
  virtual bool WasPasswordAsked() = 0;
24
 
  virtual void ClearPasswordWasAskedFlag() = 0;
25
 
  #endif  
 
37
  INTERFACE_IOpenCallbackUI(=0)
26
38
};
27
39
 
28
 
class COpenCallbackImp: 
 
40
class COpenCallbackImp:
29
41
  public IArchiveOpenCallback,
30
42
  public IArchiveOpenVolumeCallback,
31
43
  public IArchiveOpenSetSubArchiveName,
32
44
  #ifndef _NO_CRYPTO
33
45
  public ICryptoGetTextPassword,
34
 
  #endif  
 
46
  #endif
35
47
  public CMyUnknownImp
36
48
{
37
49
public:
38
50
  #ifndef _NO_CRYPTO
39
51
  MY_UNKNOWN_IMP3(
40
 
      IArchiveOpenVolumeCallback, 
 
52
      IArchiveOpenVolumeCallback,
41
53
      ICryptoGetTextPassword,
42
54
      IArchiveOpenSetSubArchiveName
43
55
      )
44
56
  #else
45
57
  MY_UNKNOWN_IMP2(
46
 
      IArchiveOpenVolumeCallback, 
 
58
      IArchiveOpenVolumeCallback,
47
59
      IArchiveOpenSetSubArchiveName
48
60
      )
49
61
  #endif
50
62
 
51
 
  STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes);
52
 
  STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes);
53
 
 
54
 
  // IArchiveOpenVolumeCallback
55
 
  STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value);
56
 
  STDMETHOD(GetStream)(const wchar_t *name, IInStream **inStream);
 
63
  INTERFACE_IArchiveOpenCallback(;)
 
64
  INTERFACE_IArchiveOpenVolumeCallback(;)
57
65
 
58
66
  #ifndef _NO_CRYPTO
59
 
  // ICryptoGetTextPassword
60
67
  STDMETHOD(CryptoGetTextPassword)(BSTR *password);
61
68
  #endif
62
69
 
75
82
public:
76
83
  UStringVector FileNames;
77
84
  IOpenCallbackUI *Callback;
 
85
  CMyComPtr<IArchiveOpenCallback> ReOpenCallback;
78
86
  UInt64 TotalSize;
79
87
 
80
88
  COpenCallbackImp(): Callback(NULL) {}