Changeset View
Changeset View
Standalone View
Standalone View
src/dnsconfiguration.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright 2018 Aleksander Morgado <aleksander@aleksander.es> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Lesser General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | later version accepted by the membership of KDE e.V. (or its | ||||
9 | successor approved by the membership of KDE e.V.), which shall | ||||
10 | act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | | ||||
12 | This library is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | Lesser General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU Lesser General Public | ||||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | */ | ||||
20 | | ||||
21 | #ifndef NETWORKMANAGERQT_DNSCONFIGURATION_H | ||||
22 | #define NETWORKMANAGERQT_DNSCONFIGURATION_H | ||||
23 | | ||||
24 | #include <networkmanagerqt/networkmanagerqt_export.h> | ||||
25 | #include "dnsdomain.h" | ||||
26 | | ||||
27 | // To prevent signals in glib2 be defined by QT | ||||
28 | #undef signals | ||||
29 | #include <nm-version.h> | ||||
30 | #if NM_CHECK_VERSION(1, 0, 0) | ||||
31 | #include <libnm/NetworkManager.h> | ||||
32 | #else | ||||
33 | #include <NetworkManager.h> | ||||
34 | #endif | ||||
35 | #define signals Q_SIGNALS | ||||
36 | | ||||
37 | #include <QtCore/QStringList> | ||||
38 | #include <QNetworkAddressEntry> | ||||
39 | | ||||
40 | namespace NetworkManager | ||||
41 | { | ||||
42 | | ||||
43 | /** | ||||
44 | * This class represents IP configuration | ||||
45 | */ | ||||
46 | class NETWORKMANAGERQT_EXPORT DnsConfiguration | ||||
47 | { | ||||
48 | public: | ||||
49 | | ||||
50 | /** | ||||
51 | * Constructs an initialized DnsConfiguration object | ||||
52 | */ | ||||
53 | DnsConfiguration(const QStringList &searches, | ||||
54 | const QStringList &options, | ||||
55 | const QList<DnsDomain> domains); | ||||
56 | | ||||
57 | /** | ||||
58 | * Constructs an empty DnsConfiguration object | ||||
59 | */ | ||||
60 | DnsConfiguration(); | ||||
61 | | ||||
62 | /** | ||||
63 | * Destroys this DnsConfiguration object. | ||||
64 | */ | ||||
65 | ~DnsConfiguration(); | ||||
66 | | ||||
67 | /** | ||||
68 | * Constructs a DnsConfiguration object that is a copy of the object @p other. | ||||
69 | */ | ||||
70 | DnsConfiguration(const DnsConfiguration &other); | ||||
71 | | ||||
72 | /** | ||||
73 | * Returns the list of search domains | ||||
74 | */ | ||||
75 | QStringList searches() const; | ||||
76 | | ||||
77 | /** | ||||
78 | * Sets the list of search domains | ||||
79 | */ | ||||
80 | void setSearches(const QStringList &list); | ||||
81 | | ||||
82 | /** | ||||
83 | * Returns the list of resolver options | ||||
84 | */ | ||||
85 | QStringList options() const; | ||||
86 | | ||||
87 | /** | ||||
88 | * Sets the list of resolver options | ||||
89 | */ | ||||
90 | void setOptions(const QStringList &list); | ||||
91 | | ||||
92 | /** | ||||
93 | * Returns the list of domains | ||||
94 | */ | ||||
95 | QList<DnsDomain> domains() const; | ||||
96 | | ||||
97 | /** | ||||
98 | * Sets the list of domains | ||||
99 | */ | ||||
100 | void setDomains(const QList<DnsDomain> &domains); | ||||
101 | | ||||
102 | /** | ||||
103 | * Marshall into a map | ||||
104 | */ | ||||
105 | QVariantMap toMap() const; | ||||
106 | | ||||
107 | /** | ||||
108 | * De-marshall from a map | ||||
109 | */ | ||||
110 | void fromMap (const QVariantMap &map); | ||||
111 | | ||||
112 | /** | ||||
113 | * Makes a copy of the DnsConfiguration object @p other. | ||||
114 | */ | ||||
115 | DnsConfiguration &operator=(const DnsConfiguration &other); | ||||
116 | | ||||
117 | private: | ||||
118 | class Private; | ||||
119 | Private *const d; | ||||
120 | }; | ||||
121 | | ||||
122 | } // namespace NetworkManager | ||||
123 | | ||||
124 | #endif // NETWORKMANAGERQT_DNSCONFIGURATION_H |