|
1 /* |
|
2 * Copyright (c) 2010 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 * Wlan Login application class implementation. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // System includes |
|
21 #include <QObject> |
|
22 #include <QStringList> |
|
23 #include <QString> |
|
24 #include <QUrl> |
|
25 #include <HbTranslator> |
|
26 |
|
27 //User includes |
|
28 #include "wlanloginapplication.h" |
|
29 #include "wlanloginservice.h" |
|
30 #include "wlanloginmainwindow.h" |
|
31 #include "wlanloginengine.h" |
|
32 #include "wlanloginview.h" |
|
33 |
|
34 #include "OstTraceDefinitions.h" |
|
35 #ifdef OST_TRACE_COMPILER_IN_USE |
|
36 #include "wlanloginapplicationTraces.h" |
|
37 #endif |
|
38 |
|
39 /*! |
|
40 \class WlanLoginApplication |
|
41 \brief WLAN Login application class implementation. |
|
42 */ |
|
43 |
|
44 // External function prototypes |
|
45 |
|
46 // Local constants |
|
47 |
|
48 // ======== LOCAL FUNCTIONS ======== |
|
49 |
|
50 // ======== MEMBER FUNCTIONS ======== |
|
51 |
|
52 /*! |
|
53 Constructor. |
|
54 |
|
55 @param [in] argc Parameter count. |
|
56 @param [in] argv Parameters. |
|
57 */ |
|
58 WlanLoginApplication::WlanLoginApplication(int argc, char* argv[]) : |
|
59 HbApplication( argc, argv ), |
|
60 mService(new WlanLoginService(this)), |
|
61 mTranslator(new HbTranslator()), |
|
62 mEngine(new WlanLoginEngine(this)), |
|
63 mMainWindow(new WlanLoginMainWindow(this)) |
|
64 { |
|
65 OstTraceFunctionEntry0(WLANLOGINAPPLICATION_WLANLOGINAPPLICATION_ENTRY); |
|
66 |
|
67 bool connectStatus = connect( |
|
68 mService, |
|
69 SIGNAL(startLogin(int,int,QUrl)), |
|
70 mEngine, |
|
71 SLOT(handleStartLogin(int,int,QUrl))); |
|
72 Q_ASSERT(connectStatus == true); |
|
73 |
|
74 connectStatus = connect( |
|
75 mService, |
|
76 SIGNAL(stopLogin()), |
|
77 mEngine, |
|
78 SLOT(handleStopLogin())); |
|
79 Q_ASSERT(connectStatus == true); |
|
80 |
|
81 connectStatus = connect( |
|
82 mEngine, |
|
83 SIGNAL(completeServiceRequest(int)), |
|
84 mService, |
|
85 SLOT(completeServiceRequest(int))); |
|
86 Q_ASSERT(connectStatus == true); |
|
87 |
|
88 connectStatus = connect( |
|
89 mEngine, |
|
90 SIGNAL(connectionReady(QUrl)), |
|
91 mMainWindow->loginView(), |
|
92 SLOT(handleConnectionReady(QUrl))); |
|
93 Q_ASSERT(connectStatus == true); |
|
94 |
|
95 connectStatus = connect( |
|
96 mMainWindow->loginView(), |
|
97 SIGNAL(startIcts()), |
|
98 mEngine, |
|
99 SLOT(handleStartIcts())); |
|
100 Q_ASSERT(connectStatus == true); |
|
101 |
|
102 connectStatus = connect( |
|
103 mEngine, |
|
104 SIGNAL(ictsOk()), |
|
105 mMainWindow->loginView(), |
|
106 SLOT(handleIctsOk())); |
|
107 Q_ASSERT(connectStatus == true); |
|
108 |
|
109 connectStatus = connect( |
|
110 mMainWindow->loginView(), |
|
111 SIGNAL(cancelTriggered()), |
|
112 mEngine, |
|
113 SLOT(handleCancelTriggered())); |
|
114 Q_ASSERT(connectStatus == true); |
|
115 |
|
116 connectStatus = connect( |
|
117 mMainWindow->loginView(), |
|
118 SIGNAL(nextTriggered()), |
|
119 mEngine, |
|
120 SLOT(handleNextTriggered())); |
|
121 Q_ASSERT(connectStatus == true); |
|
122 |
|
123 connectStatus = connect( |
|
124 mMainWindow.data(), |
|
125 SIGNAL(orientationChanged(Qt::Orientation)), |
|
126 mMainWindow->loginView(), |
|
127 SLOT(handleOrientationChanged(Qt::Orientation))); |
|
128 Q_ASSERT(connectStatus == true); |
|
129 |
|
130 OstTraceFunctionExit0(WLANLOGINAPPLICATION_WLANLOGINAPPLICATION_EXIT); |
|
131 } |
|
132 |
|
133 |
|
134 /*! |
|
135 Destructor. |
|
136 */ |
|
137 WlanLoginApplication::~WlanLoginApplication() |
|
138 { |
|
139 OstTraceFunctionEntry0(WLANLOGINAPPLICATION_DESTRUCTOR_ENTRY); |
|
140 |
|
141 OstTraceFunctionExit0(WLANLOGINAPPLICATION_DESTRUCTOR_EXIT); |
|
142 } |
|
143 |
|
144 |
|
145 /*! |
|
146 Function that returns pointer to Qt Highway service instance. |
|
147 |
|
148 @return Pointer to XQServiceProvider |
|
149 */ |
|
150 WlanLoginService* WlanLoginApplication::service() const |
|
151 { |
|
152 OstTraceFunctionEntry0(WLANLOGINAPPLICATION_SERVICE_ENTRY); |
|
153 OstTraceFunctionExit0(WLANLOGINAPPLICATION_SERVICE_EXIT); |
|
154 |
|
155 return mService; |
|
156 } |
|
157 |
|
158 |
|
159 /*! |
|
160 Function that returns pointer to WLAN login engine |
|
161 |
|
162 @return Pointer to engine |
|
163 */ |
|
164 WlanLoginEngine* WlanLoginApplication::engine() const |
|
165 { |
|
166 OstTraceFunctionEntry0(WLANLOGINAPPLICATION_ENGINE_ENTRY); |
|
167 OstTraceFunctionExit0(WLANLOGINAPPLICATION_ENGINE_EXIT); |
|
168 |
|
169 return mEngine; |
|
170 } |
|
171 |
|
172 |
|
173 /*! |
|
174 Function that returns pointer to WLAN login application main window |
|
175 |
|
176 @return Pointer to application main window |
|
177 */ |
|
178 QSharedPointer<WlanLoginMainWindow> WlanLoginApplication::mainWindow() |
|
179 { |
|
180 OstTraceFunctionEntry0(WLANLOGINAPPLICATION_MAINWINDOW_ENTRY); |
|
181 OstTraceFunctionExit0(WLANLOGINAPPLICATION_MAINWINDOW_EXIT); |
|
182 |
|
183 return mMainWindow; |
|
184 } |