File indexing completed on 2024-12-01 06:49:21

0001 /*
0002     SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org>
0003     SPDX-FileCopyrightText: 2013 Daniel Nicoletti <dantti12@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef NETWORKMANAGERQT_IPADDRESS_H
0009 #define NETWORKMANAGERQT_IPADDRESS_H
0010 
0011 #include <networkmanagerqt/networkmanagerqt_export.h>
0012 
0013 #include <QNetworkAddressEntry>
0014 
0015 namespace NetworkManager
0016 {
0017 /**
0018  * This class represents IP address
0019  */
0020 class NETWORKMANAGERQT_EXPORT IpAddress : public QNetworkAddressEntry
0021 {
0022 public:
0023     /**
0024      * Constructs an empty IpAddress object.
0025      */
0026     IpAddress();
0027 
0028     /**
0029      * Constructs an IpAddress object that is a copy of the object other.
0030      */
0031     IpAddress(const IpAddress &other);
0032 
0033     /**
0034      * Destroys this IpAddress object.
0035      */
0036     ~IpAddress();
0037 
0038     /**
0039      * Return if the IP address is defined.
0040      */
0041     bool isValid() const;
0042 
0043     /**
0044      * Defines the default @p gateway of this object.
0045      */
0046     void setGateway(const QHostAddress &gateway);
0047 
0048     /**
0049      * Returns the default gateway of this object.
0050      */
0051     QHostAddress gateway() const;
0052 
0053     /**
0054      * Makes a copy of the IpAddress object @p other.
0055      */
0056     IpAddress &operator=(const IpAddress &other);
0057 
0058 private:
0059     class Private;
0060     Private *const d;
0061 };
0062 typedef QList<IpAddress> IpAddresses;
0063 
0064 } // namespace NetworkManager
0065 
0066 #endif // NETWORKMANAGERQT_IPADDRESS_H