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_CONTROL_IFACES_NETWORKINTERFACE_H
21
#define SOLID_CONTROL_IFACES_NETWORKINTERFACE_H
23
#include "../solid_control_export.h"
24
#include "../networkinterface.h"
25
#include <QtCore/QObject>
26
#include <QtCore/QList>
35
* Represents a generic network interface as seen by the networking subsystem.
37
* For specialized interfaces @see Solid::Control::Ifaces::WiredNetworkInterface and @see
38
* Solid::Control::Ifaces::WirelessNetworkInterface
40
class SOLIDCONTROLIFACES_EXPORT NetworkInterface
44
* Destroys a NetworkInterface object.
46
virtual ~NetworkInterface();
49
* Retrieves the Unique Network Identifier (UNI) of the Network.
50
* This identifier is unique for each network and network interface in the system.
52
* @returns the Unique Network Identifier of the current network
54
virtual QString uni() const = 0;
56
* Retrieves the Unique Device Identifier (UDI).
57
* This is needed for ModemManager support.
59
* @returns the Unique Device Identifier of the current device
61
virtual QString udi() const = 0;
63
* The system name for the network interface
65
virtual QString interfaceName() const = 0;
68
* The name of the device's data interface when available. This property
69
* may not refer to the actual data interface until the device has
70
* successfully established a data connection, indicated by the device's
71
* State becoming ACTIVATED.
73
virtual QString ipInterfaceName() const = 0;
76
* If TRUE, indicates the device is likely missing firmware necessary for
79
virtual bool firmwareMissing() const = 0;
82
* Handle for the system driver controlling this network interface
84
virtual QString driver() const = 0;
87
* Disconnects a device and prevents the device from automatically
88
* activating further connections without user intervention.
90
virtual void disconnectInterface() = 0;
93
* Access the network configuration for this object
95
virtual Solid::Control::IPv4Config ipV4Config() const = 0;
98
* Retrieves the activation status of this network interface.
100
* @return true if this network interface is active, false otherwise
102
virtual bool isActive() const = 0;
105
* Retrieves the current state of the network connection held by this device.
106
* It's a high level view of the connection. It's user oriented so technically
107
* it provides states coming from different layers.
109
* @return the current connection state
110
* @see Solid::Control::NetworkInterface::ConnectionState
112
virtual Solid::Control::NetworkInterface::ConnectionState connectionState() const = 0;
114
* Retrieves the maximum speed as reported by the device. Note that it's a design
115
* related information and that the device might not reach this maximum.
117
* @return the device maximum speed
119
virtual int designSpeed() const = 0;
122
* Retrieves the capabilities supported by this device.
124
* @return the capabilities of the device
125
* @see Solid::Control::NetworkInterface::Capabilities
127
virtual Solid::Control::NetworkInterface::Capabilities capabilities() const = 0;
132
* This signal is emitted when the settings of this network have changed.
134
virtual void ipDetailsChanged() = 0;
137
* This signal is emitted when the device's connection state changed.
138
* For example, if the device was disconnected and started to activate
140
* @param state the new state of the connection
141
* @see Solid::Control::NetworkInterface::ConnectionState
143
virtual void connectionStateChanged(int state) = 0;
146
* This signal is emitted when the device's link status changed.
148
* @param new_state the new state of the connection
149
* @param old_state the previous state of the connection
150
* @param reason the reason for the state change, if any. ReasonNone where the backend
151
* provides no reason.
152
* @see Solid::Control::NetworkInterface::ConnectionState
154
virtual void connectionStateChanged(int new_state, int old_state, int reason ) = 0;
161
Q_DECLARE_INTERFACE(Solid::Control::Ifaces::NetworkInterface, "org.kde.Solid.Control.Ifaces.NetworkInterface/0.1")