| 1 | /* |
| 2 | This file is part of the KDE project |
| 3 | SPDX-FileCopyrightText: 2008 Will Stephenson <[email protected]> |
| 4 | SPDX-FileCopyrightText: 2013 Jan Grulich <[email protected]> |
| 5 | |
| 6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 | */ |
| 8 | |
| 9 | #ifndef GENERIC_TYPES_H |
| 10 | #define GENERIC_TYPES_H |
| 11 | |
| 12 | #include <networkmanagerqt/networkmanagerqt_export.h> |
| 13 | |
| 14 | #include <QDBusArgument> |
| 15 | #include <QVariantMap> |
| 16 | |
| 17 | typedef QList<QList<uint>> UIntListList; |
| 18 | Q_DECLARE_METATYPE(UIntListList) |
| 19 | |
| 20 | typedef QList<uint> UIntList; |
| 21 | Q_DECLARE_METATYPE(UIntList) |
| 22 | |
| 23 | typedef QMap<QString, QVariantMap> NMVariantMapMap; |
| 24 | Q_DECLARE_METATYPE(NMVariantMapMap) |
| 25 | |
| 26 | typedef QList<QVariantMap> NMVariantMapList; |
| 27 | Q_DECLARE_METATYPE(NMVariantMapList) |
| 28 | |
| 29 | typedef QMap<QString, QString> NMStringMap; |
| 30 | typedef QMapIterator<QString, QString> NMStringMapIterator; |
| 31 | Q_DECLARE_METATYPE(NMStringMap) |
| 32 | |
| 33 | NETWORKMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const NMStringMap &mydict); |
| 34 | NETWORKMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, NMStringMap &mydict); |
| 35 | |
| 36 | typedef struct { |
| 37 | QByteArray address; |
| 38 | uint prefix; |
| 39 | QByteArray gateway; |
| 40 | } IpV6DBusAddress; |
| 41 | |
| 42 | Q_DECLARE_METATYPE(IpV6DBusAddress) |
| 43 | typedef QList<IpV6DBusAddress> IpV6DBusAddressList; |
| 44 | Q_DECLARE_METATYPE(IpV6DBusAddressList) |
| 45 | |
| 46 | NETWORKMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const IpV6DBusAddress &address); |
| 47 | NETWORKMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, IpV6DBusAddress &address); |
| 48 | |
| 49 | typedef struct { |
| 50 | QByteArray destination; |
| 51 | uint prefix; |
| 52 | QByteArray nexthop; |
| 53 | uint metric; |
| 54 | } IpV6DBusRoute; |
| 55 | |
| 56 | Q_DECLARE_METATYPE(IpV6DBusRoute) |
| 57 | typedef QList<IpV6DBusRoute> IpV6DBusRouteList; |
| 58 | Q_DECLARE_METATYPE(IpV6DBusRouteList) |
| 59 | |
| 60 | NETWORKMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const IpV6DBusRoute &route); |
| 61 | NETWORKMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, IpV6DBusRoute &route); |
| 62 | |
| 63 | // ipv6 nameservers |
| 64 | typedef QList<QByteArray> IpV6DBusNameservers; |
| 65 | Q_DECLARE_METATYPE(IpV6DBusNameservers) |
| 66 | |
| 67 | typedef struct { |
| 68 | uint state; |
| 69 | uint reason; |
| 70 | } DeviceDBusStateReason; |
| 71 | Q_DECLARE_METATYPE(DeviceDBusStateReason) |
| 72 | |
| 73 | NETWORKMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const DeviceDBusStateReason &reason); |
| 74 | NETWORKMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, DeviceDBusStateReason &reason); |
| 75 | |
| 76 | #endif // GENERIC_TYPES_H |
| 77 | |