messagefactoryreplyjob.h 2.08 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
/*
Laurent Montel's avatar
Laurent Montel committed
2
   Copyright (C) 2017-2020 Laurent Montel <montel@kde.org>
Laurent Montel's avatar
Laurent Montel committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
*/

Laurent Montel's avatar
Laurent Montel committed
20 21
#ifndef MESSAGECOMPOSER_MESSAGEFACTORYREPLYJOB_H
#define MESSAGECOMPOSER_MESSAGEFACTORYREPLYJOB_H
Laurent Montel's avatar
Laurent Montel committed
22 23

#include <QObject>
Laurent Montel's avatar
Laurent Montel committed
24 25 26 27
#include <KMime/Message>
#include <KIdentityManagement/IdentityManager>
#include <AkonadiCore/Collection>

Laurent Montel's avatar
Laurent Montel committed
28
namespace MessageComposer {
Laurent Montel's avatar
Laurent Montel committed
29 30 31 32 33 34 35 36
class MessageFactoryReplyJob : public QObject
{
    Q_OBJECT
public:
    explicit MessageFactoryReplyJob(QObject *parent = nullptr);
    ~MessageFactoryReplyJob();

    void start();
Laurent Montel's avatar
Laurent Montel committed
37 38 39 40 41 42 43 44 45 46 47

    void setMsg(const KMime::Message::Ptr &msg);

    void setTemplate(const QString &tmpl);

    void setSelection(const QString &selection);

    void setOrigMsg(const KMime::Message::Ptr &origMsg);

    void setIdentityManager(KIdentityManagement::IdentityManager *identityManager);

48 49
    void setReplyAll(bool replyAll);

50 51
    void setCollection(const Akonadi::Collection &collection);

Laurent Montel's avatar
Laurent Montel committed
52 53
    void setReplyAsHtml(bool replyAsHtml);

Laurent Montel's avatar
Laurent Montel committed
54
Q_SIGNALS:
Laurent Montel's avatar
Laurent Montel committed
55
    void replyDone(const KMime::Message::Ptr &msg, bool replyAll);
Laurent Montel's avatar
Laurent Montel committed
56 57

private:
58
    void slotReplyDone();
Laurent Montel's avatar
Laurent Montel committed
59 60
    QString mSelection;
    QString mTemplate;
Laurent Montel's avatar
Laurent Montel committed
61 62
    KMime::Message::Ptr mMsg = nullptr;
    KMime::Message::Ptr mOrigMsg = nullptr;
Laurent Montel's avatar
Laurent Montel committed
63
    Akonadi::Collection mCollection;
Laurent Montel's avatar
Laurent Montel committed
64
    bool mReplyAll = false;
Laurent Montel's avatar
Laurent Montel committed
65
    bool mReplyAsHtml = false;
Laurent Montel's avatar
Laurent Montel committed
66
    KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
Laurent Montel's avatar
Laurent Montel committed
67 68
};
}
Laurent Montel's avatar
Laurent Montel committed
69
#endif