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: Helper class for extended functionality for policy provision process. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "extenderhelper.h" |
|
20 #include "extender.h" |
|
21 |
|
22 |
|
23 CExtenderHelper* CExtenderHelper::NewL() |
|
24 { |
|
25 CExtenderHelper* self = new (ELeave) CExtenderHelper(); |
|
26 CleanupStack::PushL(self); |
|
27 self->ConstructL(); |
|
28 CleanupStack::Pop(); // self |
|
29 return self; |
|
30 } |
|
31 |
|
32 CExtenderHelper::~CExtenderHelper() |
|
33 { |
|
34 iExtender=NULL; |
|
35 Cancel(); |
|
36 iNotifier.Close(); |
|
37 } |
|
38 |
|
39 CExtenderHelper::CExtenderHelper() : CActive(EPriorityNormal) |
|
40 { |
|
41 |
|
42 } |
|
43 |
|
44 void CExtenderHelper::ConstructL() |
|
45 { |
|
46 CActiveScheduler::Add(this); |
|
47 User::LeaveIfError(iNotifier.Connect()); |
|
48 |
|
49 } |
|
50 |
|
51 //From CActive |
|
52 void CExtenderHelper::DoCancel() |
|
53 { |
|
54 iNotifier.CancelNotifier(KUidVpnDialogNotifier); |
|
55 } |
|
56 |
|
57 void CExtenderHelper::RunL() |
|
58 { |
|
59 ASSERT(iStatus.Int() == KErrCancel); |
|
60 iExtender->Cancel(); |
|
61 |
|
62 } |
|
63 |
|
64 |
|
65 void CExtenderHelper::StartNotifierL(CExtender* aExtender) |
|
66 { |
|
67 iExtender=aExtender; |
|
68 |
|
69 TVpnDialogInfo dialogInfo(TVpnDialog::EPolicyInstallInProgress, 0); |
|
70 iDialogInfoDes() = dialogInfo; |
|
71 |
|
72 iNotifier.StartNotifierAndGetResponse(iStatus, KUidVpnDialogNotifier, |
|
73 iDialogInfoDes, iDialogResponseDes); |
|
74 SetActive(); |
|
75 } |
|