|
1 /* |
|
2 * Copyright (c) 2009 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: A class for converting CGI Info to lat, long. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_GEOCONVERTER_H |
|
19 #define C_GEOCONVERTER_H |
|
20 |
|
21 /** |
|
22 * |
|
23 * @since S60 9.2 |
|
24 */ |
|
25 #ifdef LOC_GEOTAGGING_CELLID |
|
26 #include <lbslocationinfoconverter.h> |
|
27 #include <lbslocationinfo.h> |
|
28 #endif |
|
29 #include <lbsposition.h> |
|
30 #include <etel3rdparty.h> |
|
31 |
|
32 class MGeoConverterObserver |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * This method is used for notifying completion of geotagging |
|
37 * @param aError error code |
|
38 * @param aPosition position (lat/lon) for the correcponding n/w info |
|
39 */ |
|
40 virtual void ConversionCompletedL( const TInt aError, TLocality& aPosition ) = 0; |
|
41 |
|
42 /** |
|
43 * This method is used to handle any error during conversion |
|
44 * @param aError the error code |
|
45 */ |
|
46 virtual void HandleConversionError(TInt aError) = 0; |
|
47 }; |
|
48 |
|
49 // Class to handle conversion operations |
|
50 class CGeoConverter : public CBase |
|
51 #ifdef LOC_GEOTAGGING_CELLID |
|
52 , public MLbsLocationInfoConverterObserver |
|
53 #endif |
|
54 { |
|
55 public: |
|
56 /** |
|
57 * 2-phased constructor. |
|
58 */ |
|
59 IMPORT_C static CGeoConverter* NewL( MGeoConverterObserver& aObserver ); |
|
60 /** |
|
61 * C++ destructor. |
|
62 */ |
|
63 IMPORT_C virtual ~CGeoConverter(); |
|
64 |
|
65 IMPORT_C void ConvertL( const CTelephony::TNetworkInfoV1& aNetworkInfo ); |
|
66 |
|
67 #ifdef GEOCONVERTER_UNIT_TESTCASE |
|
68 public: |
|
69 #else |
|
70 protected: |
|
71 #endif |
|
72 // From MLbsLocationInfoConverterObserver |
|
73 void OnConversionComplete( TInt aStatusCode ); |
|
74 |
|
75 #ifdef GEOCONVERTER_UNIT_TESTCASE |
|
76 public: |
|
77 #else |
|
78 private: |
|
79 #endif |
|
80 |
|
81 /** |
|
82 * C++ constructor. |
|
83 */ |
|
84 CGeoConverter( MGeoConverterObserver& aObserver ); |
|
85 /** |
|
86 * 2nd phase constructor. |
|
87 */ |
|
88 void ConstructL(); |
|
89 |
|
90 #ifdef GEOCONVERTER_UNIT_TESTCASE |
|
91 public: |
|
92 #else |
|
93 private: |
|
94 #endif |
|
95 |
|
96 MGeoConverterObserver& iObserver; |
|
97 #ifdef LOC_GEOTAGGING_CELLID |
|
98 CLbsLocationInfoConverter* iLocConverter; |
|
99 CLbsLocationInfo* iLocInfo; |
|
100 CLbsGsmCellInfo* iGsmCellInfo; |
|
101 CLbsWcdmaCellInfo* iWcdmaCellInfo; |
|
102 #endif |
|
103 }; |
|
104 |
|
105 #endif // C_GEOCONVERTER_H |
|
106 |
|
107 // End of file. |