41
|
1 |
/*
|
|
2 |
* Copyright (c) 2003-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: VPN management main view
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef __VPNUILOADER_H__
|
|
19 |
#define __VPNUILOADER_H__
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
#include <AknProgressDialog.h>
|
|
23 |
#include <ConeResLoader.h>
|
|
24 |
#include "vpnapiwrapper.h"
|
|
25 |
#include "vpnmanagementuidefs.h"
|
|
26 |
#include "uirunner.h"
|
|
27 |
#include "vpnextapi.h"
|
|
28 |
|
|
29 |
// CONSTANTS
|
|
30 |
/**
|
|
31 |
* Specifies the type of the waitnote text.
|
|
32 |
*/
|
|
33 |
enum
|
|
34 |
{
|
|
35 |
EConnectingVia = 0x0,
|
|
36 |
EProcessingStepN = 0x1
|
|
37 |
};
|
|
38 |
|
|
39 |
const TInt KSecondsToShowConnectingVia = 3;
|
|
40 |
|
|
41 |
// FORWARD DECLARATIONS
|
|
42 |
|
|
43 |
// CLASS DECLARATION
|
|
44 |
class CAknWaitDialog;
|
|
45 |
class CVpnManagementUiView;
|
|
46 |
class CVpnManagementUi;
|
|
47 |
/**
|
|
48 |
* CVpnUiLoader view control class.
|
|
49 |
*
|
|
50 |
* @lib vpnmanagementui.lib
|
|
51 |
*/
|
|
52 |
class CVpnUiLoader : public CCoeControl, public MCoeControlObserver,
|
|
53 |
public MProgressDialogCallback
|
|
54 |
{
|
|
55 |
public: // functions
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Destructor.
|
|
59 |
*/
|
|
60 |
~CVpnUiLoader();
|
|
61 |
|
|
62 |
/**
|
|
63 |
* NewL
|
|
64 |
*
|
|
65 |
* @since S60 3.0
|
|
66 |
* @param aRect ?description
|
|
67 |
* @param aViewId ?description
|
|
68 |
* @return self
|
|
69 |
*/
|
|
70 |
static class CVpnUiLoader* NewL(
|
|
71 |
const TRect& aRect, TUid aViewId, CVpnManagementUiView* aUiView );
|
|
72 |
|
|
73 |
/**
|
|
74 |
* NewLC
|
|
75 |
*/
|
|
76 |
static class CVpnUiLoader* NewLC(
|
|
77 |
const TRect& aRect, TUid aViewId, CVpnManagementUiView* aUiView );
|
|
78 |
|
|
79 |
/**
|
|
80 |
* ChangeViewL
|
|
81 |
* @param aNewTab change to given tab
|
|
82 |
*/
|
|
83 |
void ChangeViewL(TInt aNewTab, TInt aSelectionIndex = -1);
|
|
84 |
|
|
85 |
/**
|
|
86 |
* Activates the VPN policies, VPN policy servers and
|
|
87 |
* VPN log views title
|
|
88 |
*/
|
|
89 |
void ActivateTitleL(TInt aCurrentTitle);
|
|
90 |
|
|
91 |
void ActivateTitleL(TInt aCurrentTitle, TDes& aText);
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Activates the VPN log view Navipane text
|
|
95 |
*/
|
|
96 |
void ActivateNaviTextL();
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Added here because FocusChanged need to be included
|
|
100 |
* in every control derived from CCoeControl that can have listbox
|
|
101 |
*/
|
|
102 |
void FocusChanged(TDrawNow aDrawNow);
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Push the NaviPane to stack.
|
|
106 |
*/
|
|
107 |
void PushNaviPaneL();
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Pop the NaviPane from stack.
|
|
111 |
*/
|
|
112 |
void PopNaviPane();
|
|
113 |
|
|
114 |
/**
|
|
115 |
* Push the DefaultNaviPane (empty) to stack.
|
|
116 |
*/
|
|
117 |
void PushDefaultNaviPaneL();
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Shows the error note
|
|
121 |
*/
|
|
122 |
void ShowErrorNoteL();
|
|
123 |
|
|
124 |
/**
|
|
125 |
* Get selection name to the connecting via wait note
|
|
126 |
*/
|
|
127 |
void GetSelectionNameL(TDes& aText);
|
|
128 |
|
|
129 |
/**
|
|
130 |
* Shows the Connecting via or Processing step wait note
|
|
131 |
*/
|
|
132 |
void ShowWaitNoteL();
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Deletes the wait note
|
|
136 |
*/
|
|
137 |
void DeleteWaitNoteL();
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Set text to wait note
|
|
141 |
*/
|
|
142 |
void SetTextL();
|
|
143 |
|
|
144 |
//from MProgressDialogCallback
|
|
145 |
void DialogDismissedL( TInt aButtonId );
|
|
146 |
|
|
147 |
/**
|
|
148 |
* Check if Disk space goes below critical level.
|
|
149 |
* @param aShowErrorNote If ETrue, a warning note is shown.
|
|
150 |
* @param aBytesToWrite Amount of disk space to be allocated.
|
|
151 |
* @return ETrue if allocation would go below critical level.
|
|
152 |
*/
|
|
153 |
TBool FFSSpaceBelowCriticalLevelL( TBool aShowErrorNote,
|
|
154 |
TInt aBytesToWrite /*=0*/ );
|
|
155 |
|
|
156 |
/**
|
|
157 |
* Returns pointer to main management view
|
|
158 |
*/
|
|
159 |
CAknView* GetVpnManagementUiView() const;
|
|
160 |
|
|
161 |
/**
|
|
162 |
* CVpnApiWrapper
|
|
163 |
*/
|
|
164 |
CVpnApiWrapper& VpnApiWrapperL();
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Returns the id to the GS view that launched us
|
|
168 |
*/
|
|
169 |
TVwsViewId GSViewId() const;
|
|
170 |
|
|
171 |
/**
|
|
172 |
* Sets the id to the GS view that launched us
|
|
173 |
* @param aGsViewId The id to the GS view
|
|
174 |
*/
|
|
175 |
void SetGSViewId( TVwsViewId aGsViewId );
|
|
176 |
|
|
177 |
public: //data
|
|
178 |
|
|
179 |
/**
|
|
180 |
* Added here because FocusChanged need to be included
|
|
181 |
* in every control derived from CCoeControl that can have listbox
|
|
182 |
*/
|
|
183 |
CEikColumnListBox* iListBox;
|
|
184 |
|
|
185 |
/**
|
|
186 |
* If ETrue, We are coming back from server parameters view.
|
|
187 |
*/
|
|
188 |
TBool iBackFromServerDefinition;
|
|
189 |
|
|
190 |
/**
|
|
191 |
* If ETrue, new Server definition has created.
|
|
192 |
*/
|
|
193 |
TBool iNewServerDefinition;
|
|
194 |
/**
|
|
195 |
* If ETrue, show Define policy server query when empty list.
|
|
196 |
*/
|
|
197 |
TBool iShowDefineQuery;
|
|
198 |
|
|
199 |
MUiRunnerObserver* iObserver;
|
|
200 |
|
|
201 |
CAknWaitDialog* iWaitDialog;
|
|
202 |
|
|
203 |
TInt iCurrentPolicyIndex;
|
|
204 |
TInt iCurrentServerIndex;
|
|
205 |
TBool iPolicyUpdate;
|
|
206 |
TBuf<KMaxUiSelectionNameLength> iSelectionName;
|
|
207 |
|
|
208 |
TBool iShowWaitNote;
|
|
209 |
RVpnExtApi iVpnExtApi;
|
|
210 |
|
|
211 |
private: // data
|
|
212 |
|
|
213 |
/**
|
|
214 |
* Used to wrap asynchronous calls
|
|
215 |
*/
|
|
216 |
CVpnApiWrapper* iVpnApiWrapper;
|
|
217 |
|
|
218 |
private: // implementation
|
|
219 |
|
|
220 |
void ConstructL(const TRect& aRect, TUid aViewId);
|
|
221 |
CVpnUiLoader(CVpnManagementUiView* aUiView);
|
|
222 |
void HandleControlEventL( CCoeControl* aControl,
|
|
223 |
TCoeEvent aEventType );
|
|
224 |
TKeyResponse OfferKeyEventL(
|
|
225 |
const TKeyEvent& aKeyEvent, TEventCode aType);
|
|
226 |
public:
|
|
227 |
void AddResourceFileL(TBool aKeepOpen = EFalse);
|
|
228 |
void ReleaseResource(TBool aForceClose = EFalse);
|
|
229 |
|
|
230 |
private: //data
|
|
231 |
|
|
232 |
/**
|
|
233 |
* For Navipane
|
|
234 |
*/
|
|
235 |
CAknNavigationDecorator* iVersionInfoInNaviPane;
|
|
236 |
|
|
237 |
/**
|
|
238 |
* For Navipane
|
|
239 |
*/
|
|
240 |
CAknNavigationControlContainer* iNaviPane;
|
|
241 |
|
|
242 |
|
|
243 |
/**
|
|
244 |
* To store the previous view id
|
|
245 |
*/
|
|
246 |
TUid iPreviousViewId;
|
|
247 |
|
|
248 |
/**
|
|
249 |
* To store the previous view id
|
|
250 |
*/
|
|
251 |
TUid iPreviousAppViewId;
|
|
252 |
|
|
253 |
TInt iTextToShow;
|
|
254 |
TInt iStateCodeToShow;
|
|
255 |
TTime iWaitNoteStartTime;
|
|
256 |
|
|
257 |
/**
|
|
258 |
* Views to be registered and unregistered
|
|
259 |
*/
|
|
260 |
CAknView* iVpnManagementUiView;
|
|
261 |
CAknView* iVpnManagementUiLogView;
|
|
262 |
CAknView* iVpnManagementUiPolicyView;
|
|
263 |
CAknView* iVpnManagementUiParametersView;
|
|
264 |
CAknView* iVpnManagementUiServerView;
|
|
265 |
|
|
266 |
CVpnManagementUi* iCVpnManagementUi;
|
|
267 |
|
|
268 |
/**
|
|
269 |
* To get hold of iResourceLoader
|
|
270 |
*/
|
|
271 |
RConeResourceLoader iResourceLoader;
|
|
272 |
|
|
273 |
TVwsViewId iGsViewId; // the view id of the view which launched us
|
|
274 |
TBool iKeepOpen;
|
|
275 |
TBool iPolicyViewVisited;
|
|
276 |
TBool iLogViewVisited;
|
|
277 |
TBool iServerViewVisited;
|
|
278 |
TBool iServerSettingsViewVisited;
|
|
279 |
|
|
280 |
};
|
|
281 |
|
|
282 |
#endif // __VPNUILOADER_H__
|
|
283 |
|
|
284 |
// End of File
|