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