File indexing completed on 2024-04-28 03:59:48

0001 /*
0002     SPDX-FileCopyrightText: 2015 Jan Grulich <jgrulich@redhat.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef MODEMMANAGERQT_FAKE_MODEM_BEARER_H
0008 #define MODEMMANAGERQT_FAKE_MODEM_BEARER_H
0009 
0010 #include "generictypes.h"
0011 
0012 #include <QObject>
0013 
0014 class Bearer : public QObject
0015 {
0016     Q_OBJECT
0017     Q_CLASSINFO("D-Bus Interface", "org.kde.fakemodem.Bearer")
0018 public:
0019     explicit Bearer(QObject *parent = nullptr);
0020     ~Bearer() override;
0021 
0022     Q_PROPERTY(bool Connected READ connected)
0023     Q_PROPERTY(QString Interface READ interface)
0024     Q_PROPERTY(QVariantMap Ip4Config READ ip4Config)
0025     Q_PROPERTY(QVariantMap Ip6Config READ ip6Config)
0026     Q_PROPERTY(uint IpTimeout READ ipTimeout)
0027     Q_PROPERTY(QVariantMap Properties READ properties)
0028     Q_PROPERTY(bool Suspended READ suspended)
0029 
0030     bool connected() const;
0031     QString interface() const;
0032     QVariantMap ip4Config() const;
0033     QVariantMap ip6Config() const;
0034     uint ipTimeout() const;
0035     QVariantMap properties() const;
0036     bool suspended() const;
0037 
0038     /* Not part of dbus interface */
0039     QString bearerPath() const;
0040     void setEnableNotifications(bool enable);
0041     void setBearerPath(const QString &path);
0042     void setConnected(bool connected);
0043     void setInterface(const QString &interface);
0044     void setIp4Config(const QVariantMap &config);
0045     void setIp6Config(const QVariantMap &config);
0046     void setIpTimeout(uint timeout);
0047     void setProperties(const QVariantMap &properties);
0048     void setSuspended(bool suspended);
0049 
0050 public Q_SLOTS:
0051     Q_SCRIPTABLE void Connect();
0052     Q_SCRIPTABLE void Disconnect();
0053 
0054 private:
0055     QString m_bearerPath;
0056     bool m_connected;
0057     bool m_enabledNotifications;
0058     QString m_interface;
0059     QVariantMap m_ip4Config;
0060     QVariantMap m_ip6Config;
0061     uint m_ipTimeout;
0062     QVariantMap m_properties;
0063     bool m_suspended;
0064 };
0065 
0066 #endif