File indexing completed on 2024-04-21 16:20:20

0001 /*
0002     SPDX-FileCopyrightText: 2021 Andreas Cord-Landwehr <cordlandwehr@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef CONFIGURATIONPROXY_H
0008 #define CONFIGURATIONPROXY_H
0009 
0010 #include "configuration.h"
0011 #include <QObject>
0012 #include <QPointer>
0013 
0014 class Q_DECL_EXPORT ConfigurationProxy : public QObject
0015 {
0016     Q_PROPERTY(bool unlockModemOnDetection READ unlockModemOnDetection WRITE setUnlockModemOnDetection)
0017     Q_PROPERTY(bool manageVirtualConnections READ manageVirtualConnections WRITE setManageVirtualConnections NOTIFY manageVirtualConnectionsChanged)
0018     Q_PROPERTY(bool airplaneModeEnabled READ airplaneModeEnabled WRITE setAirplaneModeEnabled NOTIFY airplaneModeEnabledChanged)
0019     Q_PROPERTY(QString hotspotName READ hotspotName WRITE setHotspotName)
0020     Q_PROPERTY(QString hotspotPassword READ hotspotPassword WRITE setHotspotPassword)
0021     Q_PROPERTY(QString hotspotConnectionPath READ hotspotConnectionPath WRITE setHotspotConnectionPath)
0022 
0023     // Readonly constant property, as this value should only be set by the platform
0024     Q_PROPERTY(bool showPasswordDialog READ showPasswordDialog CONSTANT)
0025     Q_OBJECT
0026 public:
0027     ConfigurationProxy(QObject *parent = nullptr);
0028     bool unlockModemOnDetection() const;
0029     void setUnlockModemOnDetection(bool unlock);
0030 
0031     bool manageVirtualConnections() const;
0032     void setManageVirtualConnections(bool manage);
0033 
0034     bool airplaneModeEnabled() const;
0035     void setAirplaneModeEnabled(bool enabled);
0036 
0037     QString hotspotName() const;
0038     void setHotspotName(const QString &name);
0039 
0040     QString hotspotPassword() const;
0041     void setHotspotPassword(const QString &password);
0042 
0043     QString hotspotConnectionPath() const;
0044     void setHotspotConnectionPath(const QString &path);
0045 
0046     bool showPasswordDialog() const;
0047 
0048     bool systemConnectionsByDefault() const;
0049 
0050 Q_SIGNALS:
0051     void airplaneModeEnabledChanged();
0052     void manageVirtualConnectionsChanged(bool manage);
0053 
0054 private:
0055     const QPointer<Configuration> mConfiguration;
0056 };
0057 
0058 #endif // CONFIGURATIONPROXY_H