|
Packit |
d7e8d0 |
/*
|
|
Packit |
d7e8d0 |
qgpgmebackend.h
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
This file is part of qgpgme, the Qt API binding for gpgme
|
|
Packit |
d7e8d0 |
Copyright (c) 2004,2005 Klarälvdalens Datakonsult AB
|
|
Packit |
d7e8d0 |
Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
|
|
Packit |
d7e8d0 |
Software engineering by Intevation GmbH
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
QGpgME is free software; you can redistribute it and/or
|
|
Packit |
d7e8d0 |
modify it under the terms of the GNU General Public License as
|
|
Packit |
d7e8d0 |
published by the Free Software Foundation; either version 2 of the
|
|
Packit |
d7e8d0 |
License, or (at your option) any later version.
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
QGpgME is distributed in the hope that it will be useful,
|
|
Packit |
d7e8d0 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
d7e8d0 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
d7e8d0 |
General Public License for more details.
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
You should have received a copy of the GNU General Public License
|
|
Packit |
d7e8d0 |
along with this program; if not, write to the Free Software
|
|
Packit |
d7e8d0 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
In addition, as a special exception, the copyright holders give
|
|
Packit |
d7e8d0 |
permission to link the code of this program with any edition of
|
|
Packit |
d7e8d0 |
the Qt library by Trolltech AS, Norway (or with modified versions
|
|
Packit |
d7e8d0 |
of Qt that use the same license as Qt), and distribute linked
|
|
Packit |
d7e8d0 |
combinations including the two. You must obey the GNU General
|
|
Packit |
d7e8d0 |
Public License in all respects for all of the code used other than
|
|
Packit |
d7e8d0 |
Qt. If you modify this file, you may extend this exception to
|
|
Packit |
d7e8d0 |
your version of the file, but you are not obligated to do so. If
|
|
Packit |
d7e8d0 |
you do not wish to do so, delete this exception statement from
|
|
Packit |
d7e8d0 |
your version.
|
|
Packit |
d7e8d0 |
*/
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#ifndef __QGPGME_QGPGMEBACKEND_H__
|
|
Packit |
d7e8d0 |
#define __QGPGME_QGPGMEBACKEND_H__
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#include <QString>
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#include "protocol.h"
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
class QString;
|
|
Packit |
d7e8d0 |
template <typename T_Key, typename T_Value> class QMap;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
namespace QGpgME
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
class CryptoConfig;
|
|
Packit |
d7e8d0 |
class Protocol;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
class QGpgMEBackend
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
public:
|
|
Packit |
d7e8d0 |
QGpgMEBackend();
|
|
Packit |
d7e8d0 |
~QGpgMEBackend();
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
QString name() const;
|
|
Packit |
d7e8d0 |
QString displayName() const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
CryptoConfig *config() const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
Protocol *openpgp() const;
|
|
Packit |
d7e8d0 |
Protocol *smime() const;
|
|
Packit |
d7e8d0 |
Protocol *protocol(const char *name) const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
static const char OpenPGP[];
|
|
Packit |
d7e8d0 |
static const char SMIME[];
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
bool checkForOpenPGP(QString *reason = Q_NULLPTR) const;
|
|
Packit |
d7e8d0 |
bool checkForSMIME(QString *reason = Q_NULLPTR) const;
|
|
Packit |
d7e8d0 |
bool checkForProtocol(const char *name, QString *reason) const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
bool supportsOpenPGP() const
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
return true;
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
bool supportsSMIME() const
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
return true;
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
bool supportsProtocol(const char *name) const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
const char *enumerateProtocols(int i) const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
private:
|
|
Packit |
d7e8d0 |
mutable QGpgME::CryptoConfig *mCryptoConfig;
|
|
Packit |
d7e8d0 |
mutable Protocol *mOpenPGPProtocol;
|
|
Packit |
d7e8d0 |
mutable Protocol *mSMIMEProtocol;
|
|
Packit |
d7e8d0 |
};
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#endif // __QGPGME_QGPGMEBACKEND_H__
|