31
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*/
|
|
16 |
|
|
17 |
#ifndef STUB_WLANQTUTILS_H
|
|
18 |
#define STUB_WLANQTUTILS_H
|
|
19 |
|
|
20 |
#include <QObject>
|
|
21 |
#include <QSharedPointer>
|
|
22 |
#include <QStringList>
|
|
23 |
#include <QTest>
|
|
24 |
|
|
25 |
#include "wlanqtutilscommon.h"
|
|
26 |
#include "wlanqtutilsap.h"
|
|
27 |
|
|
28 |
class WlanQtUtilsIap;
|
|
29 |
class WlanQtUtilsWlanIap;
|
|
30 |
|
|
31 |
class WLANQTUTILITIESDLL_EXPORT WlanQtUtils : public QObject
|
|
32 |
{
|
|
33 |
Q_OBJECT
|
|
34 |
friend class WlanQtUtilsContext;
|
|
35 |
public:
|
|
36 |
//! "None" IAP ID value (e.g. for "not found" cases)
|
|
37 |
static const int IapIdNone = -1;
|
|
38 |
|
39
|
39 |
/*!
|
|
40 |
WLAN connection status.
|
|
41 |
Remember to update traces/trace.properties when modifying this enum.
|
|
42 |
*/
|
|
43 |
enum ConnStatus {
|
|
44 |
ConnStatusNone = 0, //!< Reserved.
|
|
45 |
ConnStatusConnecting, //!< Connecting.
|
|
46 |
ConnStatusConnected, //!< Connected.
|
|
47 |
ConnStatusDisconnected //!< Disconnected.
|
|
48 |
};
|
|
49 |
|
|
50 |
/*!
|
|
51 |
WLAN scan status
|
|
52 |
Remember to update traces/trace.properties when modifying this enum.
|
|
53 |
*/
|
|
54 |
enum ScanStatus {
|
|
55 |
ScanStatusOk = 0, //!< Scan succeeded.
|
|
56 |
ScanStatusCancelled, //!< Scan was cancelled.
|
|
57 |
ScanStatusError //!< Scan failed.
|
|
58 |
};
|
|
59 |
|
|
60 |
/*!
|
|
61 |
Internet Connectivity Test status.
|
|
62 |
Remember to update traces/trace.properties when modifying this enum.
|
|
63 |
*/
|
|
64 |
enum IctStatus {
|
|
65 |
IctPassed = 0, //!< Normal ICT passed.
|
|
66 |
IctHotspotPassed, //!< Hotspot ICT passed.
|
|
67 |
IctCancelled, //!< ICT was cancelled.
|
|
68 |
IctFailed //!< ICT failed.
|
|
69 |
};
|
|
70 |
|
31
|
71 |
public:
|
|
72 |
WlanQtUtils();
|
|
73 |
|
|
74 |
~WlanQtUtils();
|
|
75 |
|
|
76 |
void availableWlanAps( QList<QSharedPointer<WlanQtUtilsAp> > &wlanApList);
|
|
77 |
|
|
78 |
int createIap(const WlanQtUtilsAp *wlanAp);
|
|
79 |
|
|
80 |
bool updateIap(int iapId, const WlanQtUtilsAp *wlanAp);
|
|
81 |
|
|
82 |
void deleteIap(int iapId);
|
|
83 |
|
|
84 |
void connectIap(int iapId, bool runIct = false);
|
|
85 |
|
|
86 |
int connectedWlanId();
|
|
87 |
|
|
88 |
void disconnectIap(int iapId);
|
|
89 |
|
|
90 |
int activeIap();
|
|
91 |
|
|
92 |
void scanWlanAps();
|
|
93 |
|
|
94 |
void scanWlanDirect(const QString &ssid);
|
|
95 |
|
|
96 |
void stopWlanScan();
|
|
97 |
|
|
98 |
signals:
|
|
99 |
|
39
|
100 |
void wlanScanApReady(int scanStatus);
|
31
|
101 |
|
39
|
102 |
void wlanScanDirectReady(int scanStatus);
|
31
|
103 |
|
|
104 |
void wlanNetworkOpened(int iapId);
|
|
105 |
|
|
106 |
void wlanNetworkClosed(int iapId, int reason);
|
|
107 |
|
39
|
108 |
void ictResult(int iapId, int result);
|
31
|
109 |
|
|
110 |
private: // Return values for all methods.
|
39
|
111 |
|
|
112 |
void emitScanApsReady();
|
|
113 |
|
31
|
114 |
QList<QSharedPointer<WlanQtUtilsAp> > mScanWlanAps;
|
|
115 |
QList<QSharedPointer<WlanQtUtilsAp> > mScanWlanDirect;
|
|
116 |
QList<QSharedPointer<WlanQtUtilsAp> > *mScanResult;
|
|
117 |
QString mScanWlanDirectSsid;
|
|
118 |
int mCreateWlanIapReturn;
|
|
119 |
bool mUpdateWlanIapReturn;
|
|
120 |
|
|
121 |
int mWlanNetworkOpenedIapId;
|
|
122 |
int mWlanNetworkActiveIapId;
|
|
123 |
int mWlanNetworkClosedIapId;
|
39
|
124 |
int mWlanNetworkClosedReason;
|
|
125 |
|
|
126 |
int mActiveWlanIapReturn;
|
31
|
127 |
|
|
128 |
int mIctResultIapId;
|
39
|
129 |
WlanQtUtils::IctStatus mIctResultResults;
|
|
130 |
|
31
|
131 |
bool mConnectionSuccess;
|
|
132 |
|
|
133 |
QStringList mCalledMethods;
|
|
134 |
|
|
135 |
WlanQtUtilsAp *mWlanAp;
|
39
|
136 |
|
|
137 |
bool mEmitScanApReady;
|
|
138 |
|
|
139 |
int mScanApStatus;
|
|
140 |
int mScanDirectStatus;
|
31
|
141 |
};
|
|
142 |
|
|
143 |
#endif /* WLANQTUTILS_H */
|
|
144 |
|
|
145 |
// End of File
|