Messagelib

akonadisender.h
1/*
2 * This file is part of KMail.
3 * SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7#pragma once
8
9#include "messagecomposer_export.h"
10#include "messagesender.h"
11
12#include <QObject>
13
14#include <KMime/Message>
15
16class KJob;
17
18namespace MessageComposer
19{
20class AkonadiSenderPrivate;
21/**
22 * @brief The AkonadiSender class
23 */
24class MESSAGECOMPOSER_EXPORT AkonadiSender : public QObject, public MessageSender
25{
26 Q_OBJECT
27
28public:
29 explicit AkonadiSender(QObject *parent = nullptr);
30 ~AkonadiSender() override;
31
32protected:
33 /**
34 Send given message. The message is either queued or sent
35 immediately. The default behaviour, as selected with
36 setSendImmediate(), can be overwritten with the parameter
37 sendNow (by specifying true or false).
38 The sender takes ownership of the given message on success,
39 so DO NOT DELETE OR MODIFY the message further.
40 Returns true on success.
41
42 TODO cberzan: update docu...
43 */
44 [[nodiscard]] bool doSend(const KMime::Message::Ptr &msg, short sendNow) override;
45
46 /**
47 Send queued messages, using the specified transport or the
48 default, if none is given.
49 */
50 [[nodiscard]] bool doSendQueued(int transportId = -1) override;
51
52private:
53 /**
54 Queue or send immediately one message using MailTransport::MessageQueueJob.
55 */
56 MESSAGECOMPOSER_NO_EXPORT void sendOrQueueMessage(const KMime::Message::Ptr &msg,
57 MessageComposer::MessageSender::SendMethod method = MessageComposer::MessageSender::SendDefault);
58
59 MESSAGECOMPOSER_NO_EXPORT void queueJobResult(KJob *job);
60 std::unique_ptr<AkonadiSenderPrivate> const d;
61};
62}
The AkonadiSender class.
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:05:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.