Messagelib

mdnwarningwidget.h
1 /*
2  SPDX-FileCopyrightText: 2022-2023 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 #include "messageviewer_export.h"
9 #include <KMessageWidget>
10 #include <KMime/MDN>
11 
12 namespace MessageViewer
13 {
14 /**
15  * @brief The MDNWarningWidget class
16  * @author Laurent Montel <[email protected]>
17  */
18 class MESSAGEVIEWER_EXPORT MDNWarningWidget : public KMessageWidget
19 {
20  Q_OBJECT
21 public:
22  enum ResponseType {
23  Ignore = 0,
24  Send = 1,
25  SendDeny = 2,
26  };
27  explicit MDNWarningWidget(QWidget *parent = nullptr);
28  ~MDNWarningWidget() override;
29 
30  void setCanDeny(bool deny);
31 
32  void setInformation(const QString &str);
33 
34  Q_REQUIRED_RESULT KMime::MDN::SendingMode sendingMode() const;
35  void setSendingMode(KMime::MDN::SendingMode newSendingMode);
36 
37 Q_SIGNALS:
38  void sendResponse(MessageViewer::MDNWarningWidget::ResponseType type, KMime::MDN::SendingMode sendingMode);
39 
40 private:
41  void slotSend();
42  void slotIgnore();
43  void slotSendDeny();
44  QAction *const mIgnoreAction;
45  QAction *const mSendAction;
46  QAction *const mSendDenyAction;
47  KMime::MDN::SendingMode mSendingMode = KMime::MDN::SentAutomatically;
48 };
49 }
The MDNWarningWidget class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Mar 27 2023 04:08:17 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.