GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
KeyMgmt.h
1 
29 #ifndef __KEYMGMT_H__
30 #define __KEYMGMT_H__
31 
32 #include "ui/GpgFrontendUI.h"
33 #include "ui/dialog/import_export/KeyImportDetailDialog.h"
34 #include "ui/dialog/import_export/KeyServerImportDialog.h"
35 #include "ui/dialog/key_generate/KeygenDialog.h"
36 #include "ui/dialog/keypair_details/KeyDetailsDialog.h"
37 #include "ui/main_window/GeneralMainWindow.h"
38 #include "ui/widgets/KeyList.h"
39 
40 namespace GpgFrontend::UI {
41 
46 class KeyMgmt : public GeneralMainWindow {
47  Q_OBJECT
48 
49  public:
55  explicit KeyMgmt(QWidget* parent = nullptr);
56 
57  public slots:
58 
63  void SlotGenerateSubKey();
64 
69  void SlotExportKeyToKeyPackage();
70 
75  void SlotExportKeyToClipboard();
76 
81  void SlotExportAsOpenSSHFormat();
82 
87  void SlotDeleteSelectedKeys();
88 
93  void SlotDeleteCheckedKeys();
94 
99  void SlotGenerateKeyDialog();
100 
105  void SlotShowKeyDetails();
106 
111  void SlotImportKeyPackage();
112 
113  signals:
114 
119  void SignalStatusBarChanged(QString);
120 
125  void SignalKeyStatusUpdated();
126 
127  private:
132  void create_menus();
133 
138  void create_actions();
139 
144  void create_tool_bars();
145 
151  void delete_keys_with_warning(GpgFrontend::KeyIdArgsListPtr uidList);
152 
153  KeyList* key_list_;
154  QMenu* file_menu_{};
155  QMenu* key_menu_{};
156  QMenu* generate_key_menu_{};
157  QMenu* import_key_menu_{};
158  QAction* open_key_file_act_{};
159  QAction* export_key_to_file_act_{};
160  QAction* export_key_as_open_ssh_format_{};
161  QAction* export_key_to_clipboard_act_{};
162  QAction* delete_checked_keys_act_{};
163  QAction* delete_selected_keys_act_{};
164  QAction* generate_key_dialog_act_{};
165  QAction* generate_key_pair_act_{};
166  QAction* generate_subkey_act_{};
167  QAction* import_key_from_clipboard_act_{};
168  QAction* import_key_from_file_act_{};
169  QAction* import_key_from_key_server_act_{};
170  QAction* import_keys_from_key_package_act_{};
171  QAction* close_act_{};
172  QAction* show_key_details_act_{};
173  KeyServerImportDialog* import_dialog_{};
174 };
175 
176 } // namespace GpgFrontend::UI
177 
178 #endif // __KEYMGMT_H__
GpgFrontend::UI::KeyMgmt::KeyMgmt
KeyMgmt(QWidget *parent=nullptr)
Construct a new Key Mgmt object.
Definition: KeyMgmt.cpp:46
GpgFrontend::UI
Definition: FileReadTask.cpp:31
GpgFrontend::UI::KeyMgmt::create_menus
void create_menus()
Create a menus object.
Definition: KeyMgmt.cpp:219
GpgFrontend::UI::KeyMgmt::create_actions
void create_actions()
Create a actions object.
Definition: KeyMgmt.cpp:123
GpgFrontend::KeyPackageOperator::ImportKeyPackage
static bool ImportKeyPackage(const std::filesystem::path &key_package_path, const std::filesystem::path &phrase_path, GpgFrontend::GpgImportInformation &import_info)
import key package
Definition: KeyPackageOperator.cpp:71
GpgFrontend::UI::GeneralMainWindow
Definition: GeneralMainWindow.h:39
GpgFrontend::write_buffer_to_file
GPGFRONTEND_CORE_EXPORT bool write_buffer_to_file(const std::string &path, const std::string &out_buffer)
Definition: GpgConstants.cpp:128
GpgFrontend::SingletonFunctionObject< GlobalSettingStation >::GetInstance
static GlobalSettingStation & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:170
GpgFrontend::GlobalSettingStation::GetUISettings
libconfig::Setting & GetUISettings() noexcept
Definition: GlobalSettingStation.h:63
GpgFrontend::UI::KeyList::AddListGroupTab
void AddListGroupTab(const QString &name, KeyListRow::KeyType selectType=KeyListRow::SECRET_OR_PUBLIC_KEY, KeyListColumn::InfoType infoType=KeyListColumn::ALL, const std::function< bool(const GpgKey &)> &filter=[](const GpgKey &) -> bool { return true;})
Definition: KeyList.cpp:99
GpgFrontend::UI::KeyList::GetChecked
KeyIdArgsListPtr GetChecked()
Get the Checked object.
Definition: KeyList.cpp:181
GpgFrontend::UI::KeyMgmt
Definition: KeyMgmt.h:46
GpgFrontend::UI::KeyList::AddMenuAction
void AddMenuAction(QAction *act)
Definition: KeyList.cpp:300
GpgFrontend::UI::KeyServerImportDialog
Definition: KeyServerImportDialog.h:46
GpgFrontend::UI::KeyDetailsDialog
Definition: KeyDetailsDialog.h:38
GpgFrontend::GpgKeyGetter::GetKey
GpgKey GetKey(const std::string &id, bool use_cache=true)
Get the Key object.
Definition: GpgKeyGetter.cpp:47
GpgFrontend::UI::KeyList::GetSelected
KeyIdArgsListPtr GetSelected()
Get the Selected object.
Definition: KeyList.cpp:253
GpgFrontend::UI::CommonUtils::SlotImportKeyFromFile
void SlotImportKeyFromFile(QWidget *parent)
Definition: UserInterfaceUtils.cpp:188
GpgFrontend::UI::KeyMgmt::create_tool_bars
void create_tool_bars()
Create a tool bars object.
Definition: KeyMgmt.cpp:242
GpgFrontend::GpgKey::IsPrivateKey
bool IsPrivateKey() const
Definition: GpgKey.cpp:138
GpgFrontend::UI::KeyList::SetDoubleClickedAction
void SetDoubleClickedAction(std::function< void(const GpgKey &, QWidget *)> action)
Set the Double Clicked Action object.
Definition: KeyList.cpp:405
GpgFrontend::UI::KeyMgmt::delete_keys_with_warning
void delete_keys_with_warning(GpgFrontend::KeyIdArgsListPtr uidList)
Definition: KeyMgmt.cpp:282
GpgFrontend::UI::CommonUtils::SlotImportKeyFromKeyServer
void SlotImportKeyFromKeyServer(QWidget *parent)
Definition: UserInterfaceUtils.cpp:204
GpgFrontend::UI::KeyList
Definition: KeyList.h:152
GpgFrontend::GpgKey::IsExpired
bool IsExpired() const
Definition: GpgKey.cpp:140
GpgFrontend::UI::SignalStation::GetInstance
static SignalStation * GetInstance()
Get the Instance object.
Definition: SignalStation.cpp:37
GpgFrontend::UI::CommonUtils::SlotImportKeyFromClipboard
void SlotImportKeyFromClipboard(QWidget *parent)
Definition: UserInterfaceUtils.cpp:209
GpgFrontend::GpgKey::IsRevoked
bool IsRevoked() const
Definition: GpgKey.cpp:142
GpgFrontend::GpgKey::IsDisabled
bool IsDisabled() const
Definition: GpgKey.cpp:144
GpgFrontend::GpgKey::IsHasMasterKey
bool IsHasMasterKey() const
Definition: GpgKey.cpp:146
GpgFrontend::UI::CommonUtils::GetInstance
static CommonUtils * GetInstance()
Get the Instance object.
Definition: UserInterfaceUtils.cpp:143
GpgFrontend::GpgKey
Definition: GpgKey.h:41
GpgFrontend::GpgKeyOpera::DeleteKeys
void DeleteKeys(KeyIdArgsListPtr key_ids)
Definition: GpgKeyOpera.cpp:51
GpgFrontend::UI::SignalStation::SignalRefreshStatusBar
void SignalRefreshStatusBar(const QString &message, int timeout)