File indexing completed on 2024-06-23 05:18:31

0001 /*
0002   SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "MessageCore/AttachmentLoadJob"
0010 #include "messagecomposer_export.h"
0011 #include <Akonadi/Item>
0012 namespace MessageComposer
0013 {
0014 class AttachmentVcardFromAddressBookJobPrivate;
0015 /**
0016  * @brief The AttachmentVcardFromAddressBookJob class
0017  * @author Laurent Montel <montel@kde.org>
0018  */
0019 class MESSAGECOMPOSER_EXPORT AttachmentVcardFromAddressBookJob : public MessageCore::AttachmentLoadJob
0020 {
0021     Q_OBJECT
0022 public:
0023     explicit AttachmentVcardFromAddressBookJob(const Akonadi::Item &item, QObject *parent = nullptr);
0024     ~AttachmentVcardFromAddressBookJob() override;
0025 
0026 protected Q_SLOTS:
0027     void doStart() override;
0028 
0029 private Q_SLOTS:
0030     MESSAGECOMPOSER_NO_EXPORT void slotExpandGroupResult(KJob *job);
0031 
0032 private:
0033     MESSAGECOMPOSER_NO_EXPORT void invalidContact();
0034     MESSAGECOMPOSER_NO_EXPORT void addAttachment(const QByteArray &data, const QString &attachmentName);
0035     std::unique_ptr<AttachmentVcardFromAddressBookJobPrivate> const d;
0036 };
0037 }