|
1 /* |
|
2 * Copyright (c) 2005-2007 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 : |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef STUBPBK2APPUI_H |
|
22 #define STUBPBK2APPUI_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <MPbk2AppUi.h> |
|
26 #include <e32base.h> |
|
27 #include <MPbk2ApplicationServices.h> |
|
28 #include <MPbk2CommandHandler.h> |
|
29 |
|
30 // CLASS DECLARATION |
|
31 class CPbk2ServiceManager; |
|
32 |
|
33 /** |
|
34 * Phonebook 2 application UI interface. |
|
35 */ |
|
36 class CPbk2AppUiStub : public CBase, public MPbk2AppUi |
|
37 { |
|
38 public: // Interface |
|
39 |
|
40 CPbk2AppUiStub(); |
|
41 |
|
42 ~CPbk2AppUiStub(); |
|
43 |
|
44 /** |
|
45 * Returns the currently active view. |
|
46 * |
|
47 * @return Active view. |
|
48 */ |
|
49 CPbk2AppViewBase* ActiveView() const ; |
|
50 |
|
51 /** |
|
52 * Returns the Phonebook 2 view explorer if it exists. |
|
53 * |
|
54 * @return View explorer. |
|
55 */ |
|
56 MPbk2ViewExplorer* Pbk2ViewExplorer() const ; |
|
57 |
|
58 /** |
|
59 * Returns the Phonebook 2 startup monitor. |
|
60 * |
|
61 * @return Startup monitor. |
|
62 */ |
|
63 MPbk2StartupMonitor* Pbk2StartupMonitor() const ; |
|
64 |
|
65 /** |
|
66 * Returns Phonebook 2 tab group container. |
|
67 * |
|
68 * @return Tab group container. |
|
69 */ |
|
70 CPbk2TabGroupContainer* TabGroups() const ; |
|
71 |
|
72 /** |
|
73 * Returns Phonebook 2 key event handler. |
|
74 * |
|
75 * @return Key event handler. |
|
76 */ |
|
77 MPbk2KeyEventHandler& KeyEventHandler() ; |
|
78 |
|
79 /** |
|
80 * Returns Phonebook 2 application services. |
|
81 * |
|
82 * @return Application services. |
|
83 */ |
|
84 MPbk2ApplicationServices& ApplicationServices() const ; |
|
85 |
|
86 /** |
|
87 * Handles a command. If Phonebook 2 command handler does not |
|
88 * handle a command it can then be passed to application UI |
|
89 * command handler which ultimately handles it. |
|
90 * For example, exit command is handled by |
|
91 * application UI not by command handler. |
|
92 * |
|
93 * @return Id of the command to handle. |
|
94 */ |
|
95 void HandleCommandL( |
|
96 TInt aCommand ) ; |
|
97 |
|
98 /** |
|
99 * Exits application. |
|
100 */ |
|
101 void ExitApplication() ; |
|
102 }; |
|
103 |
|
104 |
|
105 |
|
106 // CLASS DECLARATION |
|
107 |
|
108 /** |
|
109 * Phonebook 2 application services interface. |
|
110 * Shares commonly used objects. |
|
111 */ |
|
112 class CPbk2ApplicationServicesStub : public MPbk2ApplicationServices |
|
113 { |
|
114 public: // Interface |
|
115 |
|
116 CPbk2ApplicationServicesStub(); |
|
117 |
|
118 ~CPbk2ApplicationServicesStub(); |
|
119 |
|
120 /** |
|
121 * Returns Virtual Phonebook contact manager. |
|
122 * |
|
123 * @return Virtual Phonebook contact manager. |
|
124 */ |
|
125 CVPbkContactManager& ContactManager() const ; |
|
126 |
|
127 /** |
|
128 * Returns Phonebook 2 command handler, which handles |
|
129 * all the commands. |
|
130 * |
|
131 * @return Phonebook 2 command handler. |
|
132 */ |
|
133 MPbk2CommandHandler* CommandHandlerL() ; |
|
134 |
|
135 /** |
|
136 * Returns the name formatter object. |
|
137 * |
|
138 * @return Phonebook 2 name formatter. |
|
139 */ |
|
140 MPbk2ContactNameFormatter& NameFormatter() const ; |
|
141 |
|
142 /** |
|
143 * Returns the sort order manager. |
|
144 * |
|
145 * @return Sort order manager. |
|
146 */ |
|
147 CPbk2SortOrderManager& SortOrderManager() const ; |
|
148 |
|
149 /** |
|
150 * Returns Phonebook 2 global send UI. |
|
151 * |
|
152 * @return SendUi instance. |
|
153 */ |
|
154 CSendUi* SendUiL() ; |
|
155 |
|
156 /** |
|
157 * Returns store property array. |
|
158 * |
|
159 * @return Store property array. |
|
160 */ |
|
161 CPbk2StorePropertyArray& StoreProperties() const ; |
|
162 |
|
163 /** |
|
164 * Returns Phonebook 2 field properties. |
|
165 * |
|
166 * @return Phonebook 2 field properties. |
|
167 */ |
|
168 CPbk2FieldPropertyArray& FieldProperties() const ; |
|
169 |
|
170 /** |
|
171 * Returns Phonebook 2 store configuration. |
|
172 * |
|
173 * @return Phonebook 2 store configuration. |
|
174 */ |
|
175 CPbk2StoreConfiguration& StoreConfiguration() const ; |
|
176 |
|
177 /** |
|
178 * Returns Phonebook 2 contact store observation register. |
|
179 * |
|
180 * @return Phonebook 2 store observation register. |
|
181 */ |
|
182 MPbk2StoreObservationRegister& |
|
183 StoreObservationRegister() const ; |
|
184 |
|
185 /** |
|
186 * Returns Phonebook 2 contact store validity informer. |
|
187 * |
|
188 * @return Phonebook 2 store validity informer. |
|
189 */ |
|
190 MPbk2StoreValidityInformer& |
|
191 StoreValidityInformer() const ; |
|
192 |
|
193 /** |
|
194 * Returns Phonebook 2 view supplier. |
|
195 * |
|
196 * @return Phonebook 2 view supplier. |
|
197 */ |
|
198 MPbk2ContactViewSupplier& ViewSupplier() const ; |
|
199 |
|
200 /** |
|
201 * Returns global menu filtering flags. |
|
202 * |
|
203 * @return Global menu filtering flags. |
|
204 */ |
|
205 TInt GlobalMenuFilteringFlagsL() const ; |
|
206 |
|
207 /** |
|
208 * Returns service manager. |
|
209 * |
|
210 * @return Service manager. |
|
211 */ |
|
212 CPbk2ServiceManager& ServiceManager() const ; |
|
213 |
|
214 |
|
215 }; |
|
216 |
|
217 |
|
218 /** |
|
219 * Phonebook 2 command handler interface. |
|
220 */ |
|
221 class CPbk2CommandHandlerStub : public MPbk2CommandHandler |
|
222 { |
|
223 public: // Interface |
|
224 |
|
225 CPbk2CommandHandlerStub(); |
|
226 |
|
227 ~CPbk2CommandHandlerStub(); |
|
228 /** |
|
229 * Handles Phonebook 2 commands. |
|
230 * |
|
231 * @param aCommandId The id of the command to handle. |
|
232 * @param aControl The UI control of the calling view. |
|
233 * @param aAppView Application view from where |
|
234 * the command is launched. |
|
235 * @return ETrue if the command was handled, EFalse otherwise. |
|
236 */ |
|
237 TBool HandleCommandL( |
|
238 const TInt aCommandId, |
|
239 MPbk2ContactUiControl& aControl, |
|
240 const CPbk2AppViewBase* aAppView ) ; |
|
241 |
|
242 /** |
|
243 * Performs Phonebook 2 menu filtering. |
|
244 * |
|
245 * @param aResourceId Resource id of the filtered menu pane. |
|
246 * @param aMenuPane Menu pane to be filtered. |
|
247 * @param aViewBase Application view where the filtering |
|
248 * takes place. |
|
249 * @param aControl The UI control of the calling view. |
|
250 */ |
|
251 void DynInitMenuPaneL( |
|
252 TInt aResourceId, |
|
253 CEikMenuPane* aMenuPane, |
|
254 CPbk2AppViewBase& aViewBase, |
|
255 MPbk2ContactUiControl& aControl ) ; |
|
256 |
|
257 /** |
|
258 * Registers (attaches) to an AIW service. |
|
259 * |
|
260 * @param aInterestId Id of the AIW interest. |
|
261 * @param aMenuResourceId Resource id of the menu to |
|
262 * attach to the AIW interest. |
|
263 * @param aInterestResourceId Resource id of the AIW interest. |
|
264 * @param aAttachBaseService If ETrue, attaches the AIW |
|
265 * resource id to the AIW base |
|
266 * service also. This enables command |
|
267 * handling via AIW without menus. |
|
268 */ |
|
269 void RegisterAiwInterestL( |
|
270 const TInt aInterestId, |
|
271 const TInt aMenuResourceId, |
|
272 const TInt aInterestResourceId, |
|
273 const TBool aAttachBaseService ) ; |
|
274 |
|
275 /** |
|
276 * Returns the AIW service command id associated to |
|
277 * given menu command. If found, it means that there is a |
|
278 * provider which can handle the menu command. |
|
279 * |
|
280 * @see CAiwServiceHandler::ServiceCmdByMenuCmd |
|
281 * @param aMenuCmdId Menu command id to inspect. |
|
282 * @return Service command id or KAiwCmdNone. |
|
283 */ |
|
284 TInt ServiceCmdByMenuCmd( |
|
285 TInt aMenuCmdId ) const ; |
|
286 |
|
287 /** |
|
288 * Adds the command into the Phonebook 2 command store and executes it. |
|
289 * Takes the ownership of the command. |
|
290 * |
|
291 * @param aCommand The command to be executed. |
|
292 */ |
|
293 void AddAndExecuteCommandL( |
|
294 MPbk2Command* aCommand ) ; |
|
295 |
|
296 /** |
|
297 * Adds a menu command observer. |
|
298 * |
|
299 * @param aObserver Menu command observer to add. |
|
300 */ |
|
301 void AddMenuCommandObserver( |
|
302 MPbk2MenuCommandObserver& aObserver ) ; |
|
303 |
|
304 /** |
|
305 * Removes a menu command observer. |
|
306 * |
|
307 * @param aObserver Menu command observer to remove. |
|
308 */ |
|
309 void RemoveMenuCommandObserver( |
|
310 MPbk2MenuCommandObserver& aObserver ) ; |
|
311 |
|
312 /** |
|
313 * Initialises toolbar before it is drawn. |
|
314 * |
|
315 * @param aResourceId The resource id of the toolbar. |
|
316 * @param aToolbar The toolbar object. |
|
317 * @param aAppView Application view from where |
|
318 * the command is launched. |
|
319 * @param aControl The UI control of the calling view. |
|
320 */ |
|
321 void DynInitToolbarL( |
|
322 TInt aResourceId, |
|
323 CAknToolbar* aToolbar, |
|
324 const CPbk2AppViewBase& aAppView, |
|
325 MPbk2ContactUiControl& aControl ) ; |
|
326 |
|
327 /** |
|
328 * Handles toolbar events for a certain toolbar item. |
|
329 * |
|
330 * @param aCommand The command id of the toolbar item. |
|
331 * @param aControl The UI control of the calling view. |
|
332 * @param aAppView Application view from where |
|
333 * the command is launched. |
|
334 */ |
|
335 void OfferToolbarEventL( |
|
336 TInt aCommand, |
|
337 MPbk2ContactUiControl& aControl, |
|
338 const CPbk2AppViewBase* aAppView ) ; |
|
339 |
|
340 |
|
341 }; |
|
342 |
|
343 #endif // STUBPBK2APPUI_H |
|
344 |
|
345 |
|
346 // End of File |