|
1 /* |
|
2 * Copyright (c) 2006-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: Reverse Geocode utility which converts the geo coordinates in to |
|
15 * the actual address information. |
|
16 */ |
|
17 |
|
18 #ifndef REVERSEGEOCODE_H_ |
|
19 #define REVERSEGEOCODE_H_ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <lbsposition.h> |
|
23 #include <etel.h> |
|
24 #include <etelmm.h> |
|
25 #include "geotagger.h" |
|
26 |
|
27 /* |
|
28 * Data class to get the address details. An handle to this type will be given to the |
|
29 * user through MReverseGeocodeObserver::ReverseGeocodeComplete callback, through which |
|
30 * user can retrieve the address details using the following interfaces. |
|
31 * |
|
32 **/ |
|
33 class MAddressInfo |
|
34 { |
|
35 public: |
|
36 /* |
|
37 * Gets the reference to the country name. Scope of this returned reference is limited to |
|
38 * this perticular call. User has to store it for their further processing. |
|
39 * |
|
40 * @return reference to the String which holds the Country Name. |
|
41 */ |
|
42 virtual TDesC& GetCountryName()= 0; |
|
43 |
|
44 /* |
|
45 * Gets the reference to the State. Scope of this returned reference is limited to |
|
46 * this perticular call. User has to store it for their further processing. |
|
47 * |
|
48 * @return reference to the String which holds the State name. |
|
49 */ |
|
50 virtual TDesC& GetState()= 0; |
|
51 |
|
52 /* |
|
53 * Gets the reference to the City. Scope of this returned reference is limited to |
|
54 * this perticular call. User has to store it for their further processing. |
|
55 * |
|
56 * @return reference to the String which holds the City Name. |
|
57 */ |
|
58 virtual TDesC& GetCity()= 0; |
|
59 |
|
60 /* |
|
61 * Gets the reference to the District name. Scope of this returned reference is limited to |
|
62 * this perticular call. User has to store it for their further processing. |
|
63 * |
|
64 * @return reference to the String which holds the District Name. |
|
65 */ |
|
66 virtual TDesC& GetDistrict()= 0; |
|
67 |
|
68 /* |
|
69 * Gets the reference to the postal code. Scope of this returned reference is limited to |
|
70 * this perticular call. User has to store it for their further processing. |
|
71 * |
|
72 * @return reference to the String which holds the postal code. |
|
73 */ |
|
74 virtual TDesC& GetPincode()= 0; |
|
75 |
|
76 /* |
|
77 * Gets the reference to the thoroughfare name. Scope of this returned reference is limited to |
|
78 * this perticular call. User has to store it for their further processing. |
|
79 * |
|
80 * @return reference to the String which holds the thoroughfare name. |
|
81 */ |
|
82 virtual TDesC& GetThoroughfareName()= 0; |
|
83 |
|
84 /* |
|
85 * Gets the reference to the thoroughfare number. Scope of this returned reference is limited to |
|
86 * this perticular call. User has to store it for their further processing. |
|
87 * |
|
88 * @return reference to the String which holds the thoroughfare number. |
|
89 */ |
|
90 virtual TDesC& GetThoroughfareNumber() = 0; |
|
91 }; |
|
92 |
|
93 /* |
|
94 * Observer class which exposes callbacks to notify the completion of reversegeocoding event. |
|
95 * |
|
96 **/ |
|
97 class MReverseGeocodeObserver |
|
98 { |
|
99 public: |
|
100 /* |
|
101 * Callback function which notifys the completion of reverse geocode event. This signals the completion |
|
102 * of the asynchronous function CReverseGeoCode::GetAddressByCoordinate. |
|
103 * |
|
104 * @param aErrorcode Error status KErrNone in case of success or other system specific errorcodes |
|
105 * in case of failures. |
|
106 * |
|
107 * @param aAddressInfo refrence to the address stucture, through which user can access the |
|
108 * address information. |
|
109 */ |
|
110 |
|
111 virtual void ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo ) =0; |
|
112 |
|
113 /* |
|
114 * Get registrer network country code |
|
115 * |
|
116 * @return current register n/w info |
|
117 */ |
|
118 virtual RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw() = 0; |
|
119 |
|
120 |
|
121 /* |
|
122 * UE is registered to home network? |
|
123 * |
|
124 * @return ETrue if UE is registered at home network else EFalse |
|
125 */ |
|
126 virtual TBool IsRegisteredAtHomeNetwork() = 0; |
|
127 |
|
128 /* |
|
129 * Get home network country code |
|
130 * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse |
|
131 * @return user home n/w info |
|
132 */ |
|
133 virtual const RMobilePhone::TMobilePhoneNetworkInfoV1& |
|
134 GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) = 0; |
|
135 }; |
|
136 |
|
137 /* |
|
138 * CReverseGeocode |
|
139 * Concrete class which exposes interfaces to convert the geo-coordinates information |
|
140 * in to the address information. |
|
141 * |
|
142 **/ |
|
143 class CReverseGeocode : public CBase |
|
144 { |
|
145 public: |
|
146 /* |
|
147 * Factory function to create the instance of CReverseGeocode Class. This also registers |
|
148 * observer for getting the reverse geocode completion notifications. |
|
149 * |
|
150 * @param aObserver refrence to the instance MReverseGeocodeObserver's |
|
151 * implementation class. |
|
152 * @return pointer to the instance of CReverseGeocode. |
|
153 */ |
|
154 IMPORT_C static CReverseGeocode* NewL( MReverseGeocodeObserver& aObserver ); |
|
155 |
|
156 /* |
|
157 * Gets the address information for the given geo coordinates. This is an asynchronous function |
|
158 * Whose completion will be notified by the MReverseGeocodeObserver::ReverseGeocodeComplete callback. |
|
159 * |
|
160 * @param aObserver refrence to the instance MReverseGeocodeObserver's |
|
161 * implementation class. |
|
162 */ |
|
163 virtual void GetAddressByCoordinateL( TLocality aLocality, |
|
164 const TConnectionOption aOption = ESilent ) = 0; |
|
165 |
|
166 /* |
|
167 * checks if silent connection is allowed |
|
168 * @return ETrue if silent connection is allowed |
|
169 */ |
|
170 virtual TBool SilentConnectionAllowed() = 0; |
|
171 }; |
|
172 |
|
173 #endif /* REVERSEGEOCODE_H_ */ |