1 /* |
|
2 * Copyright (c) 2007-2009 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: Bitmap manager for MRGUI usage. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "nmrbitmapmanager.h" |
|
19 #include "esmrhelper.h" |
|
20 |
|
21 #include <AknsItemID.h> |
|
22 #include <AknUtils.h> |
|
23 #include <AknsUtils.h> |
|
24 #include <esmrgui.mbg> |
|
25 #include <data_caging_path_literals.hrh> |
|
26 |
|
27 using namespace NMRBitmapManager; |
|
28 |
|
29 namespace { // codescanner::unnamednamespace |
|
30 |
|
31 // Icon mif file. |
|
32 _LIT( KESMRMifFile, "esmrgui.mif"); |
|
33 |
|
34 #ifdef _DEBUG |
|
35 |
|
36 // Definition for panic text |
|
37 _LIT( KNMRBitmapManager, "NMRBitmapManager" ); |
|
38 |
|
39 /** |
|
40 * ES MR Entry panic codes |
|
41 */ |
|
42 enum TNMRBitmapManager |
|
43 { |
|
44 KUnhandledBitmapId = 1 |
|
45 }; |
|
46 |
|
47 /** |
|
48 * Raises panic. |
|
49 * @param aPanic Panic code |
|
50 */ |
|
51 void Panic(TNMRBitmapManager aPanic) |
|
52 { |
|
53 User::Panic( KNMRBitmapManager, aPanic); |
|
54 } |
|
55 |
|
56 #endif // _DEBUG |
|
57 |
|
58 } |
|
59 |
|
60 // --------------------------------------------------------------------------- |
|
61 // NMRBitmapManager::GetBitmapStruct |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 EXPORT_C TMRBitmapStruct NMRBitmapManager::GetBitmapStruct( TMRBitmapId aBitmapId ) |
|
65 { |
|
66 TMRBitmapStruct bitmapStruct; |
|
67 |
|
68 switch ( aBitmapId ) |
|
69 { |
|
70 case EMRBitmapRightClickArrow: |
|
71 { |
|
72 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailArrowRight; |
|
73 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right; |
|
74 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right_mask; |
|
75 break; |
|
76 } |
|
77 case EMRBitmapTrackingAccept: |
|
78 { |
|
79 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingAccept; |
|
80 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_accept; |
|
81 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_accept_mask; |
|
82 break; |
|
83 } |
|
84 case EMRBitmapTrackingReject: |
|
85 { |
|
86 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingReject; |
|
87 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_reject; |
|
88 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_reject_mask; |
|
89 break; |
|
90 } |
|
91 case EMRBitmapTrackingTentative: |
|
92 { |
|
93 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingTentative; |
|
94 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_tentative; |
|
95 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_tentative_mask; |
|
96 break; |
|
97 } |
|
98 case EMRBitmapTrackingNone: |
|
99 { |
|
100 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingNone; |
|
101 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_none; |
|
102 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_none_mask; |
|
103 break; |
|
104 } |
|
105 case EMRBitmapPriorityHigh: |
|
106 { |
|
107 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarPriorityHigh; |
|
108 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_high; |
|
109 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_high_mask; |
|
110 break; |
|
111 } |
|
112 case EMRBitmapPriorityLow: |
|
113 { |
|
114 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarPriorityLow; |
|
115 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_low; |
|
116 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_low_mask; |
|
117 break; |
|
118 } |
|
119 case EMRBitmapPriorityNormal: |
|
120 { |
|
121 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarPriorityNormal; |
|
122 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_normal; |
|
123 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_normal_mask; |
|
124 break; |
|
125 } |
|
126 case EMRBitmapSynchronization: |
|
127 { |
|
128 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailSynchronisation; |
|
129 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_synchronisation; |
|
130 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_synchronisation_mask; |
|
131 break; |
|
132 } |
|
133 case EMRBitmapSubject: |
|
134 { |
|
135 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarSubject; |
|
136 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_subject; |
|
137 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_subject_mask; |
|
138 break; |
|
139 } |
|
140 case EMRBitmapOccasion: |
|
141 { |
|
142 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarOccasion; |
|
143 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_occasion; |
|
144 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_occasion_mask; |
|
145 break; |
|
146 } |
|
147 case EMRBitmapRecurrence: |
|
148 { |
|
149 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarRecurrence; |
|
150 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_recurrence; |
|
151 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_recurrence_mask; |
|
152 break; |
|
153 } |
|
154 case EMRBitmapBrowser: |
|
155 { |
|
156 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_menu_browserng; |
|
157 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_menu_browserng_mask; |
|
158 |
|
159 bitmapStruct.iItemId = KAknsIIDQgnMenuIntranet; //KAknsIIDQgnMenuBrowserng |
|
160 break; |
|
161 } |
|
162 case EMRBitmapIntranet: |
|
163 { |
|
164 bitmapStruct.iItemId = KAknsIIDQgnMenuIntranet; |
|
165 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_menu_intranet; |
|
166 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_menu_intranet_mask; |
|
167 break; |
|
168 } |
|
169 case EMRBitmapBookmark: |
|
170 { |
|
171 bitmapStruct.iItemId = KAknsIIDQgnPropCmailWmlBookmark; |
|
172 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_wml_bookmark; |
|
173 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_wml_bookmark_mask; |
|
174 break; |
|
175 } |
|
176 case EMRBitmapAlarm: |
|
177 { |
|
178 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqAlarm; |
|
179 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm; |
|
180 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm_mask; |
|
181 break; |
|
182 } |
|
183 case EMRBitmapAlarmDate: |
|
184 { |
|
185 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarAlarm; |
|
186 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm; |
|
187 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm_mask; |
|
188 break; |
|
189 } |
|
190 case EMRBitmapAlarmTime: |
|
191 { |
|
192 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarAlarm; |
|
193 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm; |
|
194 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm_mask; |
|
195 break; |
|
196 } |
|
197 case EMRBitmapAlarmClock: |
|
198 { |
|
199 // bitmapStruct.iItemId = KAknsIIDQgnIndiCalendarClockAlarm; |
|
200 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm; |
|
201 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm_mask; |
|
202 break; |
|
203 } |
|
204 case EMRBitmapCheckBoxOn: |
|
205 { |
|
206 bitmapStruct.iItemId = KAknsIIDQgnIndiCheckboxOn; |
|
207 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_checkbox_on; |
|
208 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_checkbox_on_mask; |
|
209 break; |
|
210 } |
|
211 case EMRBitmapCheckBoxOff: |
|
212 { |
|
213 bitmapStruct.iItemId = KAknsIIDQgnIndiCheckboxOff; |
|
214 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_checkbox_off; |
|
215 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_checkbox_off_mask; |
|
216 break; |
|
217 } |
|
218 case EMRBitmapClock: |
|
219 { |
|
220 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqClock; |
|
221 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock; |
|
222 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock_mask; |
|
223 break; |
|
224 } |
|
225 case EMRBitmapLocation: |
|
226 { |
|
227 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqLocation; |
|
228 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location; |
|
229 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location_mask; |
|
230 break; |
|
231 } |
|
232 case EMRBitmapDateStart: |
|
233 { |
|
234 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqDateStart; |
|
235 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start; |
|
236 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start_mask; |
|
237 break; |
|
238 } |
|
239 case EMRBitmapDateEnd: |
|
240 { |
|
241 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqDateEnd; |
|
242 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end; |
|
243 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end_mask; |
|
244 break; |
|
245 } |
|
246 case EMRBitmapAttachment: |
|
247 { |
|
248 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailAttachment; |
|
249 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_attachment; |
|
250 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_attachment_mask; |
|
251 break; |
|
252 } |
|
253 case EMRBitmapCtrlBar: |
|
254 { |
|
255 bitmapStruct.iItemId = KAknsIIDQgnGrafCmailEmailCtrlbar; |
|
256 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar; |
|
257 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar_mask; |
|
258 break; |
|
259 } |
|
260 |
|
261 case EMRBitmapListCenter: |
|
262 { |
|
263 bitmapStruct.iItemId = KAknsIIDQsnFrListCenter; |
|
264 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; |
|
265 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; |
|
266 break; |
|
267 } |
|
268 case EMRBitmapListTop: |
|
269 { |
|
270 bitmapStruct.iItemId = KAknsIIDQsnFrListSideT; |
|
271 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; |
|
272 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; |
|
273 break; |
|
274 } |
|
275 case EMRBitmapListBottom: |
|
276 { |
|
277 bitmapStruct.iItemId = KAknsIIDQsnFrListSideB; |
|
278 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; |
|
279 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; |
|
280 break; |
|
281 } |
|
282 case EMRBitmapListLeft: |
|
283 { |
|
284 bitmapStruct.iItemId = KAknsIIDQsnFrListSideL; |
|
285 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; |
|
286 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; |
|
287 break; |
|
288 } |
|
289 case EMRBitmapListRight: |
|
290 { |
|
291 bitmapStruct.iItemId = KAknsIIDQsnFrListSideR; |
|
292 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; |
|
293 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; |
|
294 break; |
|
295 } |
|
296 case EMRBitmapListTopLeft: |
|
297 { |
|
298 bitmapStruct.iItemId = KAknsIIDQsnFrListCornerTl; |
|
299 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; |
|
300 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; |
|
301 break; |
|
302 } |
|
303 case EMRBitmapListTopRight: |
|
304 { |
|
305 bitmapStruct.iItemId = KAknsIIDQsnFrListCornerTr; |
|
306 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; |
|
307 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; |
|
308 break; |
|
309 } |
|
310 case EMRBitmapListBottomLeft: |
|
311 { |
|
312 bitmapStruct.iItemId = KAknsIIDQsnFrListCornerBl; |
|
313 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; |
|
314 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; |
|
315 break; |
|
316 } |
|
317 case EMRBitmapListBottomRight: |
|
318 { |
|
319 bitmapStruct.iItemId = KAknsIIDQsnFrListCornerBr; |
|
320 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; |
|
321 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; |
|
322 break; |
|
323 } |
|
324 |
|
325 case EMRBitmapMailAttachment: |
|
326 { |
|
327 bitmapStruct.iItemId = KAknsIIDQgnFseMailAttachment; |
|
328 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_attachment; |
|
329 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_attachment_mask; |
|
330 break; |
|
331 } |
|
332 case EMRBitmapOpenAttachmentView: |
|
333 { |
|
334 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentListOptionsViewAll; |
|
335 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_list_options_view_all; |
|
336 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_list_options_view_all_mask; |
|
337 break; |
|
338 } |
|
339 case EMRBitmapOpenAttachment: |
|
340 { |
|
341 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentOpen; |
|
342 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_open; |
|
343 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_open_mask; |
|
344 break; |
|
345 } |
|
346 case EMRBitmapDownloadAttachment: |
|
347 { |
|
348 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentDownload; |
|
349 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download; |
|
350 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_mask; |
|
351 break; |
|
352 } |
|
353 case EMRBitmapDownloadAllAttachments: |
|
354 { |
|
355 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentDownloadAll; |
|
356 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_all; |
|
357 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_all_mask; |
|
358 break; |
|
359 } |
|
360 case EMRBitmapSaveAttachment: |
|
361 { |
|
362 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentSave; |
|
363 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save; |
|
364 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_mask; |
|
365 break; |
|
366 } |
|
367 case EMRBitmapSaveAllAttachments: |
|
368 { |
|
369 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentSaveAll; |
|
370 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_all; |
|
371 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_all_mask; |
|
372 break; |
|
373 } |
|
374 |
|
375 case EMRBitmapInputCenter: |
|
376 { |
|
377 bitmapStruct.iItemId = KAknsIIDQsnFrInputCenter; |
|
378 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; |
|
379 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; |
|
380 break; |
|
381 } |
|
382 case EMRBitmapInputTop: |
|
383 { |
|
384 bitmapStruct.iItemId = KAknsIIDQsnFrInputSideT; |
|
385 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; |
|
386 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; |
|
387 break; |
|
388 } |
|
389 case EMRBitmapInputBottom: |
|
390 { |
|
391 bitmapStruct.iItemId = KAknsIIDQsnFrInputSideB; |
|
392 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; |
|
393 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; |
|
394 break; |
|
395 } |
|
396 case EMRBitmapInputLeft: |
|
397 { |
|
398 bitmapStruct.iItemId = KAknsIIDQsnFrInputSideL; |
|
399 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; |
|
400 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; |
|
401 break; |
|
402 } |
|
403 case EMRBitmapInputRight: |
|
404 { |
|
405 bitmapStruct.iItemId = KAknsIIDQsnFrInputSideR; |
|
406 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; |
|
407 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; |
|
408 break; |
|
409 } |
|
410 case EMRBitmapInputTopLeft: |
|
411 { |
|
412 bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerTl; |
|
413 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; |
|
414 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; |
|
415 break; |
|
416 } |
|
417 case EMRBitmapInputTopRight: |
|
418 { |
|
419 bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerTr; |
|
420 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; |
|
421 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; |
|
422 break; |
|
423 } |
|
424 case EMRBitmapInputBottomLeft: |
|
425 { |
|
426 bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerBl; |
|
427 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; |
|
428 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; |
|
429 break; |
|
430 } |
|
431 case EMRBitmapInputBottomRight: |
|
432 { |
|
433 bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerBr; |
|
434 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; |
|
435 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; |
|
436 break; |
|
437 } |
|
438 |
|
439 case EMRBitmapSetOptCenter: |
|
440 { |
|
441 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCenter; |
|
442 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; |
|
443 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; |
|
444 break; |
|
445 } |
|
446 case EMRBitmapSetOptTop: |
|
447 { |
|
448 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideT; |
|
449 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; |
|
450 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; |
|
451 break; |
|
452 } |
|
453 case EMRBitmapSetOptBottom: |
|
454 { |
|
455 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideB; |
|
456 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; |
|
457 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; |
|
458 break; |
|
459 } |
|
460 case EMRBitmapSetOptLeft: |
|
461 { |
|
462 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideL; |
|
463 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; |
|
464 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; |
|
465 break; |
|
466 } |
|
467 case EMRBitmapSetOptRight: |
|
468 { |
|
469 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideR; |
|
470 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; |
|
471 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; |
|
472 break; |
|
473 } |
|
474 case EMRBitmapSetOptTopLeft: |
|
475 { |
|
476 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerTl; |
|
477 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; |
|
478 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; |
|
479 break; |
|
480 } |
|
481 case EMRBitmapSetOptTopRight: |
|
482 { |
|
483 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerTr; |
|
484 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; |
|
485 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; |
|
486 break; |
|
487 } |
|
488 case EMRBitmapSetOptBottomLeft: |
|
489 { |
|
490 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerBl; |
|
491 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; |
|
492 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; |
|
493 break; |
|
494 } |
|
495 case EMRBitmapSetOptBottomRight: |
|
496 { |
|
497 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerBr; |
|
498 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; |
|
499 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; |
|
500 break; |
|
501 } |
|
502 |
|
503 default: |
|
504 { |
|
505 // We shouldn't end up here. |
|
506 __ASSERT_DEBUG( EFalse, Panic( KUnhandledBitmapId ) ); |
|
507 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailArrowRight; |
|
508 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right; |
|
509 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right_mask; |
|
510 break; |
|
511 } |
|
512 } |
|
513 |
|
514 return bitmapStruct; |
|
515 } |
|
516 |
|
517 // --------------------------------------------------------------------------- |
|
518 // NMRBitmapManager::GetSkinBasedBitmap |
|
519 // --------------------------------------------------------------------------- |
|
520 // |
|
521 EXPORT_C TInt NMRBitmapManager::GetSkinBasedBitmap( |
|
522 TMRBitmapId aBitmapId, |
|
523 CFbsBitmap*& aBitmap, |
|
524 CFbsBitmap*& aMask, |
|
525 TSize aSize ) |
|
526 { |
|
527 TInt retValue = KErrNone; |
|
528 if( aBitmap ) |
|
529 { |
|
530 delete aBitmap; |
|
531 aBitmap = NULL; |
|
532 } |
|
533 if( aMask ) |
|
534 { |
|
535 delete aMask; |
|
536 aMask = NULL; |
|
537 } |
|
538 |
|
539 TMRBitmapStruct bitmapStruct = GetBitmapStruct( aBitmapId ); |
|
540 |
|
541 TFileName bitmapFilePath; |
|
542 ESMRHelper::LocateResourceFile( |
|
543 KESMRMifFile, |
|
544 KDC_APP_BITMAP_DIR, |
|
545 bitmapFilePath ); |
|
546 |
|
547 TRAPD( error, AknsUtils::CreateIconL( AknsUtils::SkinInstance(), |
|
548 bitmapStruct.iItemId, |
|
549 aBitmap, |
|
550 aMask, |
|
551 bitmapFilePath, |
|
552 bitmapStruct.iFallbackIndex, |
|
553 bitmapStruct.iFallbackMaskIndex ) ); |
|
554 |
|
555 if ( error != KErrNone ) |
|
556 { |
|
557 return error; |
|
558 } |
|
559 |
|
560 AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); |
|
561 |
|
562 if( !aBitmap || !aMask ) |
|
563 { |
|
564 retValue = KErrNotFound; |
|
565 } |
|
566 return retValue; |
|
567 } |
|
568 |
|