File indexing completed on 2024-10-27 04:51:06

0001 /*
0002    SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <MailCommon/FolderSettings>
0010 #include <QObject>
0011 #include <QSharedPointer>
0012 
0013 class ComposeNewMessageJob : public QObject
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit ComposeNewMessageJob(QObject *parent = nullptr);
0018     ~ComposeNewMessageJob() override;
0019 
0020     void start();
0021     void setFolderSettings(const QSharedPointer<MailCommon::FolderSettings> &folder);
0022 
0023     void setCurrentCollection(const Akonadi::Collection &col);
0024     void setRecipientsFromMessage(const Akonadi::Item &from);
0025 
0026 private:
0027     void slotOpenComposer(bool forceCursorPosition);
0028     QSharedPointer<MailCommon::FolderSettings> mFolder;
0029     Akonadi::Collection mCurrentCollection;
0030     Akonadi::Item mRecipientsFrom;
0031     uint mIdentity = 0;
0032     KMime::Message::Ptr mMsg = nullptr;
0033 };