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>
11namespace MessageViewer
12{
13class MESSAGEVIEWER_EXPORT DKIMManagerKeyModel : public QAbstractListModel
14{
15 Q_OBJECT
16public:
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
42private:
44};
45}
KGuiItem clear()
DisplayRole
Orientation
The KeyInfo struct.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.