File indexing completed on 2025-01-26 04:52:43

0001 /* -*- mode: c++; c-basic-offset:4 -*-
0002     command_p.h
0003 
0004     This file is part of KleopatraClient, the Kleopatra interface library
0005     SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include "command.h"
0012 
0013 #include <QRecursiveMutex>
0014 #include <QThread>
0015 
0016 #include <QByteArray>
0017 #include <QString>
0018 #include <QStringList>
0019 #include <QVariant>
0020 
0021 #include <map>
0022 #include <string>
0023 
0024 class KleopatraClientCopy::Command::Private : public QThread
0025 {
0026     Q_OBJECT
0027 private:
0028     friend class ::KleopatraClientCopy::Command;
0029     Command *const q;
0030 
0031 public:
0032     explicit Private(Command *qq)
0033         : QThread()
0034         , q(qq)
0035         , mutex()
0036         , inputs()
0037         , outputs()
0038     {
0039     }
0040     ~Private() override
0041     {
0042     }
0043 
0044 private:
0045     void init();
0046 
0047 private:
0048     void run() override;
0049 
0050 private:
0051     QRecursiveMutex mutex;
0052     struct Option {
0053         QVariant value;
0054         bool hasValue : 1;
0055         bool isCritical : 1;
0056     };
0057     struct Inputs {
0058         Inputs()
0059             : parentWId(0)
0060             , areRecipientsInformative(false)
0061             , areSendersInformative(false)
0062         {
0063         }
0064         std::map<std::string, Option> options;
0065         QStringList filePaths;
0066         QStringList recipients, senders;
0067         std::map<std::string, QByteArray> inquireData;
0068         WId parentWId;
0069         QByteArray command;
0070         bool areRecipientsInformative : 1;
0071         bool areSendersInformative : 1;
0072     } inputs;
0073     struct Outputs {
0074         Outputs()
0075             : canceled(false)
0076             , serverPid(0)
0077         {
0078         }
0079         QString errorString;
0080         bool canceled : 1;
0081         QByteArray data;
0082         qint64 serverPid;
0083         QString serverLocation;
0084     } outputs;
0085 };