1/*
2 SPDX-FileCopyrightText: 2018 Aleksander Morgado <aleksander@aleksander.es>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef NETWORKMANAGERQT_DNSCONFIGURATION_H
8#define NETWORKMANAGERQT_DNSCONFIGURATION_H
9
10#include "dnsdomain.h"
11#include <networkmanagerqt/networkmanagerqt_export.h>
12
13// To prevent signals in glib2 be defined by QT
14#undef signals
15#include <libnm/NetworkManager.h>
16#include <nm-version.h>
17#define signals Q_SIGNALS
18
19#include <QStringList>
20
21namespace NetworkManager
22{
23/*!
24 * \class NetworkManager::DnsConfiguration
25 * \inheaderfile NetworkManagerQt/DnsConfiguration
26 * \inmodule NetworkManagerQt
27 *
28 * \brief This class represents IP configuration.
29 */
30class NETWORKMANAGERQT_EXPORT DnsConfiguration
31{
32public:
33 /*!
34 * Constructs an initialized DnsConfiguration object
35 */
36 DnsConfiguration(const QStringList &searches, const QStringList &options, const QList<DnsDomain> domains);
37
38 /*!
39 * Constructs an empty DnsConfiguration object
40 */
41 DnsConfiguration();
42
43 /*!
44 * Destroys this DnsConfiguration object.
45 */
46 ~DnsConfiguration();
47
48 /*!
49 * Constructs a DnsConfiguration object that is a copy of the object \a other.
50 */
51 DnsConfiguration(const DnsConfiguration &other);
52
53 /*!
54 * Returns the list of search domains
55 */
56 QStringList searches() const;
57
58 /*!
59 * Sets the list of search domains
60 */
61 void setSearches(const QStringList &list);
62
63 /*!
64 * Returns the list of resolver options
65 */
66 QStringList options() const;
67
68 /*!
69 * Sets the list of resolver options
70 */
71 void setOptions(const QStringList &list);
72
73 /*!
74 * Returns the list of domains
75 */
76 QList<DnsDomain> domains() const;
77
78 /*!
79 * Sets the list of domains
80 */
81 void setDomains(const QList<DnsDomain> &domains);
82
83 /*!
84 * Marshall into a map
85 */
86 QVariantMap toMap() const;
87
88 /*!
89 * De-marshall from a map
90 */
91 void fromMap(const QVariantMap &map);
92
93 /*!
94 * Makes a copy of the DnsConfiguration object \a other.
95 */
96 DnsConfiguration &operator=(const DnsConfiguration &other);
97
98private:
99 class Private;
100 Private *const d;
101};
102
103} // namespace NetworkManager
104
105#endif // NETWORKMANAGERQT_DNSCONFIGURATION_H
106

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