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 { KeySigningUse, KeyEncryptionUse };
26 Q_ENUM(KeyUse)
27};
28
29/**
30 * @brief This interface defines the roles and rolenames that are expected
31 * in the QtQuick Cryptography editor.
32 */
33class KIDENTITYMANAGEMENTQUICK_EXPORT KeyListModelInterface
34{
35public:
36 virtual ~KeyListModelInterface(){};
37 enum Roles { KeyIdentifierRole = Qt::UserRole + 1, KeyByteArrayRole };
38
39 static QHash<int, QByteArray> roleNames()
40 {
41 return {{KeyIdentifierRole, "keyIdentifier"}, {KeyByteArrayRole, "keyByteArray"}};
42 }
43
44 virtual QModelIndex indexForIdentity(const KIdentityManagementCore::Identity &identity, const KeyUseTypes::KeyUse keyUse) const = 0;
45};
46}
47
48Q_DECLARE_INTERFACE(KIdentityManagementQuick::KeyListModelInterface, "KeyListModelInterface")
User identity information.
Definition identity.h:73
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 Sat Apr 27 2024 22:14:39 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.