diff -r d9ec2b8c6bad -r 2fbd1d709fe7 wlanutilities/wlanwizard/inc/wlanwizardscanlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanwizard/inc/wlanwizardscanlist.h Tue Jul 06 15:29:22 2010 +0300 @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * WLAN Wizard Plugin API: Service required from the wizard plugin. + * + */ + +#ifndef WLANWIZARDSCANLIST_H_ +#define WLANWIZARDSCANLIST_H_ + +// System includes +#include +#include +#include +#include +#include + +/*! + @addtogroup group_wlan_wizard + @{ + */ + +// User includes + +// Forward declarations +class WlanQtUtilsAp; + +// External data types +/*! + * Data structure with scan results and access point visibility information. + */ +class WlanScanResult +{ +public: + QSharedPointer scanResult; + bool networkHidden; +}; + +/*! + * Data structure containing security setting information and wizard page + * navigation information. + */ +class WlanSecuritySetting +{ +public: + int mode; + bool usePsk; + int nextPageId; + + bool operator==(const WlanSecuritySetting& setting) const { + return (mode == setting.mode && + usePsk == setting.usePsk && + nextPageId == setting.nextPageId); + } +}; + +/*! + * Data structure containing network mode, visibility and wireless protection + * setup suppport information. + */ +class WlanNetworkSetting +{ +public: + int mode; + bool hidden; + bool wpsSupported; + + bool operator==(const WlanNetworkSetting& setting) const { + return (mode == setting.mode && + hidden == setting.hidden && + wpsSupported == setting.wpsSupported); + } +}; + +/*! + * Necessary public function for an argument of type WlanNetworkSetting to + * function as a QHash key. + */ +inline uint qHash(const WlanNetworkSetting &key) + { + uint hash = key.mode; + hash <<= 1; + hash |= key.hidden ? 1 : 0; + hash <<= 1; + hash |= key.wpsSupported ? 1 : 0; + return qHash(hash); + } + +// Constants + +class WlanWizardScanList +{ +public: + WlanWizardScanList(); + WlanWizardScanList(const WlanWizardScanList &scanList); + ~WlanWizardScanList(); + void build(const QList &results); + const WlanSecuritySetting &getSecMode(WlanNetworkSetting netMode, int index = 0) const; + int netModes() const; + int secModes(WlanNetworkSetting netMode) const; + QList getNetModes() const; + +private: + // Disabling implicit assignment operator + WlanWizardScanList &operator=(const WlanWizardScanList &); + +private: + QHash > mOpenOptions; +}; + +/*! + * This macro makes WlanWizardScanList QVariant-compatible. + */ +Q_DECLARE_METATYPE(WlanWizardScanList) + +/*! @} */ + +#endif /* WLANWIZARDSCANLIST_H_ */