QGpgME  2.1.0-unknown
Qt API for GpgME
listallkeysjob.h
1 /*
2  listallkeysjob.h
3 
4  This file is part of qgpgme, the Qt API binding for gpgme
5  Copyright (c) 2004 Klarälvdalens Datakonsult AB
6  Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
7  Software engineering by Intevation GmbH
8  Copyright (c) 2022 g10 Code GmbH
9  Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
10 
11  QGpgME is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 2 of the
14  License, or (at your option) any later version.
15 
16  QGpgME is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 
25  In addition, as a special exception, the copyright holders give
26  permission to link the code of this program with any edition of
27  the Qt library by Trolltech AS, Norway (or with modified versions
28  of Qt that use the same license as Qt), and distribute linked
29  combinations including the two. You must obey the GNU General
30  Public License in all respects for all of the code used other than
31  Qt. If you modify this file, you may extend this exception to
32  your version of the file, but you are not obligated to do so. If
33  you do not wish to do so, delete this exception statement from
34  your version.
35 */
36 
37 #ifndef __KLEO_LISTALLKEYSJOB_H__
38 #define __KLEO_LISTALLKEYSJOB_H__
39 
40 #include "job.h"
41 #include "qgpgme_export.h"
42 
43 #include <gpgme++/key.h>
44 
45 #include <vector>
46 
47 namespace GpgME
48 {
49 class Error;
50 class KeyListResult;
51 }
52 
53 namespace QGpgME
54 {
55 
56 class ListAllKeysJobPrivate;
57 
74 class QGPGME_EXPORT ListAllKeysJob : public Job
75 {
76  Q_OBJECT
77 public:
78  enum Option {
79  Default = 0x00,
80  DisableAutomaticTrustDatabaseCheck = 0x01,
81  };
82  Q_DECLARE_FLAGS(Options, Option)
83 
84 protected:
85  explicit ListAllKeysJob(std::unique_ptr<ListAllKeysJobPrivate>, QObject *parent);
86 
87 public:
88  ~ListAllKeysJob();
89 
90  void setOptions(Options options);
91  Options options() const;
92 
103  virtual GpgME::Error start(bool mergeKeys = false) = 0;
104 
108  virtual GpgME::KeyListResult exec(std::vector<GpgME::Key> &pub, std::vector<GpgME::Key> &sec, bool mergeKeys = false) = 0;
109 
110 Q_SIGNALS:
111  void result(const GpgME::KeyListResult &result, const std::vector<GpgME::Key> &pub = std::vector<GpgME::Key>(), const std::vector<GpgME::Key> &sec = std::vector<GpgME::Key>(), const QString &auditLogAsHtml = QString(), const GpgME::Error &auditLogError = GpgME::Error());
112 
113 private:
114  Q_DECLARE_PRIVATE(ListAllKeysJob)
115 };
116 
117 Q_DECLARE_OPERATORS_FOR_FLAGS(ListAllKeysJob::Options)
118 
119 }
120 
121 #endif // __KLEO_LISTALLKEYSJOB_H__
An abstract base class for asynchronous crypto operations.
Definition: job.h:71
Definition: abstractimportjob.h:42
An abstract base class for asynchronously listing all keys.
Definition: listallkeysjob.h:74
Definition: abstractimportjob.h:48