1 /* This file is part of the KDE project
2 Copyright (C) 2006 Will Stephenson <wstephenson@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
20 #ifndef SOLID_IFACES_NETWORK_H
21 #define SOLID_IFACES_NETWORK_H
23 #include <solid/control/solid_control_export.h>
25 #include <QtCore/QObject>
26 #include <QtCore/QList>
27 #include <QtNetwork/QNetworkAddressEntry>
36 * This interface represents a generic Internet Protocol (IP) network which we may be connected to.
38 class SOLIDCONTROLIFACES_EXPORT Network
42 * Destroys a Network object.
47 * Retrieves the Unique Network Identifier (UNI) of the Network.
48 * This identifier is unique for each network and network interface in the system.
50 * @returns the Unique Network Identifier of the current network
52 virtual QString
uni() const = 0;
55 * Retrieves the addresses the device has on this network.
57 * @return the list of addresses
59 virtual QList
<QNetworkAddressEntry
> addressEntries() const = 0;
62 * Retrieves the route we must follow when using this network. It's
63 * in particular used for VPN.
65 * @return the route address is available, QString() otherwise
67 virtual QString
route() const = 0;
70 * Retrieves the list of DNS servers to use on this network.
72 * @return the dns servers
74 virtual QList
<QHostAddress
> dnsServers() const = 0;
77 * Retrieves the activation status of this network. For ethernets, this will always be true.
79 * @return true if this network is active, false otherwise
81 virtual bool isActive() const = 0;
84 * Activates or deactivates this network. For ethernets, this has no effect.
86 * @param activated true to activate this network, false otherwise
88 virtual void setActivated(bool activated
) = 0;
93 * This signal is emitted when the settings of this network have changed.
95 virtual void ipDetailsChanged() = 0;
98 * This signal is emitted when the activation state of this network
101 * @param activated true if the network is activated, false otherwise
103 virtual void activationStateChanged(bool activated
) = 0;
109 Q_DECLARE_INTERFACE(Solid::Control::Ifaces::Network
, "org.kde.Solid.Control.Ifaces.Network/0.1")