GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgContext.h
1 
29 #pragma once
30 
31 #include <gpgme.h>
32 
33 #include "core/function/SecureMemoryAllocator.h"
34 #include "core/function/basic/GpgFunctionObject.h"
35 
36 namespace GpgFrontend {
37 
43  QString db_path = {};
44 
45  bool test_mode = false;
46  bool offline_mode = false;
47  bool auto_import_missing_key = false;
48 
49  bool custom_gpgconf = false;
50  QString custom_gpgconf_path;
51 
52  bool use_pinentry = false;
53 };
54 
59 class GPGFRONTEND_CORE_EXPORT GpgContext
60  : public SingletonFunctionObject<GpgContext> {
61  public:
62  explicit GpgContext(int channel);
63 
64  explicit GpgContext(GpgContextInitArgs args, int channel);
65 
66  virtual ~GpgContext() override;
67 
68  [[nodiscard]] auto Good() const -> bool;
69 
70  auto BinaryContext() -> gpgme_ctx_t;
71 
72  auto DefaultContext() -> gpgme_ctx_t;
73 
74  private:
75  class Impl;
76  SecureUniquePtr<Impl> p_;
77 };
78 } // namespace GpgFrontend
Definition: GpgContext.cpp:51
Definition: GpgContext.h:60
Definition: GpgFunctionObject.h:57
Definition: app.cpp:39
Definition: GpgContext.h:42