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

source code of networkmanager-qt/src/generictypes.h