|
1 /* |
|
2 * Copyright (c) 2007-2007 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 the License "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: This Class is observer for the Launching Application |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <e32const.h> |
|
21 #include "tsnsrprovidertestobserver.h" |
|
22 _LIT8(KResponse,"ReturnValue"); |
|
23 _LIT8(KErrorCode,"ErrorCode"); |
|
24 |
|
25 // ----------------------------------------------------------------------------- |
|
26 // CProviderObserver::NewL |
|
27 // Returns the instance of CLauncherObserver. |
|
28 // ----------------------------------------------------------------------------- |
|
29 CProviderObserver* CProviderObserver::NewL() |
|
30 { |
|
31 CProviderObserver* self = new( ELeave ) CProviderObserver(); |
|
32 return self; |
|
33 } |
|
34 |
|
35 |
|
36 // --------------------------------------------------------------------------- |
|
37 // call back |
|
38 // --------------------------------------------------------------------------- |
|
39 // |
|
40 TInt CProviderObserver :: HandleNotifyL( TInt /*aCmdId*/, TInt aEventId, CLiwGenericParamList& aEventParamList,const CLiwGenericParamList& /*aInParamList*/) |
|
41 |
|
42 { |
|
43 |
|
44 iCancel = EFalse; |
|
45 if ( aEventId == KLiwEventCanceled ) |
|
46 { |
|
47 iCancel = ETrue; |
|
48 |
|
49 } |
|
50 |
|
51 if ( aEventId == KLiwEventCompleted ) |
|
52 { |
|
53 const TLiwGenericParam* p= NULL; |
|
54 TInt pos = 0; |
|
55 |
|
56 p = aEventParamList.FindFirst(pos, KErrorCode ); // Finding Error Code |
|
57 |
|
58 if(p) |
|
59 { |
|
60 iErrorReturn = p->Value().AsTInt32(); |
|
61 } |
|
62 else |
|
63 { |
|
64 iErrorReturn = KErrGeneral; |
|
65 } |
|
66 |
|
67 } |
|
68 |
|
69 if(iWait) |
|
70 iWait->AsyncStop(); |
|
71 } |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 // --------------------------------------------------------------------------- |
|
77 // consturctor |
|
78 // --------------------------------------------------------------------------- |
|
79 // |
|
80 CProviderObserver::CProviderObserver( ) |
|
81 { |
|
82 iWait= NULL; |
|
83 } |
|
84 // --------------------------------------------------------------------------- |
|
85 // consturctor |
|
86 // --------------------------------------------------------------------------- |
|
87 // |
|
88 void CProviderObserver::SetWait(CActiveSchedulerWait *aWait ) |
|
89 { |
|
90 iWait = aWait; |
|
91 } |