Loading...
Searching...
No Matches
cryptoconfig.h
/*
cryptoconfig.h
This file is part of qgpgme, the Qt API binding for gpgme
Copyright (c) 2004 Klarälvdalens Datakonsult AB
Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
Software engineering by Intevation GmbH
QGpgME 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 2 of the
License, or (at your option) any later version.
QGpgME 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 this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
#ifndef CRYPTOCONFIG_H
#define CRYPTOCONFIG_H
#include "qgpgme_export.h"
#ifdef __cplusplus
/* we read this file from a C compiler, and are only interested in the
* enums... */
#include <QUrl>
#include <vector>
class QVariant;
/* Start reading this file from the bottom up :) */
namespace QGpgME
{
class QGPGME_EXPORT CryptoConfigEntry
{
public:
#endif /* __cplusplus */
enum Level { Level_Basic = 0,
Level_Advanced = 1,
Level_Expert = 2
};
enum ArgType { ArgType_None = 0,
ArgType_String = 1,
ArgType_Int = 2,
ArgType_UInt = 3,
ArgType_Path = 4,
/* Nr. 5 was URL historically. */
ArgType_LDAPURL = 6,
ArgType_DirPath = 7,
NumArgType
};
#ifdef __cplusplus
virtual ~CryptoConfigEntry() {}
virtual QString name() const = 0;
virtual QString description() const = 0;
virtual QString path() const = 0;
virtual bool isOptional() const = 0;
virtual bool isReadOnly() const = 0;
virtual bool isList() const = 0;
virtual bool isRuntime() const = 0;
virtual Level level() const = 0;
virtual ArgType argType() const = 0;
virtual bool isSet() const = 0;
virtual bool boolValue() const = 0;
virtual QString stringValue() const = 0;
virtual int intValue() const = 0;
virtual unsigned int uintValue() const = 0;
virtual QUrl urlValue() const = 0;
virtual unsigned int numberOfTimesSet() const = 0;
virtual std::vector<int> intValueList() const = 0;
virtual std::vector<unsigned int> uintValueList() const = 0;
virtual QList<QUrl> urlValueList() const = 0;
virtual void resetToDefault() = 0;
virtual void setBoolValue(bool) = 0;
virtual void setStringValue(const QString &) = 0;
virtual void setIntValue(int) = 0;
virtual void setUIntValue(unsigned int) = 0;
virtual void setURLValue(const QUrl &) = 0;
virtual void setNumberOfTimesSet(unsigned int) = 0;
virtual void setIntValueList(const std::vector<int> &) = 0;
virtual void setUIntValueList(const std::vector<unsigned int> &) = 0;
virtual void setURLValueList(const QList<QUrl> &) = 0;
virtual bool isDirty() const = 0;
// Design change from here on we are closely bound to one implementation
// of cryptoconfig. To avoid ABI breaks with every new function we
// add real functions from now on.
QStringList stringValueList() const;
QVariant defaultValue() const;
};
class QGPGME_EXPORT CryptoConfigGroup
{
public:
virtual ~CryptoConfigGroup() {}
virtual QString name() const = 0;
virtual QString iconName() const = 0;
virtual QString description() const = 0;
virtual QString path() const = 0;
virtual CryptoConfigEntry::Level level() const = 0;
virtual QStringList entryList() const = 0;
virtual CryptoConfigEntry *entry(const QString &name) const = 0;
};
class QGPGME_EXPORT CryptoConfigComponent
{
public:
virtual ~CryptoConfigComponent() {}
virtual QString name() const = 0;
virtual QString iconName() const = 0;
virtual QString description() const = 0;
virtual QStringList groupList() const = 0;
virtual CryptoConfigGroup *group(const QString &name) const = 0;
};
class QGPGME_EXPORT CryptoConfig
{
public:
virtual ~CryptoConfig() {}
virtual QStringList componentList() const = 0;
virtual CryptoConfigComponent *component(const QString &name) const = 0;
CryptoConfigEntry *entry(const QString &componentName, const QString &entryName) const;
QGPGME_DEPRECATED CryptoConfigEntry *entry(const QString &componentName, const QString &groupName, const QString &entryName) const;
virtual void sync(bool runtime) = 0;
virtual void clear() = 0;
};
}
#endif /* __cplusplus */
#endif /* CRYPTOCONFIG_H */