|
1 /* |
|
2 * Copyright (c) 2004-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: |
|
15 * See class description below |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __LANDMARKS_VIEW_H__ |
|
21 #define __LANDMARKS_VIEW_H__ |
|
22 |
|
23 #include <aknview.h> |
|
24 #include <EPos_Landmarks.h> |
|
25 |
|
26 class CPosLandmark; |
|
27 |
|
28 class CLandmarksApplicationEngine; |
|
29 class CAknNavigationDecorator; |
|
30 class CLandmarksContainer; |
|
31 class CLandmarksEngine; |
|
32 |
|
33 /** |
|
34 * CLandmarksView is the view displaying list of landmarks |
|
35 */ |
|
36 class CLandmarksView: public CAknView |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * |
|
43 * @param aNaviDecorator the navigation decorator displaying the tabs |
|
44 * @param aEngine the engine used for fetching category data. |
|
45 */ |
|
46 static CLandmarksView* NewLC( |
|
47 CAknNavigationDecorator* aNaviDecorator, |
|
48 CLandmarksApplicationEngine& aEngine); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 ~CLandmarksView(); |
|
54 |
|
55 public: // from CAknView |
|
56 |
|
57 /** |
|
58 * Id Identity of this view to the system. |
|
59 * |
|
60 * @return the ID of this view |
|
61 */ |
|
62 TUid Id() const; |
|
63 |
|
64 /** |
|
65 * HandleCommandL handles user menu selections. |
|
66 * |
|
67 * @param aCommand the enumerated code for the option selected |
|
68 */ |
|
69 void HandleCommandL(TInt aCommand); |
|
70 |
|
71 /** |
|
72 * DoActivateL is responsible for activating this view. |
|
73 * |
|
74 * @param aPrevViewId The id of the previous view |
|
75 * @param aCustomMessageId message identifier |
|
76 * @param aCustomMessage custom message provided when the view is changed |
|
77 */ |
|
78 void DoActivateL( |
|
79 const TVwsViewId& aPrevViewId, |
|
80 TUid aCustomMessageId, |
|
81 const TDesC8& aCustomMessage); |
|
82 |
|
83 /** |
|
84 * DoDeactivate is responsible for deactivating this view. |
|
85 */ |
|
86 void DoDeactivate(); |
|
87 |
|
88 /** |
|
89 * DynInitMenuPaneL initializes the menu pane before it is displayed. |
|
90 * |
|
91 * @param aResourceId a resource ID indetifying the menu bar containing |
|
92 * the menu pane to be initialized. |
|
93 * @param aMenuPane the menu pane to initialize. |
|
94 */ |
|
95 void DynInitMenuPaneL( |
|
96 TInt aResourceId, |
|
97 CEikMenuPane* aMenuPane); |
|
98 |
|
99 /** Forwards resource change event to container. Used for |
|
100 * layout change handling */ |
|
101 void HandleResourceChange( TInt aType ); |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * C++ constructor. |
|
107 * |
|
108 * @param aNaviDecorator the navigation decorator displaying the tabs |
|
109 * @param aEngine the engine used for fetching categories data. |
|
110 */ |
|
111 CLandmarksView( |
|
112 CAknNavigationDecorator* aNaviDecorator, |
|
113 CLandmarksApplicationEngine& aEngine); |
|
114 |
|
115 /** |
|
116 * By default Symbian 2nd phase constructor is private. |
|
117 */ |
|
118 void ConstructL(); |
|
119 |
|
120 /** |
|
121 * Launches a landmark edit dialog and adds a landmark to the database. |
|
122 * |
|
123 * @param aUseCurrentLocation ETrue if the landmark will be based on |
|
124 * current location. EFalse if no location should be predefined. |
|
125 */ |
|
126 void AddLandmarkL(TBool aUseCurrentLocation); |
|
127 |
|
128 /** Opens landmark editor for editing given landmark |
|
129 * \param aLandmark The lanndmark to be edited |
|
130 * \param aFetchCurrentLocation ETrue if the landmark location |
|
131 * shall be updated with current location |
|
132 */ |
|
133 TBool EditNewLandmarkL( CPosLandmark& aLandmark, TBool aFetchCurrentLocation ); |
|
134 |
|
135 private: // Data |
|
136 |
|
137 //! The container containing the graphical components of the view |
|
138 CLandmarksContainer* iContainer; |
|
139 |
|
140 //! The application engine used for modifying categories |
|
141 CLandmarksApplicationEngine& iEngine; |
|
142 |
|
143 //! Decorates the navi pane (with navigation arrows etc) |
|
144 CAknNavigationDecorator* iNaviDecorator; |
|
145 |
|
146 }; |
|
147 |
|
148 |
|
149 #endif // __LANDMARKS_VIEW_H__ |
|
150 |