UserInterfaceUtils.h
#ifndef GPGFRONTEND_USER_INTERFACE_UTILS_H
#define GPGFRONTEND_USER_INTERFACE_UTILS_H
#include "core/GpgModel.h"
#include "core/function/result_analyse/GpgVerifyResultAnalyse.h"
#include "ui/GpgFrontendUI.h"
namespace GpgFrontend {
class GpgResultAnalyse;
}
namespace GpgFrontend::UI {
class InfoBoardWidget;
class TextEdit;
void show_verify_details(QWidget* parent, InfoBoardWidget* info_board,
GpgError error, const GpgVerifyResult& verify_result);
void import_unknown_key_from_keyserver(
QWidget* parent, const GpgVerifyResultAnalyse& verify_res);
void refresh_info_board(InfoBoardWidget* info_board, int status,
const std::string& report_text);
void process_result_analyse(TextEdit* edit, InfoBoardWidget* info_board,
const GpgResultAnalyse& result_analyse);
void process_result_analyse(TextEdit* edit, InfoBoardWidget* info_board,
const GpgResultAnalyse& result_analyse_a,
const GpgResultAnalyse& result_analyse_b);
void process_operation(
QWidget* parent, const std::string& waiting_title,
GpgFrontend::Thread::Task::TaskRunnable func,
GpgFrontend::Thread::Task::TaskCallback callback = nullptr,
Thread::Task::DataObjectPtr data_object = nullptr);
void import_key_from_keyserver(QWidget* parent, const std::string& key_id,
const std::string& key_server);
class CommonUtils : public QWidget {
Q_OBJECT
public:
using ImportCallbackFunctiopn = std::function<void(
const std::string&, const std::string&, size_t, size_t)>;
CommonUtils();
static CommonUtils* GetInstance();
signals:
void SignalKeyStatusUpdated();
void SignalGnupgNotInstall();
void SignalKeyDatabaseRefreshDone();
public slots:
void SlotImportKeys(QWidget* parent, const std::string& in_buffer);
void SlotImportKeyFromFile(QWidget* parent);
void SlotImportKeyFromKeyServer(QWidget* parent);
void SlotImportKeyFromClipboard(QWidget* parent);
static void SlotImportKeyFromKeyServer(
const GpgFrontend::KeyIdArgsList& key_ids,
const GpgFrontend::UI::CommonUtils::ImportCallbackFunctiopn& callback);
void SlotExecuteGpgCommand(
const QStringList& arguments,
const std::function<void(QProcess*)>& interact_func);
private slots:
void slot_update_key_status();
private:
static std::unique_ptr<CommonUtils> instance_;
};
} // namespace GpgFrontend::UI
#endif // GPGFRONTEND_USER_INTERFACE_UTILS_H
GpgFrontend::CoreCommonUtil::GetInstance
static CoreCommonUtil * GetInstance()
Construct a new Core Common Util object.
Definition: CoreCommonUtil.cpp:33
GpgFrontend::FileOperator::ReadFile
static bool ReadFile(const QString &file_name, QByteArray &data)
read file content
Definition: FileOperator.cpp:31
GpgFrontend::UI::WaitingDialog
Definition: WaitingDialog.h:40
GpgFrontend::UI
Definition: FileReadTask.cpp:31
GpgFrontend::UI::refresh_info_board
void refresh_info_board(InfoBoardWidget *info_board, int status, const std::string &report_text)
Definition: UserInterfaceUtils.cpp:84
GpgFrontend::UI::process_operation
void process_operation(QWidget *parent, const std::string &waiting_title, const Thread::Task::TaskRunnable func, const Thread::Task::TaskCallback callback, Thread::Task::DataObjectPtr data_object)
Definition: UserInterfaceUtils.cpp:116
GpgFrontend::GpgResultAnalyse::GetStatus
int GetStatus() const
Get the Status object.
Definition: GpgResultAnalyse.cpp:35
GpgFrontend::UI::import_key_from_keyserver
void import_key_from_keyserver(QWidget *parent, const std::string &key_id, const std::string &key_server)
GpgFrontend::UI::VerifyDetailsDialog
Definition: VerifyDetailsDialog.h:41
GpgFrontend
Definition: CoreCommonUtil.cpp:29
GpgFrontend::UI::CommonUtils
Definition: UserInterfaceUtils.h:124
GpgFrontend::GpgResultAnalyse::GetResultReport
const std::string GetResultReport() const
Get the Result Report object.
Definition: GpgResultAnalyse.cpp:31
GpgFrontend::SingletonFunctionObject< TaskRunnerGetter >::GetInstance
static TaskRunnerGetter & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:170
GpgFrontend::UI::InfoBoardWidget::AddOptionalAction
void AddOptionalAction(const QString &name, const std::function< void()> &action)
Definition: InfoBoardWidget.cpp:113
GpgFrontend::GpgInfo::AppPath
std::string AppPath
executable binary path of gnupg
Definition: GpgInfo.h:41
GpgFrontend::UI::InfoBoardWidget::ResetOptionActionsMenu
void ResetOptionActionsMenu()
Definition: InfoBoardWidget.cpp:129
GpgFrontend::UI::import_unknown_key_from_keyserver
void import_unknown_key_from_keyserver(QWidget *parent, const GpgVerifyResultAnalyse &verify_res)
Definition: UserInterfaceUtils.cpp:61
GpgFrontend::GlobalSettingStation::GetUISettings
libconfig::Setting & GetUISettings() noexcept
Definition: GlobalSettingStation.h:63
GpgFrontend::UI::CommonUtils::SlotImportKeys
void SlotImportKeys(QWidget *parent, const std::string &in_buffer)
Definition: UserInterfaceUtils.cpp:180
GpgFrontend::GpgContext::GetInfo
const GpgInfo & GetInfo() const
Get the Info object.
Definition: GpgContext.h:95
GpgFrontend::UI::TextEdit
TextEdit class.
Definition: TextEdit.h:41
GpgFrontend::GpgVerifyResultAnalyse
Definition: GpgVerifyResultAnalyse.h:40
GpgFrontend::UI::KeyServerImportDialog
Definition: KeyServerImportDialog.h:46
GpgFrontend::GpgKeyGetter::FlushKeyCache
void FlushKeyCache()
flush the keys in the cache
Definition: GpgKeyGetter.cpp:101
GpgFrontend::UI::SettingsObject::Check
nlohmann::json & Check(const std::string &key, const nlohmann::json &default_value)
Definition: SettingsObject.cpp:31
GpgFrontend::UI::InfoBoardWidget::SlotRefresh
void SlotRefresh(const QString &text, GpgFrontend::UI::InfoBoardStatus status)
Definition: InfoBoardWidget.cpp:89
GpgFrontend::UI::KeyImportDetailDialog
Definition: KeyImportDetailDialog.h:43
GpgFrontend::UI::CommonUtils::slot_update_key_status
void slot_update_key_status()
update the key status when signal is emitted
Definition: UserInterfaceUtils.cpp:361
GpgFrontend::UI::SettingsObject
The SettingsObject class This class is used to store settings for the application securely.
Definition: SettingsObject.h:43
GpgFrontend::GpgResultAnalyse
Definition: GpgResultAnalyse.h:37
GpgFrontend::SingletonFunctionObject< GpgKeyGetter >::GetAllChannelId
static std::vector< int > GetAllChannelId()
Get all the channel ids.
Definition: GpgFunctionObject.h:246
GpgFrontend::UI::CommonUtils::SlotImportKeyFromFile
void SlotImportKeyFromFile(QWidget *parent)
Definition: UserInterfaceUtils.cpp:188
GpgFrontend::UI::CommonUtils::SlotImportKeyFromKeyServer
void SlotImportKeyFromKeyServer(QWidget *parent)
Definition: UserInterfaceUtils.cpp:204
GpgFrontend::UI::InfoBoardWidget::AssociateTabWidget
void AssociateTabWidget(QTabWidget *tab)
Definition: InfoBoardWidget.cpp:103
GpgFrontend::GpgVerifyResultAnalyse::GetSignatures
gpgme_signature_t GetSignatures() const
Get the Signatures object.
Definition: GpgVerifyResultAnalyse.cpp:206
GpgFrontend::UI::SignalStation::GetInstance
static SignalStation * GetInstance()
Get the Instance object.
Definition: SignalStation.cpp:37
GpgFrontend::UI::CommonUtils::SignalKeyDatabaseRefreshDone
void SignalKeyDatabaseRefreshDone()
emit when the key database is refreshed
GpgFrontend::UI::CommonUtils::SlotImportKeyFromClipboard
void SlotImportKeyFromClipboard(QWidget *parent)
Definition: UserInterfaceUtils.cpp:209
GpgFrontend::UI::CommonUtils::CommonUtils
CommonUtils()
Construct a new Common Utils object.
Definition: UserInterfaceUtils.cpp:150
GpgFrontend::GpgKeyImportExporter::ImportKey
GpgImportInformation ImportKey(StdBypeArrayPtr inBuffer)
Definition: GpgKeyImportExporter.cpp:42
GpgFrontend::UI::CommonUtils::SlotExecuteGpgCommand
void SlotExecuteGpgCommand(const QStringList &arguments, const std::function< void(QProcess *)> &interact_func)
Definition: UserInterfaceUtils.cpp:215
GpgFrontend::Thread::Task
Definition: Task.h:45
GpgFrontend::UI::show_verify_details
void show_verify_details(QWidget *parent, InfoBoardWidget *info_board, GpgError error, const GpgVerifyResult &verify_result)
Definition: UserInterfaceUtils.cpp:52
GpgFrontend::UI::process_result_analyse
void process_result_analyse(TextEdit *edit, InfoBoardWidget *info_board, const GpgResultAnalyse &result_analyse)
Definition: UserInterfaceUtils.cpp:96
GpgFrontend::GpgImportInformation
Definition: GpgKeyImportExporter.h:57
GpgFrontend::UI::CommonUtils::GetInstance
static CommonUtils * GetInstance()
Get the Instance object.
Definition: UserInterfaceUtils.cpp:143
GpgFrontend::UI::InfoBoardWidget
Class for handling the verify label shown at bottom of a textedit-page.
Definition: InfoBoardWidget.h:53