File indexing completed on 2023-09-24 08:11:40

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 2008 Will Stephenson <wstephenson@kde.org>
0004     SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef GENERIC_TYPES_H
0010 #define GENERIC_TYPES_H
0011 
0012 #include <networkmanagerqt/networkmanagerqt_export.h>
0013 
0014 #include <QDBusArgument>
0015 #include <QVariantMap>
0016 
0017 typedef QList<QList<uint>> UIntListList;
0018 Q_DECLARE_METATYPE(UIntListList)
0019 
0020 typedef QList<uint> UIntList;
0021 Q_DECLARE_METATYPE(UIntList)
0022 
0023 typedef QMap<QString, QVariantMap> NMVariantMapMap;
0024 Q_DECLARE_METATYPE(NMVariantMapMap)
0025 
0026 typedef QList<QVariantMap> NMVariantMapList;
0027 Q_DECLARE_METATYPE(NMVariantMapList)
0028 
0029 typedef QMap<QString, QString> NMStringMap;
0030 typedef QMapIterator<QString, QString> NMStringMapIterator;
0031 Q_DECLARE_METATYPE(NMStringMap)
0032 
0033 NETWORKMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const NMStringMap &mydict);
0034 NETWORKMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, NMStringMap &mydict);
0035 
0036 typedef struct {
0037     QByteArray address;
0038     uint prefix;
0039     QByteArray gateway;
0040 } IpV6DBusAddress;
0041 
0042 Q_DECLARE_METATYPE(IpV6DBusAddress)
0043 typedef QList<IpV6DBusAddress> IpV6DBusAddressList;
0044 Q_DECLARE_METATYPE(IpV6DBusAddressList)
0045 
0046 NETWORKMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const IpV6DBusAddress &address);
0047 NETWORKMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, IpV6DBusAddress &address);
0048 
0049 typedef struct {
0050     QByteArray destination;
0051     uint prefix;
0052     QByteArray nexthop;
0053     uint metric;
0054 } IpV6DBusRoute;
0055 
0056 Q_DECLARE_METATYPE(IpV6DBusRoute)
0057 typedef QList<IpV6DBusRoute> IpV6DBusRouteList;
0058 Q_DECLARE_METATYPE(IpV6DBusRouteList)
0059 
0060 NETWORKMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const IpV6DBusRoute &route);
0061 NETWORKMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, IpV6DBusRoute &route);
0062 
0063 // ipv6 nameservers
0064 typedef QList<QByteArray> IpV6DBusNameservers;
0065 Q_DECLARE_METATYPE(IpV6DBusNameservers)
0066 
0067 typedef struct {
0068     uint state;
0069     uint reason;
0070 } DeviceDBusStateReason;
0071 Q_DECLARE_METATYPE(DeviceDBusStateReason)
0072 
0073 NETWORKMANAGERQT_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const DeviceDBusStateReason &reason);
0074 NETWORKMANAGERQT_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, DeviceDBusStateReason &reason);
0075 
0076 #endif // GENERIC_TYPES_H