ModemManagerQt

fakemodem/modem.h
1/*
2 SPDX-FileCopyrightText: 2015 Jan Grulich <jgrulich@redhat.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef MODEMMANAGERQT_FAKE_MODEM_MODEM_H
8#define MODEMMANAGERQT_FAKE_MODEM_MODEM_H
9
10#include "generictypes.h"
11
12#include <QObject>
13
14#include <QDBusObjectPath>
15
16class Modem : public QObject
17{
19 Q_CLASSINFO("D-Bus Interface", "org.kde.fakemodem.Modem")
20public:
21 explicit Modem(QObject *parent = nullptr);
22 ~Modem() override;
23
24 Q_PROPERTY(uint AccessTechnologies READ accessTechnologies)
25 Q_PROPERTY(QList<QDBusObjectPath> Bearers READ bearers)
26 Q_PROPERTY(ModemManager::UIntList CurrentBands READ currentBands)
27 Q_PROPERTY(uint CurrentCapabilities READ currentCapabilities)
28 Q_PROPERTY(ModemManager::CurrentModesType CurrentModes READ currentModes)
29 Q_PROPERTY(QString Device READ device)
30 Q_PROPERTY(QString DeviceIdentifier READ deviceIdentifier)
31 Q_PROPERTY(QStringList Drivers READ drivers)
32 Q_PROPERTY(QString EquipmentIdentifier READ equipmentIdentifier)
33 Q_PROPERTY(QString Manufacturer READ manufacturer)
34 Q_PROPERTY(uint MaxActiveBearers READ maxActiveBearers)
35 Q_PROPERTY(uint MaxBearers READ maxBearers)
36 Q_PROPERTY(QString Model READ model)
37 Q_PROPERTY(QStringList OwnNumbers READ ownNumbers)
38 Q_PROPERTY(QString Plugin READ plugin)
39 Q_PROPERTY(ModemManager::PortList Ports READ ports)
40 Q_PROPERTY(uint PowerState READ powerState)
41 Q_PROPERTY(QString PrimaryPort READ primaryPort)
42 Q_PROPERTY(QString Revision READ revision)
43 Q_PROPERTY(ModemManager::SignalQualityPair SignalQuality READ signalQuality)
44 Q_PROPERTY(QDBusObjectPath Sim READ sim)
45 Q_PROPERTY(int State READ state)
46 Q_PROPERTY(uint StateFailedReason READ stateFailedReason)
47 Q_PROPERTY(ModemManager::UIntList SupportedBands READ supportedBands)
48 Q_PROPERTY(ModemManager::UIntList SupportedCapabilities READ supportedCapabilities)
49 Q_PROPERTY(uint SupportedIpFamilies READ supportedIpFamilies)
50 Q_PROPERTY(ModemManager::SupportedModesType SupportedModes READ supportedModes)
51 Q_PROPERTY(uint UnlockRequired READ unlockRequired)
52 Q_PROPERTY(ModemManager::UnlockRetriesMap UnlockRetries READ unlockRetries)
53
54 uint accessTechnologies() const;
55 QList<QDBusObjectPath> bearers() const;
56 ModemManager::UIntList currentBands() const;
57 uint currentCapabilities() const;
58 ModemManager::CurrentModesType currentModes() const;
59 QString device() const;
60 QString deviceIdentifier() const;
61 QStringList drivers() const;
62 QString equipmentIdentifier() const;
63 QString manufacturer() const;
64 uint maxActiveBearers() const;
65 uint maxBearers() const;
66 QString model() const;
67 QStringList ownNumbers() const;
68 QString plugin() const;
69 ModemManager::PortList ports() const;
70 uint powerState() const;
71 QString primaryPort() const;
72 QString revision() const;
73 ModemManager::SignalQualityPair signalQuality() const;
74 QDBusObjectPath sim() const;
75 int state() const;
76 uint stateFailedReason() const;
77 ModemManager::UIntList supportedBands() const;
78 ModemManager::UIntList supportedCapabilities() const;
79 uint supportedIpFamilies() const;
80 ModemManager::SupportedModesType supportedModes() const;
81 uint unlockRequired() const;
82 ModemManager::UnlockRetriesMap unlockRetries() const;
83
84 /* Not part of DBus interface */
85 void addBearer(const QDBusObjectPath &bearer);
86 void removeBearer(const QDBusObjectPath &bearer);
87 QString modemPath() const;
88 void setEnableNotifications(bool enable);
89 void setAccessTechnologies(uint technologies);
90 void setDevice(const QString &device);
91 void setDeviceIdentifier(const QString &deviceIdentifier);
92 void setDrivers(const QStringList &drivers);
93 void setEquipmentIdentifier(const QString &identifier);
94 void setManufacturer(const QString &manufacturer);
95 void setMaxActiveBearers(uint bearers);
96 void setMaxBearers(uint bearers);
97 void setModemPath(const QString &path);
98 void setModel(const QString &model);
99 void setOwnNumbers(const QStringList &numbers);
100 void setPlugin(const QString &plugin);
101 void setPorts(const ModemManager::PortList &ports);
102 void setPrimaryPort(const QString &port);
103 void setRevision(const QString &revision);
104 void setSignalQuality(const ModemManager::SignalQualityPair &signalQuality);
105 void setSim(const QDBusObjectPath &sim);
106 void setState(int state);
107 void setStateFailedReason(uint reason);
108 void setSupportedBands(const ModemManager::UIntList &bands);
109 void setSupportedCapabilities(const ModemManager::UIntList &capabilities);
110 void setSupportedIpFamilies(uint families);
111 void setSupportedModes(const ModemManager::SupportedModesType &modes);
112 void setUnlockRequired(uint unlockRequired);
113 void setUnlockRetries(const ModemManager::UnlockRetriesMap &unlockRetries);
114
115 QVariantMap toMap() const;
116
117public Q_SLOTS:
118 Q_SCRIPTABLE QString Command(const QString &cmd, uint timeout);
119 Q_SCRIPTABLE QDBusObjectPath CreateBearer(const QVariantMap &properties);
120 Q_SCRIPTABLE void DeleteBearer(const QDBusObjectPath &bearer);
121 Q_SCRIPTABLE void Enable(bool enable);
122 Q_SCRIPTABLE void FactoryReset(const QString &code);
123 Q_SCRIPTABLE QList<QDBusObjectPath> ListBearers();
124 Q_SCRIPTABLE void Reset();
125 Q_SCRIPTABLE void SetCurrentBands(const QList<uint> &bands);
126 Q_SCRIPTABLE void SetCurrentCapabilities(uint capabilities);
127 Q_SCRIPTABLE void SetCurrentModes(ModemManager::CurrentModesType modes);
128 Q_SCRIPTABLE void SetPowerState(uint state);
129
131 Q_SCRIPTABLE void StateChanged(int oldState, int newState, uint reason);
132
133private:
134 uint m_accessTechnologies;
135 QList<QDBusObjectPath> m_bearers;
136 ModemManager::UIntList m_currentBands;
137 uint m_currentCapabilities;
138 ModemManager::CurrentModesType m_currentModes;
139 QString m_device;
140 QString m_deviceIdentifier;
141 QStringList m_drivers;
142 bool m_enabledNotifications;
143 QString m_equipmentIdentifier;
144 QString m_manufacturer;
145 uint m_maxActiveBearers;
146 uint m_maxBearers;
147 QString m_path;
148 QString m_model;
149 QStringList m_ownNumbers;
150 QString m_plugin;
151 ModemManager::PortList m_ports;
152 uint m_powerState;
153 QString m_primaryPort;
154 QString m_revision;
155 ModemManager::SignalQualityPair m_signalQuality;
156 QDBusObjectPath m_sim;
157 int m_state;
158 uint m_stateFailedReason;
159 ModemManager::UIntList m_supportedBands;
160 ModemManager::UIntList m_supportedCapabilities;
161 uint m_supportedIpFamilies;
162 ModemManager::SupportedModesType m_supportedModes;
163 uint m_unlockRequired;
164 ModemManager::UnlockRetriesMap m_unlockRetries;
165};
166
167#endif
This namespace allows to query the underlying system to discover the available modem interfaces respo...
Definition bearer.cpp:20
Q_CLASSINFO(Name, Value)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.