File indexing completed on 2024-03-24 15:27:57

0001 /*  This file is part of the KDE project
0002 
0003     Copyright (c) 2010 Klarälvdalens Datakonsult AB,
0004                        a KDAB Group company <info@kdab.com>
0005     Author: Kevin Ottens <kevin.ottens@kdab.com>
0006 
0007     This library is free software; you can redistribute it and/or
0008     modify it under the terms of the GNU Lesser General Public
0009     License as published by the Free Software Foundation; either
0010     version 2.1 of the License, or (at your option) version 3, or any
0011     later version accepted by the membership of KDE e.V. (or its
0012     successor approved by the membership of KDE e.V.), which shall
0013     act as a proxy defined in Section 6 of version 3 of the license.
0014 
0015     This library is distributed in the hope that it will be useful,
0016     but WITHOUT ANY WARRANTY; without even the implied warranty of
0017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0018     Lesser General Public License for more details.
0019 
0020     You should have received a copy of the GNU Lesser General Public
0021     License along with this library. If not, see <http://www.gnu.org/licenses/>.
0022 */
0023 
0024 #ifndef NETWORKSTATUS_NETWORKMANAGERSTATUS_H
0025 #define NETWORKSTATUS_NETWORKMANAGERSTATUS_H
0026 
0027 #include "systemstatusinterface.h"
0028 
0029 #include <QDBusInterface>
0030 
0031 class NetworkManagerStatus : public SystemStatusInterface
0032 {
0033     Q_OBJECT
0034 public:
0035     NetworkManagerStatus( QObject *parent = nullptr );
0036 
0037     /* reimp */ Solid::Networking::Status status() const override;
0038     /* reimp */ bool isSupported() const override;
0039     /* reimp */ QString serviceName() const override;
0040 
0041 private Q_SLOTS:
0042     void nmStateChanged( uint nmState );
0043 
0044 private:
0045     static Solid::Networking::Status convertNmState( uint nmState );
0046 
0047     Solid::Networking::Status m_status;
0048     mutable QDBusInterface m_manager;
0049 };
0050 
0051 #endif
0052