|
1 /* |
|
2 * Copyright (c) 2002-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: LandmarksUi Content File - |
|
15 * Base class for application's (view-based) selectors. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CLMKAPPSELECTORIMPLBASE_H |
|
26 #define CLMKAPPSELECTORIMPLBASE_H |
|
27 |
|
28 // INCLUDES |
|
29 #include "CLmkSelectorImplBase.h" |
|
30 #include <eikcmobs.h> |
|
31 #include <eikmenup.h> |
|
32 #include "landmarks.hrh" |
|
33 #include "MLmkMapAndNavigationObServer.h" |
|
34 |
|
35 #include <coecobs.h> |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CEikTextListBox; |
|
39 class CCoeControl; |
|
40 class CAknSearchField; |
|
41 class MLmkMskObserver; |
|
42 #ifdef RD_SCALABLE_UI_V2 |
|
43 class CAknListBoxFilterItems; |
|
44 #endif //RD_SCALABLE_UI_V2 |
|
45 // CLASS DECLARATION |
|
46 |
|
47 /** |
|
48 * Base class for application's (view-based) selectors. |
|
49 * |
|
50 */ |
|
51 class CLmkAppSelectorImplBase |
|
52 : public CLmkSelectorImplBase, |
|
53 public MEikCommandObserver, |
|
54 public MLmkMapAndNavigationObserver |
|
55 #ifdef RD_SCALABLE_UI_V2 |
|
56 ,public MCoeControlObserver |
|
57 #endif //RD_SCALABLE_UI_V2 |
|
58 { |
|
59 public: // Constructors and destructor |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 ~CLmkAppSelectorImplBase(); |
|
64 |
|
65 public: // New functions |
|
66 /** |
|
67 * Stores status to memento. |
|
68 * Can be used after memento has been set. |
|
69 */ |
|
70 IMPORT_C void StoreMemento(); |
|
71 |
|
72 /** |
|
73 * Restores status of a memento. If list is not ready yet then |
|
74 * restoration is postponed a while. |
|
75 * Can be used after memento has been set. |
|
76 */ |
|
77 IMPORT_C void RestoreMemento(); |
|
78 |
|
79 /** |
|
80 * Creates a list box. |
|
81 * Leaves with KErrNotSupported if wrong control type is given. |
|
82 * @param aParent parent for listbox control (usually container) |
|
83 * @param aControlType listbox type, i.e. EAknCt???ListBox |
|
84 * @param aFlags construction flags, e.g. EAknListBoxMarkableList |
|
85 * @param aEmptyLBResource empty listbox text |
|
86 * @return newly instantiated object |
|
87 */ |
|
88 virtual CEikTextListBox& CreateListBoxL( CCoeControl* aParent, |
|
89 TInt aControlType, |
|
90 TInt aFlags, |
|
91 TInt aEmptyLBPrimResource ,TInt aEmptyLBSecResource ); |
|
92 |
|
93 /** |
|
94 * When the screen size changes the event needs to be propagated |
|
95 * to UI components in the selector classes. This will be triggered |
|
96 * from the UI Container classes |
|
97 */ |
|
98 virtual void HandleScreenSizeChange(); |
|
99 |
|
100 IMPORT_C CAknSearchField* CreateFindBoxL(const CCoeControl &aParent); |
|
101 /** |
|
102 * IT returns an array of items marked. |
|
103 * @return Array of marked item Id's. |
|
104 */ |
|
105 IMPORT_C const CArrayFix<TInt>* MarkedIndexes(); |
|
106 |
|
107 /** |
|
108 * @return Returns the current item index |
|
109 */ |
|
110 IMPORT_C TInt CurrentItemIndex(); |
|
111 |
|
112 /** |
|
113 * Sets the observer, to be called , when MSK update is |
|
114 * required |
|
115 * @param aMskObserver reference |
|
116 */ |
|
117 IMPORT_C void SetMskObserver(MLmkMskObserver* aMskObserver); |
|
118 public: // From CLmkSelectorImpleBase |
|
119 TInt ListVisibleItemCount(); |
|
120 TInt ListMarkedItemCountL(); |
|
121 |
|
122 public: // From MLmkListProviderObserver |
|
123 void HandleListProviderEvent( TLmkListProviderEventType aEvent ); |
|
124 void HandleListProviderError( TInt aError ); |
|
125 |
|
126 public: //from MLmkMapAndNavigationObserver |
|
127 void HandleLmCreated(TPosLmItemId /*aNewLmkItemId*/){} |
|
128 |
|
129 public :// New Method |
|
130 CAknSearchField* FindBox(); |
|
131 |
|
132 protected: // New functions |
|
133 /** |
|
134 * Helper function for making empty title |
|
135 * @param aListbox, listbox instance |
|
136 * @param aResourceText, resourse id |
|
137 */ |
|
138 void MakeEmptyTextListBoxL( CEikTextListBox& aListBox, |
|
139 TInt aResourcePrimText, TInt aResourceSecText, |
|
140 TBool aRequestFromFindBox = EFalse ) const; |
|
141 |
|
142 |
|
143 /** |
|
144 * Helper function for creating and setting a listbox model |
|
145 * @param aListbox, listbox instance |
|
146 * @param aControlType, listbox control type |
|
147 * @param aProvider, engine for listbox model |
|
148 */ |
|
149 virtual void CreateListBoxModelL( CEikTextListBox& aListBox, |
|
150 TInt aControlType, |
|
151 CLmkListProviderBase& aProvider ) const; |
|
152 |
|
153 /** |
|
154 * Helper function which allows subclasses to handle ELmkEventListReady |
|
155 * in specific manner. By default list is reseted and redrawn. |
|
156 * @return ETrue if subclass handled the event, EFalse otherwise |
|
157 */ |
|
158 virtual TBool HandleEventListReadyL(); |
|
159 |
|
160 //Helper function to enable or disable find box |
|
161 void ShowFindBoxL( TBool aVisible ); |
|
162 |
|
163 public: // New functions |
|
164 /** |
|
165 * Following are the helper wrapper functions which allow |
|
166 * the Landmarks UI control libary clients to setup AIW services |
|
167 * for invoking phone call. This will be used by Landmarks App or |
|
168 * Landmarks Message Viewer app |
|
169 * |
|
170 */ |
|
171 |
|
172 virtual void AttachToAIWMenuL( TInt aMenuResourceId, |
|
173 TInt aInterestResourceId); |
|
174 |
|
175 virtual void InitializeMenuPaneL( CEikMenuPane& aMenuPane, |
|
176 TInt aMenuResourceId); |
|
177 |
|
178 virtual void ExecuteAIWCallCmdL( TInt aCommandId ); |
|
179 |
|
180 virtual TBool IsLmWithThisFieldExistL ( TLmkAppCmdId aFieldId); |
|
181 |
|
182 virtual void AttachInterestL ( TInt aInterestResourceId ); |
|
183 |
|
184 /** |
|
185 * This acts as a wrapper interface, but the actual |
|
186 * derive class implements the functionality to call |
|
187 * proper call service handler. |
|
188 */ |
|
189 virtual TInt ServiceCmdByMenuCmd( TInt aMenuCmd ); |
|
190 |
|
191 #ifdef RD_SCALABLE_UI_V2 |
|
192 protected: // from MCoeControlObserver |
|
193 void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType ); |
|
194 #endif //RD_SCALABLE_UI_V2 |
|
195 |
|
196 protected: // Constructors and destructor |
|
197 /** |
|
198 * C++ default constructor. |
|
199 * @param aDb reference |
|
200 * @param aFindBox |
|
201 * @return newly instantiated object |
|
202 */ |
|
203 CLmkAppSelectorImplBase( CPosLandmarkDatabase& aDb, |
|
204 TBool aFindBox ); |
|
205 |
|
206 /** |
|
207 * By default Symbian 2nd phase constructor is private. |
|
208 */ |
|
209 void BaseConstructL(); |
|
210 |
|
211 protected: // Data |
|
212 ///Own: |
|
213 CEikTextListBox* iListBox; |
|
214 |
|
215 TBool iFindBox; |
|
216 |
|
217 CAknSearchField* iSearchBox; |
|
218 // TInt iEmptyLBResource; |
|
219 TInt iEmptyLBPrimResource; |
|
220 TInt iEmptyLBSecResource; |
|
221 //ref |
|
222 MLmkMskObserver* iMskObserver; |
|
223 |
|
224 #ifdef RD_SCALABLE_UI_V2 |
|
225 CAknListBoxFilterItems* iFilter; |
|
226 #endif //RD_SCALABLE_UI_V2 |
|
227 |
|
228 TPosLmItemId iNewLmkItemId; |
|
229 }; |
|
230 |
|
231 #endif // CLMKAPPSELECTORIMPLBASE_H |
|
232 |
|
233 // End of File |