File indexing completed on 2024-07-21 03:41:09

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2007 Andreas Hartmetz <ahartmetz@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef KSSLDINTERFACE_H
0009 #define KSSLDINTERFACE_H
0010 
0011 #include <QByteArray>
0012 #include <QDBusAbstractInterface>
0013 #include <QDBusConnection>
0014 #include <QDBusReply>
0015 #include <QList>
0016 #include <QObject>
0017 #include <QString>
0018 #include <QVariant>
0019 
0020 #include "kssld_dbusmetatypes.h"
0021 
0022 /**
0023  * Proxy class for interface org.kde.KSSLD
0024  */
0025 class OrgKdeKSSLDInterface : public QDBusAbstractInterface
0026 {
0027     Q_OBJECT
0028 public:
0029     static inline const char *staticInterfaceName()
0030     {
0031         return "org.kde.KSSLD";
0032     }
0033 
0034 public:
0035     OrgKdeKSSLDInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr)
0036         : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
0037     {
0038         registerMetaTypesForKSSLD();
0039     }
0040 
0041     ~OrgKdeKSSLDInterface() override
0042     {
0043     }
0044 
0045 public Q_SLOTS: // METHODS
0046     Q_NOREPLY void setRule(const KSslCertificateRule &rule)
0047     {
0048         QList<QVariant> argumentList;
0049         argumentList << QVariant::fromValue(rule);
0050         callWithArgumentList(QDBus::Block, QStringLiteral("setRule"), argumentList);
0051     }
0052 
0053     Q_NOREPLY void clearRule(const KSslCertificateRule &rule)
0054     {
0055         QList<QVariant> argumentList;
0056         argumentList << QVariant::fromValue(rule);
0057         callWithArgumentList(QDBus::Block, QStringLiteral("clearRule__rule"), argumentList);
0058     }
0059 
0060     Q_NOREPLY void clearRule(const QSslCertificate &cert, const QString &hostName)
0061     {
0062         QList<QVariant> argumentList;
0063         argumentList << QVariant::fromValue(cert) << QVariant::fromValue(hostName);
0064         callWithArgumentList(QDBus::Block, QStringLiteral("clearRule__certHost"), argumentList);
0065     }
0066 
0067     QDBusReply<KSslCertificateRule> rule(const QSslCertificate &cert, const QString &hostName)
0068     {
0069         QList<QVariant> argumentList;
0070         argumentList << QVariant::fromValue(cert) << QVariant::fromValue(hostName);
0071         return callWithArgumentList(QDBus::Block, QStringLiteral("rule"), argumentList);
0072     }
0073 };
0074 
0075 namespace org
0076 {
0077 namespace kde
0078 {
0079 typedef ::OrgKdeKSSLDInterface KSSLDInterface;
0080 }
0081 }
0082 
0083 #endif // KSSLDINTERFACE_H