Commit 000d602a authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Extract the core of the resolver into a separate class

This makes the core of the resolver independent of the key approval
dialog (and any other UI components).

GnuPG-bug-id: 5283
parent 710d07a8
......@@ -142,6 +142,7 @@ ecm_generate_headers(libkleo_CamelCase_HEADERS
KeyFilterManager
KeyGroup
KeyResolver
KeyResolverCore
KleoException
OidMap
Predicates
......
This diff is collapsed.
/* -*- c++ -*-
kleo/keyresolvercore.h
This file is part of libkleopatra, the KDE keymanagement library
SPDX-FileCopyrightText: 2018 Intevation GmbH
SPDX-FileCopyrightText: 2021 g10 Code GmbH
SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __LIBKLEO_KEYRESOLVERCORE_H__
#define __LIBKLEO_KEYRESOLVERCORE_H__
#include "kleo_export.h"
#include <QMap>
#include <gpgme++/global.h>
#include <memory>
#include <vector>
class QString;
class QStringList;
namespace GpgME
{
class Key;
}
namespace Kleo
{
class KLEO_EXPORT KeyResolverCore
{
public:
explicit KeyResolverCore(bool encrypt, bool sign,
GpgME::Protocol format = GpgME::UnknownProtocol);
~KeyResolverCore();
void setSender(const QString &sender);
QString normalizedSender() const;
void setRecipients(const QStringList &addresses);
void setSigningKeys(const QStringList &fingerprints);
void setOverrideKeys(const QMap<GpgME::Protocol, QMap<QString, QStringList> > &overrides);
void setPreferredProtocol(GpgME::Protocol proto);
void setMinimumValidity(int validity);
bool resolve();
QMap<GpgME::Protocol, std::vector<GpgME::Key> > signingKeys() const;
QMap<GpgME::Protocol, QMap<QString, std::vector<GpgME::Key> > > encryptionKeys() const;
QStringList unresolvedRecipients(GpgME::Protocol protocol) const;
private:
class Private;
std::unique_ptr<Private> d;
};
} // namespace Kleo
#endif // __LIBKLEO_KEYRESOLVER_H__
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment