File indexing completed on 2024-05-19 11:47:22
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_MODEM_LOCATION_H 0008 #define MODEMMANAGERQT_FAKE_MODEM_MODEM_LOCATION_H 0009 0010 #include "generictypes.h" 0011 0012 #include <QObject> 0013 0014 #include <QDBusObjectPath> 0015 0016 class ModemLocation : public QDBusAbstractAdaptor 0017 { 0018 Q_OBJECT 0019 Q_CLASSINFO("D-Bus Interface", "org.kde.fakemodem.Modem.Location") 0020 public: 0021 explicit ModemLocation(QObject *parent = nullptr); 0022 ~ModemLocation() override; 0023 0024 Q_PROPERTY(uint Capabilities READ capabilities) 0025 Q_PROPERTY(uint Enabled READ enabled) 0026 Q_PROPERTY(ModemManager::LocationInformationMap Location READ location) 0027 Q_PROPERTY(bool SignalsLocation READ signalsLocation) 0028 0029 uint capabilities() const; 0030 uint enabled() const; 0031 ModemManager::LocationInformationMap location() const; 0032 bool signalsLocation() const; 0033 0034 /* Not part of dbus interface */ 0035 void setModemPath(const QString &path); 0036 void setEnableNotifications(bool enable); 0037 void setCapabilities(uint capabilities); 0038 void setEnabled(uint enabled); 0039 void setLocation(const ModemManager::LocationInformationMap &location); 0040 void setSignalsLocation(bool signalsLocation); 0041 0042 QVariantMap toMap() const; 0043 0044 public Q_SLOTS: 0045 Q_SCRIPTABLE ModemManager::LocationInformationMap GetLocation(); 0046 Q_SCRIPTABLE void Setup(uint sources, bool signal_location); 0047 0048 private: 0049 QString m_modemPath; 0050 bool m_enabledNotifications; 0051 uint m_capabilities; 0052 uint m_enabled; 0053 ModemManager::LocationInformationMap m_location; 0054 bool m_signalsLocation; 0055 }; 0056 0057 #endif