35 #ifndef QGPGME_QGPGMENEWCRYPTOCONFIG_H
36 #define QGPGME_QGPGMENEWCRYPTOCONFIG_H
38 #include "qgpgme_export.h"
39 #include "cryptoconfig.h"
42 #include <QStringList>
45 #ifdef BUILDING_QGPGME
46 # include "configuration.h"
48 # include <gpgme++/configuration.h>
63 QGpgMENewCryptoConfigEntry(
const std::shared_ptr<QGpgMENewCryptoConfigGroup> &group,
const GpgME::Configuration::Option &option);
66 QString name()
const Q_DECL_OVERRIDE;
67 QString description()
const Q_DECL_OVERRIDE;
68 QString path()
const Q_DECL_OVERRIDE;
69 bool isOptional()
const Q_DECL_OVERRIDE;
70 bool isReadOnly()
const Q_DECL_OVERRIDE;
71 bool isList()
const Q_DECL_OVERRIDE;
72 bool isRuntime()
const Q_DECL_OVERRIDE;
73 Level level()
const Q_DECL_OVERRIDE;
74 ArgType argType()
const Q_DECL_OVERRIDE;
75 bool isSet()
const Q_DECL_OVERRIDE;
76 bool boolValue()
const Q_DECL_OVERRIDE;
77 QString stringValue()
const Q_DECL_OVERRIDE;
78 int intValue()
const Q_DECL_OVERRIDE;
79 unsigned int uintValue()
const Q_DECL_OVERRIDE;
80 QUrl urlValue()
const Q_DECL_OVERRIDE;
81 unsigned int numberOfTimesSet()
const Q_DECL_OVERRIDE;
82 std::vector<int> intValueList()
const Q_DECL_OVERRIDE;
83 std::vector<unsigned int> uintValueList()
const Q_DECL_OVERRIDE;
84 QList<QUrl> urlValueList()
const Q_DECL_OVERRIDE;
85 void resetToDefault() Q_DECL_OVERRIDE;
86 void setBoolValue(
bool) Q_DECL_OVERRIDE;
87 void setStringValue(
const QString &) Q_DECL_OVERRIDE;
88 void setIntValue(
int) Q_DECL_OVERRIDE;
89 void setUIntValue(
unsigned int) Q_DECL_OVERRIDE;
90 void setURLValue(
const QUrl &) Q_DECL_OVERRIDE;
91 void setNumberOfTimesSet(
unsigned int) Q_DECL_OVERRIDE;
92 void setIntValueList(
const std::vector<int> &) Q_DECL_OVERRIDE;
93 void setUIntValueList(
const std::vector<unsigned int> &) Q_DECL_OVERRIDE;
94 void setURLValueList(
const QList<QUrl> &) Q_DECL_OVERRIDE;
95 bool isDirty()
const Q_DECL_OVERRIDE;
97 QStringList stringValueList()
const;
100 void setDirty(
bool b);
101 QString outputString()
const;
104 bool isStringType()
const;
105 QVariant stringToValue(
const QString &value,
bool unescape)
const;
106 QString toString(
bool escape)
const;
109 std::weak_ptr<QGpgMENewCryptoConfigGroup> m_group;
110 GpgME::Configuration::Option m_option;
116 QGpgMENewCryptoConfigGroup(
const std::shared_ptr<QGpgMENewCryptoConfigComponent> &parent,
const GpgME::Configuration::Option &option);
119 QString name()
const Q_DECL_OVERRIDE;
120 QString iconName()
const Q_DECL_OVERRIDE
124 QString description()
const Q_DECL_OVERRIDE;
125 QString path()
const Q_DECL_OVERRIDE;
126 QGpgME::CryptoConfigEntry::Level level()
const Q_DECL_OVERRIDE;
127 QStringList entryList()
const Q_DECL_OVERRIDE;
132 std::weak_ptr<QGpgMENewCryptoConfigComponent> m_component;
133 GpgME::Configuration::Option m_option;
134 QStringList m_entryNames;
135 QHash< QString, std::shared_ptr<QGpgMENewCryptoConfigEntry> > m_entriesByName;
145 void setComponent(
const GpgME::Configuration::Component &component);
147 QString name()
const Q_DECL_OVERRIDE;
148 QString iconName()
const Q_DECL_OVERRIDE
152 QString description()
const Q_DECL_OVERRIDE;
153 QStringList groupList()
const Q_DECL_OVERRIDE;
156 void sync(
bool runtime);
159 GpgME::Configuration::Component m_component;
160 QHash< QString, std::shared_ptr<QGpgMENewCryptoConfigGroup> > m_groupsByName;
176 QStringList componentList()
const Q_DECL_OVERRIDE;
180 void clear() Q_DECL_OVERRIDE;
181 void sync(
bool runtime) Q_DECL_OVERRIDE;
185 void reloadConfiguration(
bool showErrors);
188 QHash< QString, std::shared_ptr<QGpgMENewCryptoConfigComponent> > m_componentsByName;