1 | /* |
2 | SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org> |
3 | SPDX-FileCopyrightText: 2013 Daniel Nicoletti <dantti12@gmail.com> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
6 | */ |
7 | |
8 | #ifndef NETWORKMANAGERQT_IPADDRESS_H |
9 | #define NETWORKMANAGERQT_IPADDRESS_H |
10 | |
11 | #include <networkmanagerqt/networkmanagerqt_export.h> |
12 | |
13 | #include <QNetworkAddressEntry> |
14 | |
15 | namespace NetworkManager |
16 | { |
17 | /** |
18 | * This class represents IP address |
19 | */ |
20 | class NETWORKMANAGERQT_EXPORT IpAddress : public QNetworkAddressEntry |
21 | { |
22 | public: |
23 | /** |
24 | * Constructs an empty IpAddress object. |
25 | */ |
26 | IpAddress(); |
27 | |
28 | /** |
29 | * Constructs an IpAddress object that is a copy of the object other. |
30 | */ |
31 | IpAddress(const IpAddress &other); |
32 | |
33 | /** |
34 | * Destroys this IpAddress object. |
35 | */ |
36 | ~IpAddress(); |
37 | |
38 | /** |
39 | * Return if the IP address is defined. |
40 | */ |
41 | bool isValid() const; |
42 | |
43 | /** |
44 | * Defines the default @p gateway of this object. |
45 | */ |
46 | void setGateway(const QHostAddress &gateway); |
47 | |
48 | /** |
49 | * Returns the default gateway of this object. |
50 | */ |
51 | QHostAddress gateway() const; |
52 | |
53 | /** |
54 | * Makes a copy of the IpAddress object @p other. |
55 | */ |
56 | IpAddress &operator=(const IpAddress &other); |
57 | |
58 | private: |
59 | class Private; |
60 | Private *const d; |
61 | }; |
62 | typedef QList<IpAddress> IpAddresses; |
63 | |
64 | } // namespace NetworkManager |
65 | |
66 | #endif // NETWORKMANAGERQT_IPADDRESS_H |
67 | |