not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / libs / solid / control / networkinterface.cpp
blob97f5704e6f37f527803ec669ed5a0ae19e69d532
1 /* This file is part of the KDE project
2 Copyright (C) 2006 Will Stephenson <wstephenson@kde.org>
3 Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
21 #include "networkinterface.h"
22 #include "networkinterface_p.h"
24 #include "soliddefs_p.h"
25 #include "ifaces/networkinterface.h"
27 Solid::Control::NetworkInterface::NetworkInterface(QObject *backendObject)
28 : QObject(), d_ptr(new NetworkInterfacePrivate(this))
30 Q_D(NetworkInterface);
31 d->setBackendObject(backendObject);
34 Solid::Control::NetworkInterface::NetworkInterface(const NetworkInterface &other)
35 : QObject(), d_ptr(new NetworkInterfacePrivate(this))
37 Q_D(NetworkInterface);
38 d->setBackendObject(other.d_ptr->backendObject());
41 Solid::Control::NetworkInterface::NetworkInterface(NetworkInterfacePrivate &dd, QObject *backendObject)
42 : QObject(), d_ptr(&dd)
44 Q_UNUSED(backendObject);
47 Solid::Control::NetworkInterface::NetworkInterface(NetworkInterfacePrivate &dd, const NetworkInterface &other)
48 : d_ptr(&dd)
50 Q_UNUSED(other);
53 Solid::Control::NetworkInterface::~NetworkInterface()
55 delete d_ptr;
58 Solid::Control::NetworkInterface::Type Solid::Control::NetworkInterface::type() const
60 return UnknownType;
63 QString Solid::Control::NetworkInterface::uni() const
65 Q_D(const NetworkInterface);
66 return_SOLID_CALL(Ifaces::NetworkInterface *, d->backendObject(), QString(), uni());
69 QString Solid::Control::NetworkInterface::interfaceName() const
71 Q_D(const NetworkInterface);
72 return_SOLID_CALL(Ifaces::NetworkInterface *, d->backendObject(), QString(), interfaceName());
75 QString Solid::Control::NetworkInterface::driver() const
77 Q_D(const NetworkInterface);
78 return_SOLID_CALL(Ifaces::NetworkInterface *, d->backendObject(), QString(), driver());
81 Solid::Control::IPv4Config Solid::Control::NetworkInterface::ipV4Config() const
83 Q_D(const NetworkInterface);
84 return_SOLID_CALL(Ifaces::NetworkInterface *, d->backendObject(), Solid::Control::IPv4Config(), ipV4Config() );
87 bool Solid::Control::NetworkInterface::isActive() const
89 Q_D(const NetworkInterface);
90 return_SOLID_CALL(Ifaces::NetworkInterface *, d->backendObject(), false, isActive());
93 Solid::Control::NetworkInterface::ConnectionState Solid::Control::NetworkInterface::connectionState() const
95 Q_D(const NetworkInterface);
96 return_SOLID_CALL(Ifaces::NetworkInterface *, d->backendObject(), UnknownState, connectionState());
99 int Solid::Control::NetworkInterface::designSpeed() const
101 Q_D(const NetworkInterface);
102 return_SOLID_CALL(Ifaces::NetworkInterface *, d->backendObject(), 0, designSpeed());
105 Solid::Control::NetworkInterface::Capabilities Solid::Control::NetworkInterface::capabilities() const
107 Q_D(const NetworkInterface);
108 return_SOLID_CALL(Ifaces::NetworkInterface *, d->backendObject(), Capabilities(), capabilities());
111 void Solid::Control::NetworkInterfacePrivate::setBackendObject(QObject *object)
113 FrontendObjectPrivate::setBackendObject(object);
115 if (object) {
116 QObject::connect(object, SIGNAL(connectionStateChanged(int)),
117 parent(), SIGNAL(connectionStateChanged(int)));
122 #include "networkinterface.moc"