Messagelib

akonadisender.h
1 /*
2  * This file is part of KMail.
3  * SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
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/KMimeMessage>
15 
16 class KJob;
17 
18 namespace MessageComposer
19 {
20 class AkonadiSenderPrivate;
21 /**
22  * @brief The AkonadiSender class
23  */
24 class MESSAGECOMPOSER_EXPORT AkonadiSender : public QObject, public MessageSender
25 {
26  Q_OBJECT
27 
28 public:
29  explicit AkonadiSender(QObject *parent = nullptr);
30  ~AkonadiSender() override;
31 
32 protected:
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  Q_REQUIRED_RESULT 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  Q_REQUIRED_RESULT bool doSendQueued(int transportId = -1) override;
51 
52 private:
53  /**
54  Queue or send immediately one message using MailTransport::MessageQueueJob.
55  */
56  void sendOrQueueMessage(const KMime::Message::Ptr &msg, MessageComposer::MessageSender::SendMethod method = MessageComposer::MessageSender::SendDefault);
57 
58 private Q_SLOTS:
59  void queueJobResult(KJob *job);
60 
61 private:
62  std::unique_ptr<AkonadiSenderPrivate> const d;
63 };
64 }
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The AkonadiSender class.
Definition: akonadisender.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat May 21 2022 03:53:35 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.