• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libsolidcontrol

fakeaccesspoint.cpp

Go to the documentation of this file.
00001 /*
00002 Copyright 2008 Will Stephenson <wstephenson@kde.org>
00003 
00004 This library is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU Lesser General Public
00006 License as published by the Free Software Foundation; either
00007 version 2.1 of the License, or (at your option) version 3, or any
00008 later version accepted by the membership of KDE e.V. (or its
00009 successor approved by the membership of KDE e.V.), which shall
00010 act as a proxy defined in Section 6 of version 3 of the license.
00011 
00012 This library is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 Lesser General Public License for more details.
00016 
00017 You should have received a copy of the GNU Lesser General Public 
00018 License along with this library.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #include "fakeaccesspoint.h"
00022 
00023 FakeAccessPoint::FakeAccessPoint( const QMap<QString, QVariant>  & propertyMap,
00024                                           QObject * parent)
00025 : Solid::Control::Ifaces::AccessPoint( parent ), mPropertyMap(propertyMap)
00026 {
00027 }
00028 
00029 FakeAccessPoint::~FakeAccessPoint()
00030 {
00031 
00032 }
00033 
00034 // PHY stuff
00035 QString FakeAccessPoint::uni() const
00036 {
00037     return mPropertyMap["uni"].toString();
00038 }
00039 
00040 
00041 QString FakeAccessPoint::ssid() const
00042 {
00043     return mPropertyMap["ssid"].toString();
00044 }
00045 
00046 
00047 uint FakeAccessPoint::frequency() const
00048 {
00049     return mPropertyMap["frequency"].toUInt();
00050 }
00051 
00052 QString FakeAccessPoint::hardwareAddress() const
00053 {
00054     return mPropertyMap["hwaddress"].toString();
00055 }
00056 
00057 uint FakeAccessPoint::maxBitRate() const
00058 {
00059     return mPropertyMap["maxbitrate"].toUInt();
00060 }
00061 
00062 int FakeAccessPoint::signalStrength() const
00063 {
00064     return mPropertyMap["signalstrength"].toInt();
00065 }
00066 
00067 Solid::Control::AccessPoint::WpaFlags FakeAccessPoint::wpaFlags() const
00068 {
00069     return wpaPropsToFlags( "wpaflags" );
00070 }
00071 
00072 Solid::Control::AccessPoint::WpaFlags FakeAccessPoint::rsnFlags() const
00073 {
00074     return wpaPropsToFlags( "rsnflags" );
00075 }
00076 
00077 Solid::Control::AccessPoint::WpaFlags FakeAccessPoint::wpaPropsToFlags( const QString & property ) const
00078 {
00079     QStringList capStrings = mPropertyMap[property].toStringList();
00080 
00081     Solid::Control::AccessPoint::WpaFlags caps = 0;
00082     if (capStrings.contains("pairwep40"))
00083         caps |= Solid::Control::AccessPoint::PairWep40;
00084     if (capStrings.contains("pairweb104"))
00085         caps |= Solid::Control::AccessPoint::PairWep104;
00086     if (capStrings.contains("pairtkip"))
00087         caps |= Solid::Control::AccessPoint::PairTkip;
00088     if (capStrings.contains("pairccmp"))
00089         caps |= Solid::Control::AccessPoint::PairCcmp;
00090     if (capStrings.contains("groupwep40"))
00091         caps |= Solid::Control::AccessPoint::GroupWep40;
00092     if (capStrings.contains("groupweb104"))
00093         caps |= Solid::Control::AccessPoint::GroupWep104;
00094     if (capStrings.contains("grouptkip"))
00095         caps |= Solid::Control::AccessPoint::GroupTkip;
00096     if (capStrings.contains("groupccmp"))
00097         caps |= Solid::Control::AccessPoint::GroupCcmp;
00098     if (capStrings.contains("keypsk"))
00099         caps |= Solid::Control::AccessPoint::KeyMgmtPsk;
00100     if (capStrings.contains("key8021x"))
00101         caps |= Solid::Control::AccessPoint::KeyMgmt8021x;
00102     return caps;
00103 }
00104 
00105 Solid::Control::AccessPoint::Capabilities FakeAccessPoint::capabilities() const
00106 {
00107     //TODO
00108     QStringList capStrings = mPropertyMap["capabilities"].toStringList();
00109 
00110     Solid::Control::AccessPoint::Capabilities caps = 0;
00111     if (capStrings.contains("privacy"))
00112         caps |= Solid::Control::AccessPoint::Privacy;
00113     return caps;
00114 }
00115 
00116 Solid::Control::WirelessNetworkInterface::OperationMode FakeAccessPoint::mode() const
00117 {
00118     QString modeName = mPropertyMap["mode"].toString();
00119 
00120     if (modeName == "adhoc")
00121         return Solid::Control::WirelessNetworkInterface::Adhoc;
00122     else if (modeName == "managed")
00123         return Solid::Control::WirelessNetworkInterface::Managed;
00124     else if (modeName == "master")
00125         return Solid::Control::WirelessNetworkInterface::Master;
00126     else if (modeName == "repeater")
00127         return Solid::Control::WirelessNetworkInterface::Repeater;
00128     else
00129         return Solid::Control::WirelessNetworkInterface::Unassociated;
00130 }
00131 
00132 #include "fakeaccesspoint.moc"
00133 

libsolidcontrol

Skip menu "libsolidcontrol"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal