KIdentityManagement

keylistmodelinterface.h
1// SPDX-FileCopyrightText: 2023 Claudio Cambra <claudio.cambra@kde.org>
2// SPDX-License-Identifier: LGPL-2.0-or-later
3
4#pragma once
5
6#include "kidentitymanagementquick_export.h"
7
8#include <QHash>
9#include <QObject>
10
11class QModelIndex;
12
13namespace KIdentityManagementCore
14{
15class Identity;
16}
17namespace KIdentityManagementQuick
18{
19
20class KeyUseTypes
21{
22 Q_GADGET
23
24public:
25 enum class KeyUse {
26 KeySigningUse,
27 KeyEncryptionUse
28 };
29 Q_ENUM(KeyUse)
30};
31
32/**
33 * @brief This interface defines the roles and rolenames that are expected
34 * in the QtQuick Cryptography editor.
35 */
36class KIDENTITYMANAGEMENTQUICK_EXPORT KeyListModelInterface
37{
38public:
39 virtual ~KeyListModelInterface() {};
40 enum Roles {
41 KeyIdentifierRole = Qt::UserRole + 1,
42 KeyByteArrayRole
43 };
44
45 static QHash<int, QByteArray> roleNames()
46 {
47 return {{KeyIdentifierRole, "keyIdentifier"}, {KeyByteArrayRole, "keyByteArray"}};
48 }
49
50 virtual QModelIndex indexForIdentity(const KIdentityManagementCore::Identity &identity, const KeyUseTypes::KeyUse keyUse) const = 0;
51};
52}
53
54Q_DECLARE_INTERFACE(KIdentityManagementQuick::KeyListModelInterface, "KeyListModelInterface")
User identity information.
Definition identity.h:74
This interface defines the roles and rolenames that are expected in the QtQuick Cryptography editor.
UserRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.