Libkleo

defaultkeyfilter.h
1/*
2 defaultkeyfilter.h
3
4 This file is part of libkleopatra, the KDE keymanagement library
5 SPDX-FileCopyrightText: 2004 Klarälvdalens Datakonsult AB
6
7 SPDX-FileCopyrightText: 2016 Bundesamt für Sicherheit in der Informationstechnik
8 SPDX-FileContributor: Intevation GmbH
9
10 SPDX-License-Identifier: GPL-2.0-or-later
11*/
12
13#pragma once
14
15#include "keyfilter.h"
16#include "kleo_export.h"
17
18#include <QColor>
19#include <QFont>
20#include <QString>
21
22#include <gpgme++/key.h>
23
24#include <memory>
25
26namespace Kleo
27{
28
29/** Default implementation of key filter class. */
30class KLEO_EXPORT DefaultKeyFilter : public KeyFilter
31{
32public:
34 ~DefaultKeyFilter() override;
35
36 /** Used for bool checks */
37 enum TriState {
38 // clang-format off
39 DoesNotMatter = 0,
40 Set = 1,
41 NotSet = 2,
42 // clang-format on
43 };
44
45 /** Used for level checks */
47 // clang-format off
48 LevelDoesNotMatter = 0,
49 Is = 1,
50 IsNot = 2,
51 IsAtLeast = 3,
52 IsAtMost = 4,
53 // clang-format on
54 };
55
56 bool matches(const GpgME::Key &key, MatchContexts ctx) const override;
57 bool matches(const GpgME::UserID &userID, MatchContexts ctx) const override;
58
59 unsigned int specificity() const override;
60 void setSpecificity(unsigned int value);
61 QString id() const override;
62 void setId(const QString &value);
63 KeyFilter::MatchContexts availableMatchContexts() const override;
64 void setMatchContexts(KeyFilter::MatchContexts value);
65
66 QColor fgColor() const override;
67 void setFgColor(const QColor &value);
68
69 QColor bgColor() const override;
70 void setBgColor(const QColor &value);
71
72 FontDescription fontDescription() const override;
73 QString name() const override;
74 void setName(const QString &value);
75 QString icon() const override;
76 void setIcon(const QString &value);
77 QFont font() const;
78 void setFont(const QFont &value);
79 QString description() const override;
80 void setDescription(const QString &description);
81
82 TriState revoked() const;
83 TriState expired() const;
84 TriState invalid() const;
85 TriState disabled() const;
86 TriState root() const;
87 TriState canEncrypt() const;
88 TriState canSign() const;
89 TriState canCertify() const;
90 TriState canAuthenticate() const;
91 TriState hasEncrypt() const;
92 TriState hasSign() const;
93 TriState hasCertify() const;
94 TriState hasAuthenticate() const;
95 TriState qualified() const;
96 TriState cardKey() const;
97 TriState hasSecret() const;
98 TriState isOpenPGP() const;
99 TriState wasValidated() const;
100 TriState isDeVS() const;
101 TriState isBad() const;
102
103 LevelState ownerTrust() const;
104 GpgME::Key::OwnerTrust ownerTrustReferenceLevel() const;
105
106 LevelState validity() const;
107 GpgME::UserID::Validity validityReferenceLevel() const;
108 bool italic() const;
109 bool bold() const;
110 bool strikeOut() const;
111 bool useFullFont() const;
112
113 void setRevoked(const TriState);
114 void setExpired(const TriState);
115 void setInvalid(const TriState);
116 void setDisabled(const TriState);
117 void setRoot(const TriState);
118 void setCanEncrypt(const TriState);
119 void setCanSign(const TriState);
120 void setCanCertify(const TriState);
121 void setCanAuthenticate(const TriState);
122 void setHasEncrypt(const TriState);
123 void setHasSign(const TriState);
124 void setHasCertify(const TriState);
125 void setHasAuthenticate(const TriState);
126 void setQualified(const TriState);
127 void setCardKey(const TriState);
128 void setHasSecret(const TriState);
129 void setIsOpenPGP(const TriState);
130 void setWasValidated(const TriState);
131 void setIsDeVs(const TriState);
132 void setIsBad(const TriState);
133 /**
134 * If \p value is \c Set, then invalid S/MIME certificates do not match.
135 * If \p value is \c NotSet, then valid S/MIME certificates do not match.
136 */
137 void setValidIfSMIME(TriState value);
138 TriState validIfSMIME() const;
139
140 void setOwnerTrust(const LevelState);
141 void setOwnerTrustReferenceLevel(const GpgME::Key::OwnerTrust);
142
143 void setValidity(const LevelState);
144 void setValidityReferenceLevel(const GpgME::UserID::Validity);
145
146 void setItalic(bool value);
147 void setBold(bool value);
148 void setStrikeOut(bool value);
149 void setUseFullFont(bool value);
150
151private:
152 class Private;
153 const std::unique_ptr<Private> d;
154};
155
156} // namespace Kleo
Default implementation of key filter class.
TriState
Used for bool checks.
LevelState
Used for level checks.
An abstract base class key filters.
Definition keyfilter.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.