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 |
|
|
18 |
#include "context_wlanqtutils.h"
|
|
19 |
#include "wlanqtutils.h"
|
|
20 |
#include "wlanqtutilsap.h"
|
|
21 |
|
|
22 |
WlanQtUtilsContext::WlanQtUtilsContext(WlanQtUtils *utils )
|
|
23 |
: mUtils(utils)
|
|
24 |
{
|
|
25 |
|
|
26 |
|
|
27 |
}
|
|
28 |
|
|
29 |
WlanQtUtilsContext::~WlanQtUtilsContext()
|
|
30 |
{
|
|
31 |
|
|
32 |
}
|
|
33 |
|
|
34 |
void WlanQtUtilsContext::setScanWlanApsResult(
|
|
35 |
QList<QSharedPointer<WlanQtUtilsAp> > result )
|
|
36 |
{
|
|
37 |
mUtils->mScanWlanAps = result;
|
|
38 |
}
|
|
39 |
|
|
40 |
void WlanQtUtilsContext::setScanWlanDirectResult( QString ssid,
|
|
41 |
QList<QSharedPointer<WlanQtUtilsAp> > result )
|
|
42 |
{
|
|
43 |
mUtils->mScanWlanDirectSsid = ssid;
|
|
44 |
mUtils->mScanWlanDirect = result;
|
|
45 |
}
|
|
46 |
|
|
47 |
void WlanQtUtilsContext::setCreateWlanIapResult(int iapId)
|
|
48 |
{
|
|
49 |
mUtils->mCreateWlanIapReturn = iapId;
|
|
50 |
}
|
|
51 |
|
|
52 |
void WlanQtUtilsContext::setUpdateWlanIapResult(bool returnValue)
|
|
53 |
{
|
|
54 |
mUtils->mUpdateWlanIapReturn = returnValue;
|
|
55 |
}
|
|
56 |
|
|
57 |
void WlanQtUtilsContext::setConnectionSuccessed(bool value)
|
|
58 |
{
|
|
59 |
mUtils->mConnectionSuccess = value;
|
|
60 |
}
|
|
61 |
|
|
62 |
void WlanQtUtilsContext::setSignalWlanNetworkOpened(int iapId)
|
|
63 |
{
|
|
64 |
mUtils->mWlanNetworkOpenedIapId = iapId;
|
|
65 |
}
|
|
66 |
|
|
67 |
void WlanQtUtilsContext::setSignalWlanNetworkClosed(int iapId, int reason)
|
|
68 |
{
|
|
69 |
mUtils->mWlanNetworkClosedIapId = iapId;
|
|
70 |
mUtils->mWlanNetworkClosedReason = (bool)reason;
|
|
71 |
}
|
|
72 |
#ifdef ICT_RESULT_ENUM
|
|
73 |
void WlanQtUtilsContext::setSignalIctResult(int iapId, WlanLoginIctsResultType result)
|
|
74 |
#else
|
|
75 |
void WlanQtUtilsContext::setSignalIctResult(int iapId, bool result)
|
|
76 |
#endif
|
|
77 |
{
|
|
78 |
mUtils->mIctResultIapId = iapId;
|
|
79 |
mUtils->mIctResultResults = result;
|
|
80 |
}
|
|
81 |
|
|
82 |
QStringList WlanQtUtilsContext::calledMethods()
|
|
83 |
{
|
|
84 |
QStringList methods = mUtils->mCalledMethods;
|
|
85 |
mUtils->mCalledMethods.clear();
|
|
86 |
return methods;
|
|
87 |
}
|
|
88 |
|
|
89 |
bool WlanQtUtilsContext::verifyWlanIapSettings(WlanQtUtilsAp &ref)
|
|
90 |
{
|
|
91 |
bool ret = true;
|
|
92 |
if (!mUtils->mWlanAp){
|
|
93 |
qWarning("WlanQtUtilsContext::verifyWlanIapSettings: iap not created");
|
|
94 |
ret = false;
|
|
95 |
}
|
|
96 |
|
|
97 |
if (!(*(mUtils->mWlanAp) == ref)){
|
|
98 |
qWarning("WlanQtUtilsContext::verifyWlanIapSettings: settings does not match");
|
|
99 |
ret = false;
|
|
100 |
}
|
|
101 |
return ret;
|
|
102 |
}
|