| 1 | /* |
| 2 | * Copyright (C) 2003-2005 Justin Karneges <justin@affinix.com> |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2.1 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
| 17 | * |
| 18 | */ |
| 19 | |
| 20 | #pragma once |
| 21 | |
| 22 | #include "gpgaction.h" |
| 23 | #include "gpgop.h" |
| 24 | #include "gpgproc_p.h" |
| 25 | #include <QObject> |
| 26 | |
| 27 | namespace gpgQCAPlugin { |
| 28 | |
| 29 | class GpgOp::Private : public QObject |
| 30 | { |
| 31 | Q_OBJECT |
| 32 | public: |
| 33 | QCA::Synchronizer sync; |
| 34 | GpgOp *q; |
| 35 | GpgAction *act; |
| 36 | QString bin; |
| 37 | GpgOp::Type op; |
| 38 | GpgAction::Output output; |
| 39 | QByteArray result; |
| 40 | QString diagnosticText; |
| 41 | QList<GpgOp::Event> eventList; |
| 42 | bool waiting; |
| 43 | |
| 44 | bool opt_ascii, opt_noagent, opt_alwaystrust; |
| 45 | QString opt_pubfile, opt_secfile; |
| 46 | |
| 47 | #ifdef GPG_PROFILE |
| 48 | QTime timer; |
| 49 | #endif |
| 50 | |
| 51 | Private(GpgOp *_q); |
| 52 | ~Private() override; |
| 53 | void reset(ResetMode mode); |
| 54 | void make_act(GpgOp::Type _op); |
| 55 | void eventReady(const GpgOp::Event &e); |
| 56 | void eventReady(GpgOp::Event::Type type); |
| 57 | void eventReady(GpgOp::Event::Type type, int written); |
| 58 | void eventReady(GpgOp::Event::Type type, const QString &keyId); |
| 59 | |
| 60 | public Q_SLOTS: |
| 61 | void act_readyRead(); |
| 62 | void act_bytesWritten(int bytes); |
| 63 | void act_needPassphrase(const QString &keyId); |
| 64 | void act_needCard(); |
| 65 | void act_readyReadDiagnosticText(); |
| 66 | void act_finished(); |
| 67 | }; |
| 68 | |
| 69 | } // namespace gpgQCAPlugin |
| 70 | |