1 /* This file is part of the KDE project
2 Copyright (C) 2008 Pino Toscano <pino@kde.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
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 "NetworkManager-wirednetwork.h"
23 #include "NetworkManager-networkinterface_p.h"
27 #include <QtDBus/QDBusReply>
29 class NMWiredNetworkPrivate
: public NMNetworkInterfacePrivate
32 NMWiredNetworkPrivate(const QString
& netPath
);
33 Q_DECLARE_PUBLIC(NMWiredNetwork
)
34 /* reimp */ void applyProperties(const NMDBusDeviceProperties
& props
);
40 NMWiredNetworkPrivate::NMWiredNetworkPrivate(const QString
& netPath
)
41 : NMNetworkInterfacePrivate(netPath
)
47 void NMWiredNetworkPrivate::applyProperties(const NMDBusDeviceProperties
& props
)
49 NMNetworkInterfacePrivate::applyProperties(props
);
51 hwAddr
= props
.hardwareAddress
;
52 carrier
= props
.linkActive
;
56 NMWiredNetwork::NMWiredNetwork(const QString
& networkPath
)
57 : NMNetworkInterface(*new NMWiredNetworkPrivate(networkPath
))
61 NMWiredNetwork::~NMWiredNetwork()
65 QString
NMWiredNetwork::hardwareAddress() const
67 Q_D(const NMWiredNetwork
);
71 int NMWiredNetwork::bitRate() const
73 Q_D(const NMWiredNetwork
);
77 bool NMWiredNetwork::carrier() const
79 Q_D(const NMWiredNetwork
);
83 void NMWiredNetwork::setBitrate(int rate
)
90 emit
bitRateChanged(rate
);
93 void NMWiredNetwork::setCarrier(bool carrier
)
96 if (d
->carrier
== carrier
)
100 emit
carrierChanged(d
->carrier
);
103 bool NMWiredNetwork::activateConnection(const QString
& connectionUni
, const QVariantMap
& connectionParameters
)
106 Q_UNUSED(connectionUni
)
107 Q_UNUSED(connectionParameters
)
110 const QDBusReply
<void> reply
= d
->manager
->call(QDBus::NoBlock
, "setActiveDevice", uni());
117 bool NMWiredNetwork::deactivateConnection()
122 #include "NetworkManager-wirednetwork.moc"