|
1 /* |
|
2 * Copyright (c) 2005 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: Active class to launch the map and listen for user selection |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __LOCATIONACTIVESELECTOR_H__ |
|
20 #define __LOCATIONACTIVESELECTOR_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include "calenselectionobserver.h" |
|
24 #include <mnprovider.h> |
|
25 #include <AknServerApp.h> // MAknServerAppExitObserver |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CMnMapView; |
|
29 class TPosition; |
|
30 class CPosLandmark; |
|
31 class CCalenGlobalData; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * The asynchronous operation handler class to launch the map |
|
36 * |
|
37 */ |
|
38 class CCalenLocationActiveSelector : public CActive |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Symbian 1st phase construction |
|
43 * @param aObserver Observer to callback once user selects the location |
|
44 */ |
|
45 static CCalenLocationActiveSelector* NewL(MCalenSelectionObserver& aObserver, |
|
46 MAknServerAppExitObserver& aExitObserver, |
|
47 CCalenGlobalData& aGlobalData); |
|
48 |
|
49 /** |
|
50 * Destructor |
|
51 */ |
|
52 ~CCalenLocationActiveSelector(); |
|
53 |
|
54 // CActive-related methods |
|
55 /** |
|
56 * RunL method to handle the user selection |
|
57 */ |
|
58 void RunL(); |
|
59 |
|
60 /** |
|
61 * Cancel method to handle the user selection |
|
62 */ |
|
63 void DoCancel(); |
|
64 |
|
65 /** |
|
66 * Function to handle any errors in async request |
|
67 * @param aError Error Code |
|
68 */ |
|
69 TInt RunError( TInt aError ); |
|
70 |
|
71 /** |
|
72 * Initiates selection operation |
|
73 * @param aProvider Map Provider |
|
74 * aPosition Current position |
|
75 */ |
|
76 void SelectL( CMnProvider& aProvider, |
|
77 TPosition& aPosition, |
|
78 TBool isLaunchedFromEditors); |
|
79 |
|
80 /** |
|
81 * Initiates selection operation |
|
82 * @param aProvider Map Provider |
|
83 */ |
|
84 void SelectL( CMnProvider& aProvider, |
|
85 CPosLandmark* aLandmarkToShow); |
|
86 |
|
87 /** |
|
88 * Disconnects from provider, when operation is completed |
|
89 */ |
|
90 void Reset(); |
|
91 |
|
92 /** |
|
93 * Reads all the landmarks from all the available databases in the system |
|
94 */ |
|
95 void RetrieveAndAddLandMarksL(CMnMapView* aMapView, |
|
96 TBool isLaunchedFromEditors); |
|
97 |
|
98 private: |
|
99 /** |
|
100 * C++ constructor |
|
101 * @param aObserver Observer to callback once user selects the location |
|
102 */ |
|
103 CCalenLocationActiveSelector( MCalenSelectionObserver& aObserver, |
|
104 MAknServerAppExitObserver& aExitObserver, |
|
105 CCalenGlobalData& aGlobalData ); |
|
106 |
|
107 /** |
|
108 * Symbian 2nd phase constructor |
|
109 */ |
|
110 void ConstructL(); |
|
111 |
|
112 private: |
|
113 MCalenSelectionObserver& iObserver; |
|
114 MAknServerAppExitObserver& iExitObserver; |
|
115 CMnMapView* iMapView; |
|
116 CCalenGlobalData& iGlobalData; |
|
117 }; |
|
118 |
|
119 #endif /* __LOCATIONACTIVESELECTOR_H__ */ |