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 | |
21 | namespace NetworkManager |
22 | { |
23 | /** |
24 | * This class represents IP configuration |
25 | */ |
26 | class NETWORKMANAGERQT_EXPORT DnsConfiguration |
27 | { |
28 | public: |
29 | /** |
30 | * Constructs an initialized DnsConfiguration object |
31 | */ |
32 | DnsConfiguration(const QStringList &searches, const QStringList &options, const QList<DnsDomain> domains); |
33 | |
34 | /** |
35 | * Constructs an empty DnsConfiguration object |
36 | */ |
37 | DnsConfiguration(); |
38 | |
39 | /** |
40 | * Destroys this DnsConfiguration object. |
41 | */ |
42 | ~DnsConfiguration(); |
43 | |
44 | /** |
45 | * Constructs a DnsConfiguration object that is a copy of the object @p other. |
46 | */ |
47 | DnsConfiguration(const DnsConfiguration &other); |
48 | |
49 | /** |
50 | * Returns the list of search domains |
51 | */ |
52 | QStringList searches() const; |
53 | |
54 | /** |
55 | * Sets the list of search domains |
56 | */ |
57 | void setSearches(const QStringList &list); |
58 | |
59 | /** |
60 | * Returns the list of resolver options |
61 | */ |
62 | QStringList options() const; |
63 | |
64 | /** |
65 | * Sets the list of resolver options |
66 | */ |
67 | void setOptions(const QStringList &list); |
68 | |
69 | /** |
70 | * Returns the list of domains |
71 | */ |
72 | QList<DnsDomain> domains() const; |
73 | |
74 | /** |
75 | * Sets the list of domains |
76 | */ |
77 | void setDomains(const QList<DnsDomain> &domains); |
78 | |
79 | /** |
80 | * Marshall into a map |
81 | */ |
82 | QVariantMap toMap() const; |
83 | |
84 | /** |
85 | * De-marshall from a map |
86 | */ |
87 | void fromMap(const QVariantMap &map); |
88 | |
89 | /** |
90 | * Makes a copy of the DnsConfiguration object @p other. |
91 | */ |
92 | DnsConfiguration &operator=(const DnsConfiguration &other); |
93 | |
94 | private: |
95 | class Private; |
96 | Private *const d; |
97 | }; |
98 | |
99 | } // namespace NetworkManager |
100 | |
101 | #endif // NETWORKMANAGERQT_DNSCONFIGURATION_H |
102 | |