Libkleo

newkeyapprovaldialog.h
1/* -*- c++ -*-
2 newkeyapprovaldialog.h
3
4 This file is part of libkleopatra, the KDE keymanagement library
5 SPDX-FileCopyrightText: 2018 Intevation GmbH
6 SPDX-FileCopyrightText: 2021 g10 Code GmbH
7 SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
8
9 SPDX-License-Identifier: GPL-2.0-or-later
10*/
11
12#pragma once
13
14#include "kleo_export.h"
15
16#include <Libkleo/KeyResolver>
17
18#include <QDialog>
19
20#include <memory>
21
22namespace Kleo
23{
24
25/** @brief A dialog to show for encryption / signing key approval or selection.
26 *
27 * This class is intended to replace the old KeyApprovalDialog with a new
28 * and simpler interface.
29 *
30 * Resolved recipients in this API means a recipient could be resolved
31 * to a single useful key. An unresolved recipient is a recipient for
32 * whom no key could be found. Import / Search will be offered for such
33 * a recipient. Multiple keys for signing / recipient can come e.g. from
34 * group configuration or Addressbook / Identity configuration.
35 *
36 * The Dialog uses the Level System for validity display and shows an
37 * overall outgoing level.
38 *
39 */
40class KLEO_EXPORT NewKeyApprovalDialog : public QDialog
41{
42 Q_OBJECT
43public:
44 /** @brief Create a new Key Approval Dialog.
45 *
46 * @param sender: The address of the sender, this may be used if signing is not
47 * specified to identify a recipient for which "Generate Key" should
48 * be offered.
49 * @param preferredSolution: The preferred signing and/or encryption keys for the sender
50 * and the recipients.
51 * @param alternativeSolution: An alternative set of signing and/or encryption keys for the sender
52 * and the recipients. Typically, S/MIME-only, if preferred solution is OpenPGP-only,
53 * and vice versa. Ignored, if mixed protocol selection is allowed.
54 * @param allowMixed: Whether or not the dialog should allow mixed S/MIME / OpenPGP key selection.
55 * @param forcedProtocol: A specific forced protocol.
56 * @param parent: The parent widget.
57 * @param f: The Qt window flags.
58 */
59 explicit NewKeyApprovalDialog(bool encrypt,
60 bool sign,
61 const QString &sender,
62 KeyResolver::Solution preferredSolution,
63 KeyResolver::Solution alternativeSolution,
64 bool allowMixed,
65 GpgME::Protocol forcedProtocol,
66 QWidget *parent = nullptr,
68
69 ~NewKeyApprovalDialog() override;
70
71 /** @brief The selected signing and/or encryption keys. Only valid after the dialog was accepted. */
72 KeyResolver::Solution result();
73
74private Q_SLOTS:
75 void handleKeyGenResult();
76
77private:
78 class Private;
79 std::unique_ptr<Private> d;
80};
81
82} // namespace kleo
A dialog to show for encryption / signing key approval or selection.
typedef WindowFlags
Solution represents the solution found by the KeyResolver.
Definition keyresolver.h:65
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:02:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.