12#include "kleo_export.h"
14#include <Libkleo/KeyFilter>
17#include <QSortFilterProxyModel>
19#include <gpgme++/global.h>
38class KLEO_EXPORT KeyFilterManager :
public QObject
44 FilterMatchContextsRole,
49 explicit KeyFilterManager(
QObject *parent =
nullptr);
50 ~KeyFilterManager()
override;
53 static KeyFilterManager *instance();
58 void alwaysFilterByProtocol(GpgME::Protocol protocol);
59 GpgME::Protocol protocol()
const;
61 const std::shared_ptr<KeyFilter> &filterMatching(
const GpgME::Key &key, KeyFilter::MatchContexts contexts)
const;
62 std::vector<std::shared_ptr<KeyFilter>> filtersMatching(
const GpgME::Key &key, KeyFilter::MatchContexts contexts)
const;
66 const std::shared_ptr<KeyFilter> &keyFilterByID(
const QString &
id)
const;
67 const std::shared_ptr<KeyFilter> &fromModelIndex(
const QModelIndex &mi)
const;
68 QModelIndex toModelIndex(
const std::shared_ptr<KeyFilter> &kf)
const;
72 QFont font(
const GpgME::Key &key,
const QFont &baseFont)
const;
73 QColor bgColor(
const GpgME::Key &key)
const;
74 QColor bgColor(
const GpgME::UserID &userID)
const;
75 QColor fgColor(
const GpgME::Key &key)
const;
76 QColor fgColor(
const GpgME::UserID &userID)
const;
77 QIcon icon(
const GpgME::Key &key)
const;
82 void alwaysFilterByProtocolChanged(GpgME::Protocol protocol);
85 std::unique_ptr<Private> d;
86 static KeyFilterManager *mSelf;
94 KeyFilterModel(
QObject *parent =
nullptr);
95 ~KeyFilterModel()
override;
97 bool isCustomFilter(
int row)
const;
98 void prependCustomFilter(
const std::shared_ptr<KeyFilter> &filter);
113 const std::unique_ptr<Private> d;
const QList< QKeySequence > & reload()
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 3 2025 11:52:20 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.