1 /* |
|
2 * Copyright (c) 2005-2006 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: CTestProviderGeocodingService class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MN_TPGEOCODINGSERVICE_H |
|
20 #define MN_TPGEOCODINGSERVICE_H |
|
21 |
|
22 #include "mngeocodingservicebase.h" |
|
23 |
|
24 class CPosLandmark; |
|
25 class CTestCommandListener; |
|
26 |
|
27 /** Implementation of geocoding service (KMnAppGeocodingService). |
|
28 */ |
|
29 class CTestProviderGeocodingService : public CMnGeocodingServiceBase |
|
30 { |
|
31 public : |
|
32 static CTestProviderGeocodingService* NewL(); |
|
33 |
|
34 void HandleTestCommandL( TInt aCommand ); |
|
35 |
|
36 protected : |
|
37 /** C++ constructor */ |
|
38 CTestProviderGeocodingService(); |
|
39 /** Destructor */ |
|
40 virtual ~CTestProviderGeocodingService(); |
|
41 |
|
42 void ConstructL(); |
|
43 |
|
44 void LeaveIfBusyL(); |
|
45 void LeaveIfInstructedL(); |
|
46 void StartProcessingL(); |
|
47 static TInt GeocodingProcessingCallBack( TAny* aPtr ); |
|
48 void HandleGeocodingCompletedL(); |
|
49 void FinishProcessingL(); |
|
50 |
|
51 TInt GetTestCommand(); |
|
52 |
|
53 private: |
|
54 void DumpDataL( const TDesC& aAddress ); |
|
55 void DumpDataL( const CPosLandmark& aLandmark ); |
|
56 |
|
57 |
|
58 protected: // from CMnGeocodingServiceBase |
|
59 |
|
60 /** Handles client's request for finding address by given coordinate. */ |
|
61 void HandleFindAddressByCoordinateL( const CPosLandmark& aLandmark ); |
|
62 |
|
63 /** Handles client's request for finding coordinate by given address. */ |
|
64 void HandleFindCoordinateByAddressL( const CPosLandmark& aLandmark ); |
|
65 |
|
66 /** Handles client's request for finding coordinate by given address. */ |
|
67 void HandleFindCoordinateByAddressL( const TDesC& aAddress ); |
|
68 |
|
69 protected: // from CMnServiceBase |
|
70 |
|
71 /** Reports that client cancelled request */ |
|
72 void DoCancel(); |
|
73 |
|
74 private: |
|
75 |
|
76 enum TServiceType |
|
77 { |
|
78 ENone, |
|
79 ECoordToAddr, |
|
80 EAddrToCoord, |
|
81 EPlainToCoord |
|
82 }; |
|
83 |
|
84 TServiceType iCurrentService; |
|
85 |
|
86 CPosLandmark* iLandmark; |
|
87 HBufC* iPlainAddress; |
|
88 |
|
89 CPeriodic* iProcessor; |
|
90 }; |
|
91 |
|
92 #endif // MN_TPGEOCODINGSERVICE_H |
|
93 |
|
94 |
|