1 /* |
|
2 * Copyright (c) 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: Application's adapter class to Map and Navigation use cases |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CEVTMGMTUIMAPNAVIGATIONADAPTER_H |
|
20 #define CEVTMGMTUIMAPNAVIGATIONADAPTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <AiwCommon.h> |
|
24 #include <e32std.h> |
|
25 |
|
26 class CAiwServiceHandler; |
|
27 class CPosLandmark; |
|
28 |
|
29 class MEvtMgmtUiMapAndNavigationObserver |
|
30 { |
|
31 public: |
|
32 /** |
|
33 * It will be used to notify observer that map operation |
|
34 * has been completed. |
|
35 * @param aPlace place retrieved from map |
|
36 * @param aErrorCode It will contain the status of the operation |
|
37 * KErrNone if successful otherwise error status code |
|
38 */ |
|
39 virtual void HandleMapAndNavigationResponseL(TInt aErrorCode, const TPtrC aPlace, TCoordinate aTriggerLocation )=0; |
|
40 }; |
|
41 |
|
42 |
|
43 |
|
44 /** |
|
45 * The class CEvtMgmtUiMapNavigationAdapter contains the implemenation |
|
46 * for all the uses cases of Map and Navigation. |
|
47 * Functionality: |
|
48 * To check map service providers |
|
49 * To show location on map |
|
50 * To navigate to the location |
|
51 * To retrieve location from map |
|
52 */ |
|
53 |
|
54 class CEvtMgmtUiMapNavigationAdapter : public CBase, |
|
55 public MAiwNotifyCallback |
|
56 { |
|
57 |
|
58 public: // Constructors and destructor |
|
59 /** |
|
60 * Symbian 1st phase static constructor. |
|
61 * |
|
62 */ |
|
63 static CEvtMgmtUiMapNavigationAdapter* NewL(); |
|
64 |
|
65 /** |
|
66 * Symbian 1st phase static constructor. |
|
67 * Leaves the constructed object on Cleanup Stack. |
|
68 */ |
|
69 static CEvtMgmtUiMapNavigationAdapter* NewLC(); |
|
70 /** |
|
71 * Destructor. |
|
72 */ |
|
73 ~CEvtMgmtUiMapNavigationAdapter(); |
|
74 |
|
75 public: // New methods |
|
76 |
|
77 /** |
|
78 * This method is called for the get landmarks from map use case. |
|
79 * |
|
80 * @since S60 v9.1 |
|
81 */ |
|
82 void PlaceFromMapL(); |
|
83 |
|
84 /** |
|
85 * It will return place value recieved from map. |
|
86 * |
|
87 * @since S60 v9.1 |
|
88 * |
|
89 * @ret selected place |
|
90 */ |
|
91 TPtrC Place() const; |
|
92 |
|
93 /** |
|
94 * It will return total map service providers. |
|
95 * |
|
96 * @since S60 v9.1 |
|
97 * |
|
98 * @ret total number of map service providers |
|
99 */ |
|
100 TInt MapServiceProvidersL(); |
|
101 |
|
102 /** |
|
103 * It will show location on map |
|
104 * |
|
105 * @since S60 v9.1 |
|
106 */ |
|
107 void ShowOnMapL(); |
|
108 |
|
109 /** |
|
110 * It will navigate to location |
|
111 * |
|
112 * @since S60 v9.1 |
|
113 */ |
|
114 void NavigateToPlaceL(); |
|
115 |
|
116 /** |
|
117 * It will set observer to notify completion of map operation |
|
118 * |
|
119 * @since S60 v9.1 |
|
120 * |
|
121 * @param [in] aObserver - observer to notify completion of map operation |
|
122 */ |
|
123 void SetObserver( MEvtMgmtUiMapAndNavigationObserver* aObserver ); |
|
124 |
|
125 /** |
|
126 * It will set place |
|
127 * |
|
128 * @since S60 v9.1 |
|
129 * |
|
130 * @param [in] aPlace - place of existing event |
|
131 * - empty for newly created event |
|
132 */ |
|
133 void SetPlaceL( const TPtrC& aPlace ); |
|
134 |
|
135 /** |
|
136 * It will set location |
|
137 * |
|
138 * @since S60 v9.1 |
|
139 * |
|
140 * param[in] aTriggerLocation - location of trigger of existing event |
|
141 * - NaN for newly created event |
|
142 */ |
|
143 void SetLocation( TCoordinate aTriggerLocation ); |
|
144 |
|
145 public: // from MAiwNotifyCallback |
|
146 /** |
|
147 * The callback function for the get landmark from map use case |
|
148 * This function gets a callback once the user selects a location |
|
149 * from map to save as a landmark. |
|
150 */ |
|
151 TInt HandleNotifyL( TInt aCmdId, |
|
152 TInt aEventId, |
|
153 CAiwGenericParamList &aEventParamList, |
|
154 const CAiwGenericParamList &aInParamList ); |
|
155 |
|
156 private: |
|
157 /** |
|
158 * C++ default constructor. |
|
159 */ |
|
160 CEvtMgmtUiMapNavigationAdapter(); |
|
161 |
|
162 /** |
|
163 * Symbian 2nd phase constructor. |
|
164 */ |
|
165 void ConstructL(); |
|
166 |
|
167 private: // Private functions |
|
168 |
|
169 /** |
|
170 * It will set place details from landmark recieved from map |
|
171 * |
|
172 * @since S60 v9.1 |
|
173 * |
|
174 * @param[in] aLandmark - landmark selected on map |
|
175 */ |
|
176 void SetPlaceFromLandmarkL( CPosLandmark& aLandmark ); |
|
177 |
|
178 private: // Data |
|
179 // Owns : Pointer to AIW service handler to send service commands |
|
180 CAiwServiceHandler* iAiwServiceHandler; |
|
181 |
|
182 // Owns : Generic parameter input list |
|
183 CAiwGenericParamList* iInList; |
|
184 |
|
185 // Owns : Generic parameter output list |
|
186 CAiwGenericParamList* iOutList; |
|
187 |
|
188 // Owns : place details |
|
189 HBufC* iPlace; |
|
190 |
|
191 // Does not own : observer to notify completion of map operation |
|
192 MEvtMgmtUiMapAndNavigationObserver* iObserver; |
|
193 |
|
194 // trigger location of the event |
|
195 TCoordinate iTriggerLocation ; |
|
196 }; |
|
197 |
|
198 #endif //CEVTMGMTUIMAPNAVIGATIONADAPTER_H |
|
199 |
|
200 // End of file |
|
201 |
|