File indexing completed on 2025-03-16 12:58:24
0001 /* 0002 SPDX-FileCopyrightText: 2018 Aleksander Morgado <aleksander@aleksander.es> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #ifndef NETWORKMANAGERQT_DNSCONFIGURATION_H 0008 #define NETWORKMANAGERQT_DNSCONFIGURATION_H 0009 0010 #include "dnsdomain.h" 0011 #include <networkmanagerqt/networkmanagerqt_export.h> 0012 0013 // To prevent signals in glib2 be defined by QT 0014 #undef signals 0015 #include <libnm/NetworkManager.h> 0016 #include <nm-version.h> 0017 #define signals Q_SIGNALS 0018 0019 #include <QStringList> 0020 0021 namespace NetworkManager 0022 { 0023 /** 0024 * This class represents IP configuration 0025 */ 0026 class NETWORKMANAGERQT_EXPORT DnsConfiguration 0027 { 0028 public: 0029 /** 0030 * Constructs an initialized DnsConfiguration object 0031 */ 0032 DnsConfiguration(const QStringList &searches, const QStringList &options, const QList<DnsDomain> domains); 0033 0034 /** 0035 * Constructs an empty DnsConfiguration object 0036 */ 0037 DnsConfiguration(); 0038 0039 /** 0040 * Destroys this DnsConfiguration object. 0041 */ 0042 ~DnsConfiguration(); 0043 0044 /** 0045 * Constructs a DnsConfiguration object that is a copy of the object @p other. 0046 */ 0047 DnsConfiguration(const DnsConfiguration &other); 0048 0049 /** 0050 * Returns the list of search domains 0051 */ 0052 QStringList searches() const; 0053 0054 /** 0055 * Sets the list of search domains 0056 */ 0057 void setSearches(const QStringList &list); 0058 0059 /** 0060 * Returns the list of resolver options 0061 */ 0062 QStringList options() const; 0063 0064 /** 0065 * Sets the list of resolver options 0066 */ 0067 void setOptions(const QStringList &list); 0068 0069 /** 0070 * Returns the list of domains 0071 */ 0072 QList<DnsDomain> domains() const; 0073 0074 /** 0075 * Sets the list of domains 0076 */ 0077 void setDomains(const QList<DnsDomain> &domains); 0078 0079 /** 0080 * Marshall into a map 0081 */ 0082 QVariantMap toMap() const; 0083 0084 /** 0085 * De-marshall from a map 0086 */ 0087 void fromMap(const QVariantMap &map); 0088 0089 /** 0090 * Makes a copy of the DnsConfiguration object @p other. 0091 */ 0092 DnsConfiguration &operator=(const DnsConfiguration &other); 0093 0094 private: 0095 class Private; 0096 Private *const d; 0097 }; 0098 0099 } // namespace NetworkManager 0100 0101 #endif // NETWORKMANAGERQT_DNSCONFIGURATION_H