Messagelib

dkimmanagerkeymodel.h
1 /*
2  SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 #pragma once
7 #include "dkimmanagerkey.h"
8 #include "messageviewer_export.h"
9 #include <QAbstractListModel>
10 #include <QList>
11 namespace MessageViewer
12 {
13 class MESSAGEVIEWER_EXPORT DKIMManagerKeyModel : public QAbstractListModel
14 {
15  Q_OBJECT
16 public:
17  enum DKIMManagerKeyRoles {
18  DomainRole,
19  SelectorRole,
20  KeyRole,
21  StoredAtDateTimeRole,
22  LastUsedDateTimeRole,
23  LastColumn = LastUsedDateTimeRole,
24  };
25 
26  explicit DKIMManagerKeyModel(QObject *parent = nullptr);
27  ~DKIMManagerKeyModel() override;
28 
29  [[nodiscard]] QList<MessageViewer::KeyInfo> keyInfos() const;
30  void setKeyInfos(const QList<MessageViewer::KeyInfo> &newKeyInfos);
31 
32  [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
33  [[nodiscard]] int columnCount(const QModelIndex &parent = QModelIndex()) const override;
34  [[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
35  [[nodiscard]] QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
36  [[nodiscard]] bool insertKeyInfo(const MessageViewer::KeyInfo &keyInfo);
37  void removeKeyInfo(const QString &keyValue);
38  void removeKeyInfos(const QStringList &keyInfos);
39 
40  void clear();
41 
42 private:
44 };
45 }
DisplayRole
The KeyInfo struct.
Orientation
QAction * clear(const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:55:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.