~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*  This file is part of the KDE project
    Copyright (C) 2006 Will Stephenson <wstephenson@kde.org>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License version 2 as published by the Free Software Foundation.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.

*/

#ifndef SOLID_CONTROL_IFACES_NETWORKINTERFACE_H
#define SOLID_CONTROL_IFACES_NETWORKINTERFACE_H

#include "../solid_control_export.h"
#include "../networkinterface.h"
#include <QtCore/QObject>
#include <QtCore/QList>

namespace Solid
{
namespace Control
{
namespace Ifaces
{
    /**
     * Represents a generic network interface as seen by the networking subsystem.
     *
     * For specialized interfaces @see Solid::Control::Ifaces::WiredNetworkInterface and @see
     * Solid::Control::Ifaces::WirelessNetworkInterface
     */
    class SOLIDCONTROLIFACES_EXPORT NetworkInterface
    {
    public:
        /**
         * Destroys a NetworkInterface object.
         */
        virtual ~NetworkInterface();

        /**
         * Retrieves the Unique Network Identifier (UNI) of the Network.
         * This identifier is unique for each network and network interface in the system.
         *
         * @returns the Unique Network Identifier of the current network
         */
        virtual QString uni() const = 0;
        /**
         * Retrieves the Unique Device Identifier (UDI).
         * This is needed for ModemManager support.
         *
         * @returns the Unique Device Identifier of the current device
         */
        virtual QString udi() const = 0;
        /**
         * The system name for the network interface
         */
        virtual QString interfaceName() const = 0;

        /**
         * The name of the device's data interface when available. This property
         * may not refer to the actual data interface until the device has
         * successfully established a data connection, indicated by the device's
         * State becoming ACTIVATED.
         */
        virtual QString ipInterfaceName() const = 0;

        /**
         * If TRUE, indicates the device is likely missing firmware necessary for
         * its operation.
         */
        virtual bool firmwareMissing() const = 0;

        /**
         * Handle for the system driver controlling this network interface
         */
        virtual QString driver() const = 0;

        /**
         * Disconnects a device and prevents the device from automatically
         * activating further connections without user intervention.
         */
        virtual void disconnectInterface() = 0;

        /**
         * Access the network configuration for this object
         */
        virtual Solid::Control::IPv4Config ipV4Config() const = 0;

        /**
         * Retrieves the activation status of this network interface.
         *
         * @return true if this network interface is active, false otherwise
         */
        virtual bool isActive() const = 0;

        /**
         * Retrieves the current state of the network connection held by this device.
         * It's a high level view of the connection. It's user oriented so technically
         * it provides states coming from different layers.
         *
         * @return the current connection state
         * @see Solid::Control::NetworkInterface::ConnectionState
         */
        virtual Solid::Control::NetworkInterface::ConnectionState connectionState() const = 0;
        /**
         * Retrieves the maximum speed as reported by the device. Note that it's a design
         * related information and that the device might not reach this maximum.
         *
         * @return the device maximum speed
         */
        virtual int designSpeed() const = 0;

        /**
         * Retrieves the capabilities supported by this device.
         *
         * @return the capabilities of the device
         * @see Solid::Control::NetworkInterface::Capabilities
         */
        virtual Solid::Control::NetworkInterface::Capabilities capabilities() const = 0;

    protected:
    //Q_SIGNALS:
        /**
         * This signal is emitted when the settings of this network have changed.
         */
        virtual void ipDetailsChanged() = 0;

        /**
         * This signal is emitted when the device's connection state changed.
         * For example, if the device was disconnected and started to activate
         *
         * @param state the new state of the connection
         * @see Solid::Control::NetworkInterface::ConnectionState
         */
        virtual void connectionStateChanged(int state) = 0;

        /**
         * This signal is emitted when the device's link status changed.
         * 
         * @param new_state the new state of the connection
         * @param old_state the previous state of the connection
         * @param reason the reason for the state change, if any.  ReasonNone where the backend
         * provides no reason.
         * @see Solid::Control::NetworkInterface::ConnectionState
         */
        virtual void connectionStateChanged(int new_state, int old_state, int reason ) = 0;

    };
} //Ifaces
} //Control
} //Solid

Q_DECLARE_INTERFACE(Solid::Control::Ifaces::NetworkInterface, "org.kde.Solid.Control.Ifaces.NetworkInterface/0.1")

#endif