Messagelib

dkimwidgetinfo.h
1 /*
2  SPDX-FileCopyrightText: 2019-2022 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "dkimchecksignaturejob.h"
10 #include "messageviewer_export.h"
11 #include <Akonadi/Item>
12 #include <QWidget>
13 class QLabel;
14 namespace MessageViewer
15 {
16 /**
17  * @brief The DKIMWidgetInfo class
18  * @author Laurent Montel <[email protected]>
19  */
20 class MESSAGEVIEWER_EXPORT DKIMWidgetInfo : public QWidget
21 {
22  Q_OBJECT
23 public:
24  explicit DKIMWidgetInfo(QWidget *parent = nullptr);
25  ~DKIMWidgetInfo() override;
26  void setResult(const MessageViewer::DKIMCheckSignatureJob::CheckSignatureResult &checkResult, Akonadi::Item::Id id);
27  void clear();
28 
29  Q_REQUIRED_RESULT Akonadi::Item::Id currentItemId() const;
30  void setCurrentItemId(Akonadi::Item::Id currentItemId);
31 
32  Q_REQUIRED_RESULT MessageViewer::DKIMCheckSignatureJob::CheckSignatureResult result() const;
33 
34 protected:
35  Q_REQUIRED_RESULT bool event(QEvent *e) override;
36 
37 private:
38  void updateInfo();
39  void updateToolTip();
40  void initColors();
41  void updatePalette();
42  MessageViewer::DKIMCheckSignatureJob::CheckSignatureResult mResult;
43  QLabel *const mLabel;
44  QColor mWarningColor;
45  QColor mErrorColor;
46  QColor mOkColor;
47  QColor mDefaultColor;
48  Akonadi::Item::Id mCurrentItemId = -1;
49 };
50 }
The DKIMWidgetInfo class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 26 2022 03:52:54 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.