File indexing completed on 2024-07-21 07:58:12

0001 /*
0002     SPDX-FileCopyrightText: 2013 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 PLASMA_NM_ENABLED_CONNECTIONS_H
0008 #define PLASMA_NM_ENABLED_CONNECTIONS_H
0009 
0010 #include <QObject>
0011 
0012 #include <qqmlregistration.h>
0013 
0014 #include <NetworkManagerQt/Manager>
0015 
0016 class EnabledConnections : public QObject
0017 {
0018     Q_OBJECT
0019     QML_ELEMENT
0020 
0021     /**
0022      * Indicates if overall networking is currently enabled or not
0023      */
0024     Q_PROPERTY(bool networkingEnabled READ isNetworkingEnabled NOTIFY networkingEnabled)
0025     /**
0026      * Indicates if wireless is currently enabled or not
0027      */
0028     Q_PROPERTY(bool wirelessEnabled READ isWirelessEnabled NOTIFY wirelessEnabled)
0029     /**
0030      * Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch
0031      */
0032     Q_PROPERTY(bool wirelessHwEnabled READ isWirelessHwEnabled NOTIFY wirelessHwEnabled)
0033     /**
0034      * Indicates if mobile broadband devices are currently enabled or not.
0035      */
0036     Q_PROPERTY(bool wwanEnabled READ isWwanEnabled NOTIFY wwanEnabled)
0037     /**
0038      * Indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch.
0039      */
0040     Q_PROPERTY(bool wwanHwEnabled READ isWwanHwEnabled NOTIFY wwanHwEnabled)
0041 
0042 public:
0043     explicit EnabledConnections(QObject *parent = nullptr);
0044     ~EnabledConnections() override;
0045 
0046     bool isNetworkingEnabled() const;
0047     bool isWirelessEnabled() const;
0048     bool isWirelessHwEnabled() const;
0049     bool isWwanEnabled() const;
0050     bool isWwanHwEnabled() const;
0051 
0052 public Q_SLOTS:
0053     void onNetworkingEnabled(bool enabled);
0054     void onWirelessEnabled(bool enabled);
0055     void onWirelessHwEnabled(bool enabled);
0056     void onWwanEnabled(bool enabled);
0057     void onWwanHwEnabled(bool enabled);
0058 
0059 Q_SIGNALS:
0060     void networkingEnabled(bool enabled);
0061     void wirelessEnabled(bool enabled);
0062     void wirelessHwEnabled(bool enabled);
0063     void wwanEnabled(bool enabled);
0064     void wwanHwEnabled(bool enabled);
0065 
0066 private:
0067     bool m_networkingEnabled;
0068     bool m_wirelessEnabled;
0069     bool m_wirelessHwEnabled;
0070     bool m_wwanEnabled;
0071     bool m_wwanHwEnabled;
0072 };
0073 
0074 #endif // PLASMA_NM_ENABLED_CONNECTIONS_H