ImagingTools Core SDK
CUserVerificationCodeSenderComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <icomp/CComponentBase.h>
7
8// ImtCore includes
9#include <imtauth/IUserVerificationCodeSender.h>
10#include <imtmail/ISmtpClient.h>
11#include <imtmail/ISmtpMessageCreator.h>
12
13
14namespace imtauth
15{
16
17
18class CUserVerificationCodeSenderComp: public icomp::CComponentBase, virtual public IUserVerificationCodeSender
19{
20public:
21 typedef icomp::CComponentBase BaseClass;
22
23 I_BEGIN_COMPONENT(CUserVerificationCodeSenderComp);
24 I_REGISTER_INTERFACE(IUserVerificationCodeSender);
25 I_ASSIGN(m_smtpClientCompPtr, "SmtpClient", "SMTP client", false, "SmtpClient");
26 I_ASSIGN(m_smtpMessageCreatorCompPtr, "SmtpMessageCreator", "SMTP message creator", false, "SmtpMessageCreator");
27 I_END_COMPONENT;
28
29 // reimplemented (imtauth::IUserVerificationCodeSender)
30 virtual bool SendCode(const IUserInfo& userInfo, const QByteArray& verificationCode) const override;
31
32protected:
33 I_REF(imtmail::ISmtpClient, m_smtpClientCompPtr);
34 I_REF(imtmail::ISmtpMessageCreator, m_smtpMessageCreatorCompPtr);
35};
36
37
38} // namespace imtauth
39
40