/** * Copyright (C) 2021-2024 Saturneric * * This file is part of GpgFrontend. * * GpgFrontend is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GpgFrontend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GpgFrontend. If not, see . * * The initial version of the source code is inherited from * the gpg4usb project, which is under GPL-3.0-or-later. * * All the source code of GpgFrontend was modified and released by * Saturneric starting on May 12, 2021. * * SPDX-License-Identifier: GPL-3.0-or-later * */ #pragma once #include "GpgFrontendUI.h" #include "ui/struct/GpgOperaResultContext.h" namespace GpgFrontend::UI { class GpgOperaHelper : QObject { Q_OBJECT public: using GpgOperaFactory = std::function& context, int channel, int index)>; template static auto BuildSimpleGpgFileOperasHelper( QSharedPointer& context, int channel, int index, OperaFunc opera_func) -> OperaWaitingCb; template static auto BuildComplexGpgFileOperasHelper( QSharedPointer& context, int channel, int index, OperaFunc opera_func) -> OperaWaitingCb; /** * @brief * * @param base * @param category * @param channel * @param f */ static void BuildOperas(QSharedPointer& base, int category, int channel, const GpgOperaFactory& f); /** * @brief * * @param context * @param channel * @param index * @return OperaWaitingCb */ static auto BuildOperasFileEncrypt(QSharedPointer& context, int channel, int index) -> OperaWaitingCb; /** * @brief * * @param context * @param channel * @param index * @return OperaWaitingCb */ static auto BuildOperasDirectoryEncrypt( QSharedPointer& context, int channel, int index) -> OperaWaitingCb; /** * @brief * * @param context */ static auto BuildOperasFileDecrypt(QSharedPointer& context, int channel, int index) -> OperaWaitingCb; /** * @brief * * @param context * @param channel * @param index * @return OperaWaitingCb */ static auto BuildOperasArchiveDecrypt( QSharedPointer& context, int channel, int index) -> OperaWaitingCb; /** * @brief * * @param context * @return OperaWaitingCb */ static auto BuildOperasFileSign(QSharedPointer& context, int channel, int index) -> OperaWaitingCb; /** * @brief * * @param context * @param channel * @param index * @return OperaWaitingCb */ static auto BuildOperasFileVerify(QSharedPointer& context, int channel, int index) -> OperaWaitingCb; /** * @brief * * @param context * @param channel * @param index */ static auto BuildOperasFileEncryptSign( QSharedPointer& context, int channel, int index) -> OperaWaitingCb; /** * @brief * * @param context * @param channel * @param index * @return OperaWaitingCb */ static auto BuildOperasDirectoryEncryptSign( QSharedPointer& context, int channel, int index) -> OperaWaitingCb; /** * @brief * * @param context * @param channel * @param index * @return OperaWaitingCb */ static auto BuildOperasFileDecryptVerify( QSharedPointer& context, int channel, int index) -> OperaWaitingCb; /** * @brief * * @param context * @param channel * @param index * @return OperaWaitingCb */ static auto BuildOperasArchiveDecryptVerify( QSharedPointer& context, int channel, int index) -> OperaWaitingCb; /** * @brief * * @param parent * @param title * @param operas */ static void WaitForMultipleOperas(QWidget* parent, const QString& title, const QContainer& operas); }; } // namespace GpgFrontend::UI