File indexing completed on 2024-10-27 04:51:00
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 <Akonadi/Collection> 0010 #include <KIdentityManagementCore/Identity> 0011 #include <KMime/Message> 0012 #include <QObject> 0013 0014 class KMComposerUpdateTemplateJob : public QObject 0015 { 0016 Q_OBJECT 0017 public: 0018 explicit KMComposerUpdateTemplateJob(QObject *parent = nullptr); 0019 ~KMComposerUpdateTemplateJob() override; 0020 void start(); 0021 void setMsg(const KMime::Message::Ptr &msg); 0022 0023 void setCustomTemplate(const QString &customTemplate); 0024 0025 void setTextSelection(const QString &textSelection); 0026 0027 void setWasModified(bool wasModified); 0028 0029 void setUoldId(uint uoldId); 0030 0031 void setUoid(uint uoid); 0032 0033 void setIdent(const KIdentityManagementCore::Identity &ident); 0034 0035 void setCollection(const Akonadi::Collection &col); 0036 Q_SIGNALS: 0037 void updateComposer(const KIdentityManagementCore::Identity &ident, const KMime::Message::Ptr &msg, uint uoid, uint uoldId, bool wasModified); 0038 0039 private: 0040 void slotFinished(); 0041 0042 QString mTextSelection; 0043 QString mCustomTemplate; 0044 KMime::Message::Ptr mMsg; 0045 Akonadi::Collection mCollectionForNewMessage; 0046 uint mUoldId = 0; 0047 uint mUoid = 0; 0048 KIdentityManagementCore::Identity mIdent; 0049 bool mWasModified = false; 0050 };