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