|
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_INFOCONTAINER_H__ |
|
21 #define __LANDMARKS_INFOCONTAINER_H__ |
|
22 |
|
23 |
|
24 #include <coecntrl.h> |
|
25 #include <EPos_Landmarks.h> |
|
26 #include "LandmarksInfoContainer.h" |
|
27 |
|
28 |
|
29 class CEikTextListBox; |
|
30 class CAknNavigationDecorator; |
|
31 class CAknTitlePane; |
|
32 class CAknView; |
|
33 class CLandmarksApplicationEngine; |
|
34 class CLandmarksInfoModel; |
|
35 class CPosLandmark; |
|
36 |
|
37 |
|
38 |
|
39 /** |
|
40 * This is the landmarks container that contains a listbox with landmark's |
|
41 * fields listed. |
|
42 */ |
|
43 class CLandmarksInfoContainer : public CCoeControl |
|
44 { |
|
45 public: // Constructors and destructor |
|
46 |
|
47 /** |
|
48 * C++ constructor. |
|
49 * |
|
50 * @param aView parent view |
|
51 * @param aEngine the landmark engine |
|
52 * @param aNaviDecorator the tab group to hide when editing landmarks |
|
53 */ |
|
54 CLandmarksInfoContainer( |
|
55 CAknView& aView, |
|
56 CLandmarksApplicationEngine& aEngine, |
|
57 CAknNavigationDecorator* aNaviDecorator); |
|
58 |
|
59 /** |
|
60 * Symbian 2nd phase constructor. Should be called after constructor to |
|
61 * fully construct the object. |
|
62 * |
|
63 * @param aRect the rectangle this Container will be drawn to |
|
64 */ |
|
65 void ConstructL(const TRect& aRect); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 ~CLandmarksInfoContainer(); |
|
71 |
|
72 public: // New functions |
|
73 |
|
74 /** Stores title pane */ |
|
75 void StoreTitlePaneL(); |
|
76 |
|
77 /** Retores title pane */ |
|
78 void RestoreTitlePane(); |
|
79 |
|
80 /** |
|
81 * Loads specified landmark into the container |
|
82 * @param aLandmarkId The ID of the landmark to be viewed. |
|
83 */ |
|
84 void LoadLandmarkL(TPosLmItemId aLandmarkId); |
|
85 |
|
86 /** |
|
87 * Launches a dialog for editing the current landmark. |
|
88 * Removes tabs on the navi pane before launching the dialog. Restores |
|
89 * the navi pane after the dialog is dismissed. |
|
90 */ |
|
91 void EditLandmarkL(); |
|
92 |
|
93 public: // from CoeControl |
|
94 |
|
95 /** |
|
96 * Gets the number of controls contained in a compound control |
|
97 * |
|
98 * @return Number of component controls |
|
99 */ |
|
100 TInt CountComponentControls() const; |
|
101 |
|
102 /** |
|
103 * Gets the specified component |
|
104 * |
|
105 * @param aIndex specification for component pointer |
|
106 * @return Pointer to component control |
|
107 */ |
|
108 CCoeControl* ComponentControl(TInt aIndex) const; |
|
109 |
|
110 /** |
|
111 * Called by framework when the view size is changed. |
|
112 */ |
|
113 void SizeChanged(); |
|
114 |
|
115 /** |
|
116 * Handles key events. |
|
117 * |
|
118 * @param aKeyEvent the key event |
|
119 * @param aType the type of key event |
|
120 * @return EKeyWasConsumed if keyevent was handled, EKeyWasNotConsumed |
|
121 * otherwise |
|
122 */ |
|
123 TKeyResponse OfferKeyEventL( |
|
124 const TKeyEvent& aKeyEvent, TEventCode aType); |
|
125 |
|
126 /** Reacts to screen size change */ |
|
127 void HandleResourceChange(TInt aType); |
|
128 |
|
129 private: |
|
130 |
|
131 /** |
|
132 * Creates the listbox. |
|
133 */ |
|
134 void CreateListBoxL(); |
|
135 |
|
136 /** |
|
137 * Updates the title bar from landmark name. |
|
138 */ |
|
139 void UpdateTitleBarL(); |
|
140 |
|
141 /** |
|
142 * Updates the view. |
|
143 */ |
|
144 void UpdateL(); |
|
145 |
|
146 private: // Data |
|
147 |
|
148 //! The control used to display landmark info. |
|
149 CEikTextListBox* iListBox; |
|
150 |
|
151 //! The parent view |
|
152 CAknView& iView; |
|
153 |
|
154 //! iEngine the application engine used for accessing landmarks |
|
155 CLandmarksApplicationEngine& iEngine; |
|
156 |
|
157 //! Decorates the navi pane (with navigation arrows etc) |
|
158 CAknNavigationDecorator* iNaviDecorator; |
|
159 |
|
160 //! The data model for the listbox |
|
161 CLandmarksInfoModel* iModel; |
|
162 |
|
163 //! The landmark being viewed |
|
164 CPosLandmark* iLandmark; |
|
165 |
|
166 //! The title pane that is dynamically updated |
|
167 CAknTitlePane* iTitlePane; |
|
168 |
|
169 //! The original title that the title pane displayed before modified |
|
170 HBufC* iOriginalTitle; |
|
171 |
|
172 //! Fields used in the list |
|
173 RArray<TInt> iFields; |
|
174 }; |
|
175 |
|
176 #endif // __LANDMARKS_INFOCONTAINER_H__ |