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

« back to all changes in this revision

Viewing changes to libs/solid/control/ifaces/networkinterface.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  This file is part of the KDE project
 
2
    Copyright (C) 2006 Will Stephenson <wstephenson@kde.org>
 
3
 
 
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.
 
7
 
 
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.
 
12
 
 
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.
 
17
 
 
18
*/
 
19
 
 
20
#ifndef SOLID_CONTROL_IFACES_NETWORKINTERFACE_H
 
21
#define SOLID_CONTROL_IFACES_NETWORKINTERFACE_H
 
22
 
 
23
#include "../solid_control_export.h"
 
24
#include "../networkinterface.h"
 
25
#include <QtCore/QObject>
 
26
#include <QtCore/QList>
 
27
 
 
28
namespace Solid
 
29
{
 
30
namespace Control
 
31
{
 
32
namespace Ifaces
 
33
{
 
34
    /**
 
35
     * Represents a generic network interface as seen by the networking subsystem.
 
36
     *
 
37
     * For specialized interfaces @see Solid::Control::Ifaces::WiredNetworkInterface and @see
 
38
     * Solid::Control::Ifaces::WirelessNetworkInterface
 
39
     */
 
40
    class SOLIDCONTROLIFACES_EXPORT NetworkInterface
 
41
    {
 
42
    public:
 
43
        /**
 
44
         * Destroys a NetworkInterface object.
 
45
         */
 
46
        virtual ~NetworkInterface();
 
47
 
 
48
        /**
 
49
         * Retrieves the Unique Network Identifier (UNI) of the Network.
 
50
         * This identifier is unique for each network and network interface in the system.
 
51
         *
 
52
         * @returns the Unique Network Identifier of the current network
 
53
         */
 
54
        virtual QString uni() const = 0;
 
55
        /**
 
56
         * Retrieves the Unique Device Identifier (UDI).
 
57
         * This is needed for ModemManager support.
 
58
         *
 
59
         * @returns the Unique Device Identifier of the current device
 
60
         */
 
61
        virtual QString udi() const = 0;
 
62
        /**
 
63
         * The system name for the network interface
 
64
         */
 
65
        virtual QString interfaceName() const = 0;
 
66
 
 
67
        /**
 
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.
 
72
         */
 
73
        virtual QString ipInterfaceName() const = 0;
 
74
 
 
75
        /**
 
76
         * If TRUE, indicates the device is likely missing firmware necessary for
 
77
         * its operation.
 
78
         */
 
79
        virtual bool firmwareMissing() const = 0;
 
80
 
 
81
        /**
 
82
         * Handle for the system driver controlling this network interface
 
83
         */
 
84
        virtual QString driver() const = 0;
 
85
 
 
86
        /**
 
87
         * Disconnects a device and prevents the device from automatically
 
88
         * activating further connections without user intervention.
 
89
         */
 
90
        virtual void disconnectInterface() = 0;
 
91
 
 
92
        /**
 
93
         * Access the network configuration for this object
 
94
         */
 
95
        virtual Solid::Control::IPv4Config ipV4Config() const = 0;
 
96
 
 
97
        /**
 
98
         * Retrieves the activation status of this network interface.
 
99
         *
 
100
         * @return true if this network interface is active, false otherwise
 
101
         */
 
102
        virtual bool isActive() const = 0;
 
103
 
 
104
        /**
 
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.
 
108
         *
 
109
         * @return the current connection state
 
110
         * @see Solid::Control::NetworkInterface::ConnectionState
 
111
         */
 
112
        virtual Solid::Control::NetworkInterface::ConnectionState connectionState() const = 0;
 
113
        /**
 
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.
 
116
         *
 
117
         * @return the device maximum speed
 
118
         */
 
119
        virtual int designSpeed() const = 0;
 
120
 
 
121
        /**
 
122
         * Retrieves the capabilities supported by this device.
 
123
         *
 
124
         * @return the capabilities of the device
 
125
         * @see Solid::Control::NetworkInterface::Capabilities
 
126
         */
 
127
        virtual Solid::Control::NetworkInterface::Capabilities capabilities() const = 0;
 
128
 
 
129
    protected:
 
130
    //Q_SIGNALS:
 
131
        /**
 
132
         * This signal is emitted when the settings of this network have changed.
 
133
         */
 
134
        virtual void ipDetailsChanged() = 0;
 
135
 
 
136
        /**
 
137
         * This signal is emitted when the device's connection state changed.
 
138
         * For example, if the device was disconnected and started to activate
 
139
         *
 
140
         * @param state the new state of the connection
 
141
         * @see Solid::Control::NetworkInterface::ConnectionState
 
142
         */
 
143
        virtual void connectionStateChanged(int state) = 0;
 
144
 
 
145
        /**
 
146
         * This signal is emitted when the device's link status changed.
 
147
         * 
 
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
 
153
         */
 
154
        virtual void connectionStateChanged(int new_state, int old_state, int reason ) = 0;
 
155
 
 
156
    };
 
157
} //Ifaces
 
158
} //Control
 
159
} //Solid
 
160
 
 
161
Q_DECLARE_INTERFACE(Solid::Control::Ifaces::NetworkInterface, "org.kde.Solid.Control.Ifaces.NetworkInterface/0.1")
 
162
 
 
163
#endif