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

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 <KMime/Message>
0010 #include <QObject>
0011 
0012 struct OpenComposerHiddenJobSettings {
0013     OpenComposerHiddenJobSettings() = default;
0014 
0015     OpenComposerHiddenJobSettings(const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, bool hidden)
0016         : mTo(to)
0017         , mCc(cc)
0018         , mBcc(bcc)
0019         , mSubject(subject)
0020         , mBody(body)
0021         , mHidden(hidden)
0022     {
0023     }
0024 
0025     QString mTo;
0026     QString mCc;
0027     QString mBcc;
0028     QString mSubject;
0029     QString mBody;
0030     bool mHidden = false;
0031 };
0032 
0033 class OpenComposerHiddenJob : public QObject
0034 {
0035     Q_OBJECT
0036 public:
0037     explicit OpenComposerHiddenJob(QObject *parent = nullptr);
0038     ~OpenComposerHiddenJob() override;
0039     void start();
0040     void setSettings(const OpenComposerHiddenJobSettings &settings);
0041 
0042 private:
0043     void slotOpenComposer();
0044     OpenComposerHiddenJobSettings mSettings;
0045     KMime::Message::Ptr mMsg = nullptr;
0046 };