mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Some checks failed
Build / Initialization (push) Has been cancelled
Build / Code Format Validation (push) Has been cancelled
Build / Linux (Qt6) (push) Has been cancelled
Build / Linux (Qt6 + 7zip) (push) Has been cancelled
Build / macOS (Qt6 Universal) (push) Has been cancelled
Build / Windows x64 (Qt6) (push) Has been cancelled
Build / Windows ARM64 (Qt6) (push) Has been cancelled
Build / Docker amd64 Image (push) Has been cancelled
Build / Docker arm64 Image (push) Has been cancelled
Build / Publish Dev Builds (push) Has been cancelled
Build / Publish Release (push) Has been cancelled
Build / Publish YACReader10 Pre-release Builds (push) Has been cancelled
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#ifndef OPEN_CALLBACKS_H
|
|
#define OPEN_CALLBACKS_H
|
|
|
|
#include "7z_includes.h"
|
|
|
|
#include <QDebug>
|
|
//////////////////////////////////////////////////////////////
|
|
// Archive Open callback class
|
|
|
|
class YCArchiveOpenCallback : public IArchiveOpenCallback,
|
|
public ICryptoGetTextPassword,
|
|
public CMyUnknownImp
|
|
{
|
|
Z7_IFACES_IMP_UNK_2(IArchiveOpenCallback, ICryptoGetTextPassword)
|
|
public:
|
|
bool PasswordIsDefined;
|
|
UString Password;
|
|
|
|
YCArchiveOpenCallback()
|
|
: PasswordIsDefined(false) { }
|
|
};
|
|
|
|
Z7_COM7F_IMF(YCArchiveOpenCallback::SetTotal(const UInt64 * /* files */, const UInt64 * /* bytes */))
|
|
{
|
|
return S_OK;
|
|
}
|
|
|
|
Z7_COM7F_IMF(YCArchiveOpenCallback::SetCompleted(const UInt64 * /* files */, const UInt64 * /* bytes */))
|
|
{
|
|
return S_OK;
|
|
}
|
|
|
|
Z7_COM7F_IMF(YCArchiveOpenCallback::CryptoGetTextPassword(BSTR *password))
|
|
{
|
|
if (!PasswordIsDefined) {
|
|
// You can ask real password here from user
|
|
// Password = GetPassword(OutStream);
|
|
// PasswordIsDefined = true;
|
|
qDebug() << "Password is not defined" << Qt::endl;
|
|
return E_ABORT;
|
|
}
|
|
return StringToBstr(Password, password);
|
|
}
|
|
|
|
#endif
|