Messagelib

dkimmanagerkeywidget.h
1 /*
2  SPDX-FileCopyrightText: 2018-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 #pragma once
7 
8 #include "messageviewer_export.h"
9 #include <QDateTime>
10 #include <QTreeWidgetItem>
11 #include <QWidget>
12 class QTreeWidget;
13 namespace MessageViewer
14 {
15 class DKIMManagerKeyTreeWidgetItem : public QTreeWidgetItem
16 {
17 public:
18  explicit DKIMManagerKeyTreeWidgetItem(QTreeWidget *parent = nullptr);
19  ~DKIMManagerKeyTreeWidgetItem() override;
20  Q_REQUIRED_RESULT bool operator<(const QTreeWidgetItem &other) const override;
21  Q_REQUIRED_RESULT const QDateTime &storedAtDateTime() const;
22  void setStoredAtDateTime(const QDateTime &newStoredAtDateTime);
23 
24  Q_REQUIRED_RESULT const QDateTime &lastUsedDateTime() const;
25  void setLastUsedDateTime(const QDateTime &newLastUsedDateTime);
26 
27 private:
28  QDateTime mStoredAtDateTime;
29  QDateTime mLastUsedDateTime;
30 };
31 
32 /**
33  * @brief The DKIMManagerKeyWidget class
34  * @author Laurent Montel <[email protected]>
35  */
36 class MESSAGEVIEWER_EXPORT DKIMManagerKeyWidget : public QWidget
37 {
38  Q_OBJECT
39 public:
40  enum ManagerKeyTreeWidget {
41  Domain = 0,
42  Selector = 1,
43  KeyValue = 2,
44  InsertDate = 3,
45  LastUsedDate = 3,
46  };
47  explicit DKIMManagerKeyWidget(QWidget *parent = nullptr);
48  ~DKIMManagerKeyWidget() override;
49 
50  void loadKeys();
51  void saveKeys();
52  void resetKeys();
53  Q_REQUIRED_RESULT QByteArray saveHeaders() const;
54  void restoreHeaders(const QByteArray &header);
55 
56 private:
57  void slotCustomContextMenuRequested(const QPoint &);
58  QTreeWidget *const mTreeWidget;
59 };
60 }
61 
The DKIMManagerKeyWidget class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Dec 5 2021 23:04:53 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.