ModemManagerQt

generictypes.h
1/*
2 SPDX-FileCopyrightText: 2010 Lamarque Souza <lamarque@kde.org>
3 SPDX-FileCopyrightText: 2013 Lukas Tinkl <ltinkl@redhat.com>
4 SPDX-FileCopyrightText: 2013-2015 Jan Grulich <jgrulich@redhat.com>
5
6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7*/
8
9#ifndef MODEMMANAGERQT_GENERIC_TYPES_H
10#define MODEMMANAGERQT_GENERIC_TYPES_H
11
12#include <ModemManager/ModemManager.h>
13#include <modemmanagerqt_export.h>
14
15#include <QDBusArgument>
16#include <QDBusObjectPath>
17#include <QMetaType>
18
19// Enums from ModemManager-enums.h which needs to be defined all the time,
20// because it's not possible to use MM_CHECK_VERSION for signals
21#if !MM_CHECK_VERSION(1, 2, 0)
22typedef enum { /*< underscore_name=mm_modem_3gpp_subscription_state >*/
23 MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN = 0,
24 MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNPROVISIONED = 1,
25 MM_MODEM_3GPP_SUBSCRIPTION_STATE_PROVISIONED = 2,
26 MM_MODEM_3GPP_SUBSCRIPTION_STATE_OUT_OF_DATA = 3,
27} MMModem3gppSubscriptionState;
28
29typedef enum { /*< underscore_name=mm_sms_cdma_service_category >*/
30 MM_SMS_CDMA_SERVICE_CATEGORY_UNKNOWN = 0x0000,
31 MM_SMS_CDMA_SERVICE_CATEGORY_EMERGENCY_BROADCAST = 0x0001,
32 MM_SMS_CDMA_SERVICE_CATEGORY_ADMINISTRATIVE = 0x0002,
33 MM_SMS_CDMA_SERVICE_CATEGORY_MAINTENANCE = 0x0003,
34 MM_SMS_CDMA_SERVICE_CATEGORY_GENERAL_NEWS_LOCAL = 0x0004,
35 MM_SMS_CDMA_SERVICE_CATEGORY_GENERAL_NEWS_REGIONAL = 0x0005,
36 MM_SMS_CDMA_SERVICE_CATEGORY_GENERAL_NEWS_NATIONAL = 0x0006,
37 MM_SMS_CDMA_SERVICE_CATEGORY_GENERAL_NEWS_INTERNATIONAL = 0x0007,
38 MM_SMS_CDMA_SERVICE_CATEGORY_BUSINESS_NEWS_LOCAL = 0x0008,
39 MM_SMS_CDMA_SERVICE_CATEGORY_BUSINESS_NEWS_REGIONAL = 0x0009,
40 MM_SMS_CDMA_SERVICE_CATEGORY_BUSINESS_NEWS_NATIONAL = 0x000A,
41 MM_SMS_CDMA_SERVICE_CATEGORY_BUSINESS_NEWS_INTERNATIONAL = 0x000B,
42 MM_SMS_CDMA_SERVICE_CATEGORY_SPORTS_NEWS_LOCAL = 0x000C,
43 MM_SMS_CDMA_SERVICE_CATEGORY_SPORTS_NEWS_REGIONAL = 0x000D,
44 MM_SMS_CDMA_SERVICE_CATEGORY_SPORTS_NEWS_NATIONAL = 0x000E,
45 MM_SMS_CDMA_SERVICE_CATEGORY_SPORTS_NEWS_INTERNATIONAL = 0x000F,
46 MM_SMS_CDMA_SERVICE_CATEGORY_ENTERTAINMENT_NEWS_LOCAL = 0x0010,
47 MM_SMS_CDMA_SERVICE_CATEGORY_ENTERTAINMENT_NEWS_REGIONAL = 0x0011,
48 MM_SMS_CDMA_SERVICE_CATEGORY_ENTERTAINMENT_NEWS_NATIONAL = 0x0012,
49 MM_SMS_CDMA_SERVICE_CATEGORY_ENTERTAINMENT_NEWS_INTERNATIONAL = 0x0013,
50 MM_SMS_CDMA_SERVICE_CATEGORY_LOCAL_WEATHER = 0x0014,
51 MM_SMS_CDMA_SERVICE_CATEGORY_TRAFFIC_REPORT = 0x0015,
52 MM_SMS_CDMA_SERVICE_CATEGORY_FLIGHT_SCHEDULES = 0x0016,
53 MM_SMS_CDMA_SERVICE_CATEGORY_RESTAURANTS = 0x0017,
54 MM_SMS_CDMA_SERVICE_CATEGORY_LODGINGS = 0x0018,
55 MM_SMS_CDMA_SERVICE_CATEGORY_RETAIL_DIRECTORY = 0x0019,
56 MM_SMS_CDMA_SERVICE_CATEGORY_ADVERTISEMENTS = 0x001A,
57 MM_SMS_CDMA_SERVICE_CATEGORY_STOCK_QUOTES = 0x001B,
58 MM_SMS_CDMA_SERVICE_CATEGORY_EMPLOYMENT = 0x001C,
59 MM_SMS_CDMA_SERVICE_CATEGORY_HOSPITALS = 0x001D,
60 MM_SMS_CDMA_SERVICE_CATEGORY_TECHNOLOGY_NEWS = 0x001E,
61 MM_SMS_CDMA_SERVICE_CATEGORY_MULTICATEGORY = 0x001F,
62 MM_SMS_CDMA_SERVICE_CATEGORY_CMAS_PRESIDENTIAL_ALERT = 0x1000,
63 MM_SMS_CDMA_SERVICE_CATEGORY_CMAS_EXTREME_THREAT = 0x1001,
64 MM_SMS_CDMA_SERVICE_CATEGORY_CMAS_SEVERE_THREAT = 0x1002,
65 MM_SMS_CDMA_SERVICE_CATEGORY_CMAS_CHILD_ABDUCTION_EMERGENCY = 0x1003,
66 MM_SMS_CDMA_SERVICE_CATEGORY_CMAS_TEST = 0x1004,
67} MMSmsCdmaServiceCategory;
68
69typedef enum { /*< underscore_name=mm_sms_cdma_teleservice_id >*/
70 MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN = 0x0000,
71 MM_SMS_CDMA_TELESERVICE_ID_CMT91 = 0x1000,
72 MM_SMS_CDMA_TELESERVICE_ID_WPT = 0x1001,
73 MM_SMS_CDMA_TELESERVICE_ID_WMT = 0x1002,
74 MM_SMS_CDMA_TELESERVICE_ID_VMN = 0x1003,
75 MM_SMS_CDMA_TELESERVICE_ID_WAP = 0x1004,
76 MM_SMS_CDMA_TELESERVICE_ID_WEMT = 0x1005,
77 MM_SMS_CDMA_TELESERVICE_ID_SCPT = 0x1006,
78 MM_SMS_CDMA_TELESERVICE_ID_CATPT = 0x1007,
79} MMSmsCdmaTeleserviceId;
80#endif
81
82namespace ModemManager
83{
84typedef QMap<QString, QVariantMap> MMVariantMapMap;
85typedef QMap<QDBusObjectPath, MMVariantMapMap> DBUSManagerStruct;
86typedef QList<uint> UIntList;
87typedef QList<QList<uint>> UIntListList;
88
89typedef struct {
91 MMModemPortType type;
92} Port;
93typedef QList<Port> PortList;
94
95typedef struct {
96 uint signal;
97 bool recent;
98} SignalQualityPair;
99
100typedef struct {
101 uint allowed; // bitfield
102 MMModemMode preferred;
103} CurrentModesType;
104typedef QList<CurrentModesType> SupportedModesType;
105
106#if MM_CHECK_VERSION(1, 2, 0)
107typedef struct {
108 MMOmaSessionType type;
109 uint id;
110} OmaSessionType;
111typedef QList<OmaSessionType> OmaSessionTypes;
112#endif
113typedef QMap<MMModemLock, uint> UnlockRetriesMap;
114typedef QList<QVariantMap> QVariantMapList;
115typedef QMap<MMModemLocationSource, QVariant> LocationInformationMap;
116typedef struct {
117 MMSmsValidityType validity;
118 uint value;
119} ValidityPair;
120}
121
122// Flags
123Q_DECLARE_METATYPE(QFlags<MMModemAccessTechnology>)
124Q_DECLARE_METATYPE(QFlags<MMModemCapability>)
125Q_DECLARE_METATYPE(QFlags<MMModemMode>)
126Q_DECLARE_METATYPE(QFlags<MMBearerIpFamily>)
127Q_DECLARE_METATYPE(QFlags<MMModem3gppFacility>)
128Q_DECLARE_METATYPE(QFlags<MMModemLocationSource>)
129#if MM_CHECK_VERSION(1, 2, 0)
130Q_DECLARE_METATYPE(QFlags<MMOmaFeature>)
131#endif
132
133// ModemManager enums
134Q_DECLARE_METATYPE(QList<MMModemBand>)
135Q_DECLARE_METATYPE(QList<MMModemCapability>)
136Q_DECLARE_METATYPE(MMModemLock)
137Q_DECLARE_METATYPE(MMModemPowerState)
138Q_DECLARE_METATYPE(MMModemState)
139Q_DECLARE_METATYPE(MMModemStateChangeReason)
140Q_DECLARE_METATYPE(MMModemStateFailedReason)
141Q_DECLARE_METATYPE(MMModem3gppRegistrationState)
142#if MM_CHECK_VERSION(1, 2, 0)
143Q_DECLARE_METATYPE(MMModem3gppSubscriptionState)
144#endif
145Q_DECLARE_METATYPE(MMModem3gppUssdSessionState)
146Q_DECLARE_METATYPE(MMModemCdmaActivationState)
147Q_DECLARE_METATYPE(MMCdmaActivationError)
148Q_DECLARE_METATYPE(MMModemCdmaRegistrationState)
149Q_DECLARE_METATYPE(MMModemLocationSource)
150#if MM_CHECK_VERSION(1, 2, 0)
151Q_DECLARE_METATYPE(MMOmaSessionType)
152Q_DECLARE_METATYPE(MMOmaSessionState)
153Q_DECLARE_METATYPE(MMOmaSessionStateFailedReason)
154#endif
155Q_DECLARE_METATYPE(MMSmsDeliveryState)
156Q_DECLARE_METATYPE(MMSmsPduType)
157Q_DECLARE_METATYPE(MMSmsState)
158Q_DECLARE_METATYPE(MMSmsStorage)
159#if MM_CHECK_VERSION(1, 2, 0)
160Q_DECLARE_METATYPE(MMSmsCdmaServiceCategory)
161Q_DECLARE_METATYPE(MMSmsCdmaTeleserviceId)
162#endif
163#if MM_CHECK_VERSION(1, 6, 0)
164Q_DECLARE_METATYPE(MMCallState)
165Q_DECLARE_METATYPE(MMCallStateReason)
166Q_DECLARE_METATYPE(MMCallDirection)
167#endif
168#if MM_CHECK_VERSION(1, 20, 0)
169Q_DECLARE_METATYPE(MMSimType)
170Q_DECLARE_METATYPE(MMSimEsimStatus)
171Q_DECLARE_METATYPE(MMSimRemovability)
172#endif
173
174// Others
175Q_DECLARE_METATYPE(ModemManager::DBUSManagerStruct)
176Q_DECLARE_METATYPE(ModemManager::Port)
177Q_DECLARE_METATYPE(ModemManager::PortList)
178Q_DECLARE_METATYPE(ModemManager::SignalQualityPair)
179Q_DECLARE_METATYPE(ModemManager::CurrentModesType)
180Q_DECLARE_METATYPE(ModemManager::SupportedModesType)
181#if MM_CHECK_VERSION(1, 2, 0)
182Q_DECLARE_METATYPE(ModemManager::OmaSessionType)
183Q_DECLARE_METATYPE(ModemManager::OmaSessionTypes)
184#endif
185Q_DECLARE_METATYPE(ModemManager::UnlockRetriesMap)
186Q_DECLARE_METATYPE(ModemManager::LocationInformationMap)
187Q_DECLARE_METATYPE(ModemManager::ValidityPair)
188
189// Port
190MODEMMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &arg, const ModemManager::Port &port);
191MODEMMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &arg, ModemManager::Port &port);
192
193// CurrentModesType
194MODEMMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &arg, const ModemManager::CurrentModesType &mode);
195MODEMMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &arg, ModemManager::CurrentModesType &mode);
196
197// SignalQualityPair
198MODEMMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &arg, const ModemManager::SignalQualityPair &sqp);
199MODEMMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &arg, ModemManager::SignalQualityPair &sqp);
200
201// ValidityPair
202MODEMMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &arg, const ModemManager::ValidityPair &vp);
203MODEMMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &arg, ModemManager::ValidityPair &vp);
204
205#if MM_CHECK_VERSION(1, 2, 0)
206// OmaSessionType
207MODEMMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &arg, const ModemManager::OmaSessionType &sessionType);
208MODEMMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &arg, ModemManager::OmaSessionType &sessionType);
209#endif
210
211// UnlockRetriesMap
212MODEMMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const ModemManager::UnlockRetriesMap &unlockRetriesMap);
213MODEMMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, ModemManager::UnlockRetriesMap &unlockRetriesMap);
214
215// QVariantMapList
216MODEMMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const ModemManager::QVariantMapList &variantMapList);
217MODEMMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, ModemManager::QVariantMapList &variantMapList);
218
219// LocationInformationMap
220MODEMMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const ModemManager::LocationInformationMap &locationMap);
221MODEMMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, ModemManager::LocationInformationMap &locationMap);
222
223MODEMMANAGERQT_EXPORT void registerModemManagerTypes();
224
225#endif // MODEMMANAGERQT_GENERIC_TYPES_P_H
Type type(const QSqlDatabase &db)
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
QDebug operator<<(QDebug dbg, const DcrawInfoContainer &c)
QString name(StandardAction id)
This namespace allows to query the underlying system to discover the available modem interfaces respo...
Definition bearer.cpp:20
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.