|
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::GetSkinBasedBitmap |
|
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 = KAknsIIDQgnIndiCmailActionArrowRight; |
|
73 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_action_arrow_right; |
|
74 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_action_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 // TODO: not available |
|
157 // bitmapStruct.iItemId = KAknsIIDQgnMenuBrowserng; |
|
158 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_menu_browserng; |
|
159 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_menu_browserng_mask; |
|
160 |
|
161 // TODO: remove me asap |
|
162 bitmapStruct.iItemId = KAknsIIDQgnMenuIntranet; |
|
163 break; |
|
164 } |
|
165 case EMRBitmapIntranet: |
|
166 { |
|
167 bitmapStruct.iItemId = KAknsIIDQgnMenuIntranet; |
|
168 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_menu_intranet; |
|
169 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_menu_intranet_mask; |
|
170 break; |
|
171 } |
|
172 case EMRBitmapBookmark: |
|
173 { |
|
174 bitmapStruct.iItemId = KAknsIIDQgnPropCmailWmlBookmark; |
|
175 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_wml_bookmark; |
|
176 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_wml_bookmark_mask; |
|
177 break; |
|
178 } |
|
179 case EMRBitmapAlarm: |
|
180 { |
|
181 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqAlarm; |
|
182 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm; |
|
183 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm_mask; |
|
184 break; |
|
185 } |
|
186 case EMRBitmapAlarmClock: |
|
187 { |
|
188 bitmapStruct.iItemId = KAknsIIDQgnIndiCalendarClockAlarm; |
|
189 // TODO: use new icon |
|
190 //bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_calendar_clock_alarm; |
|
191 //bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_calendar_clock_alarm_mask; |
|
192 |
|
193 // TODO: remove me asap, not in platform atm. |
|
194 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm; |
|
195 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm_mask; |
|
196 break; |
|
197 } |
|
198 case EMRBitmapCheckBoxOn: |
|
199 { |
|
200 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqCheckboxOn; |
|
201 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_on; |
|
202 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_on_mask; |
|
203 break; |
|
204 } |
|
205 case EMRBitmapCheckBoxOff: |
|
206 { |
|
207 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqCheckboxOff; |
|
208 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_off; |
|
209 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_off_mask; |
|
210 break; |
|
211 } |
|
212 case EMRBitmapClock: |
|
213 { |
|
214 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqClock; |
|
215 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock; |
|
216 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock_mask; |
|
217 break; |
|
218 } |
|
219 case EMRBitmapLocation: |
|
220 { |
|
221 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqLocation; |
|
222 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location; |
|
223 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location_mask; |
|
224 break; |
|
225 } |
|
226 case EMRBitmapLocationWaypoint: |
|
227 { |
|
228 bitmapStruct.iItemId = KAknsIIDQgnIndiCalLocatEventAdd; |
|
229 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cal_locat_event_add; |
|
230 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cal_locat_event_add_mask; |
|
231 break; |
|
232 } |
|
233 case EMRBitmapDateStart: |
|
234 { |
|
235 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqDateStart; |
|
236 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start; |
|
237 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start_mask; |
|
238 break; |
|
239 } |
|
240 case EMRBitmapDateEnd: |
|
241 { |
|
242 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqDateEnd; |
|
243 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end; |
|
244 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end_mask; |
|
245 break; |
|
246 } |
|
247 case EMRBitmapAttachment: |
|
248 { |
|
249 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailAttachment; |
|
250 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_attachment; |
|
251 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_attachment_mask; |
|
252 break; |
|
253 } |
|
254 case EMRBitmapCtrlBar: |
|
255 { |
|
256 bitmapStruct.iItemId = KAknsIIDQgnGrafCmailEmailCtrlbar; |
|
257 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar; |
|
258 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar_mask; |
|
259 break; |
|
260 } |
|
261 case EMRBitmapSearchContacts: |
|
262 { |
|
263 bitmapStruct.iItemId = KAknsIIDQgnPropSearchContacts; |
|
264 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_search_contacts; |
|
265 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_search_contacts_mask; |
|
266 break; |
|
267 } |
|
268 case EMRBitmapCalendarSelection: |
|
269 { |
|
270 bitmapStruct.iItemId = KAknsIIDQgnPropNrtypDate; |
|
271 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_nrtyp_date; |
|
272 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_nrtyp_date_mask; |
|
273 break; |
|
274 } |
|
275 case EMRBitmapEventTypeMeeting: |
|
276 { |
|
277 bitmapStruct.iItemId = KAknsIIDQgnIndiCdrMeeting; |
|
278 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cdr_meeting; |
|
279 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cdr_meeting_mask; |
|
280 break; |
|
281 } |
|
282 case EMRBitmapEventTypeMR: |
|
283 { |
|
284 bitmapStruct.iItemId = KAknsIIDQgnIndiCdrInvitation; |
|
285 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cdr_invitation; |
|
286 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cdr_invitation_mask; |
|
287 break; |
|
288 } |
|
289 case EMRBitmapEventTypeMemo: |
|
290 { |
|
291 bitmapStruct.iItemId = KAknsIIDQgnIndiCdrReminder; |
|
292 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cdr_reminder; |
|
293 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cdr_reminder_mask; |
|
294 break; |
|
295 } |
|
296 case EMRBitmapEventTypeAnniversary: |
|
297 { |
|
298 bitmapStruct.iItemId = KAknsIIDQgnIndiCdrBirthday; |
|
299 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cdr_birthday; |
|
300 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cdr_birthday_mask; |
|
301 break; |
|
302 } |
|
303 case EMRBitmapEventTypeTodo: |
|
304 { |
|
305 bitmapStruct.iItemId = KAknsIIDQgnIndiCdrTodo; |
|
306 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cdr_todo; |
|
307 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cdr_todo_mask; |
|
308 break; |
|
309 } |
|
310 case EMRBitmapListCenter: |
|
311 { |
|
312 bitmapStruct.iItemId = KAknsIIDQsnFrListCenter; |
|
313 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; |
|
314 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; |
|
315 break; |
|
316 } |
|
317 case EMRBitmapListTop: |
|
318 { |
|
319 bitmapStruct.iItemId = KAknsIIDQsnFrListSideT; |
|
320 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; |
|
321 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; |
|
322 break; |
|
323 } |
|
324 case EMRBitmapListBottom: |
|
325 { |
|
326 bitmapStruct.iItemId = KAknsIIDQsnFrListSideB; |
|
327 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; |
|
328 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; |
|
329 break; |
|
330 } |
|
331 case EMRBitmapListLeft: |
|
332 { |
|
333 bitmapStruct.iItemId = KAknsIIDQsnFrListSideL; |
|
334 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; |
|
335 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; |
|
336 break; |
|
337 } |
|
338 case EMRBitmapListRight: |
|
339 { |
|
340 bitmapStruct.iItemId = KAknsIIDQsnFrListSideR; |
|
341 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; |
|
342 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; |
|
343 break; |
|
344 } |
|
345 case EMRBitmapListTopLeft: |
|
346 { |
|
347 bitmapStruct.iItemId = KAknsIIDQsnFrListCornerTl; |
|
348 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; |
|
349 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; |
|
350 break; |
|
351 } |
|
352 case EMRBitmapListTopRight: |
|
353 { |
|
354 bitmapStruct.iItemId = KAknsIIDQsnFrListCornerTr; |
|
355 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; |
|
356 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; |
|
357 break; |
|
358 } |
|
359 case EMRBitmapListBottomLeft: |
|
360 { |
|
361 bitmapStruct.iItemId = KAknsIIDQsnFrListCornerBl; |
|
362 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; |
|
363 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; |
|
364 break; |
|
365 } |
|
366 case EMRBitmapListBottomRight: |
|
367 { |
|
368 bitmapStruct.iItemId = KAknsIIDQsnFrListCornerBr; |
|
369 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; |
|
370 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; |
|
371 break; |
|
372 } |
|
373 |
|
374 case EMRBitmapMailAttachment: |
|
375 { |
|
376 bitmapStruct.iItemId = KAknsIIDQgnFseMailAttachment; |
|
377 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_attachment; |
|
378 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_attachment_mask; |
|
379 break; |
|
380 } |
|
381 case EMRBitmapOpenAttachmentView: |
|
382 { |
|
383 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentListOptionsViewAll; |
|
384 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_list_options_view_all; |
|
385 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_list_options_view_all_mask; |
|
386 break; |
|
387 } |
|
388 case EMRBitmapOpenAttachment: |
|
389 { |
|
390 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentOpen; |
|
391 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_open; |
|
392 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_open_mask; |
|
393 break; |
|
394 } |
|
395 case EMRBitmapDownloadAttachment: |
|
396 { |
|
397 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentDownload; |
|
398 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download; |
|
399 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_mask; |
|
400 break; |
|
401 } |
|
402 case EMRBitmapDownloadAllAttachments: |
|
403 { |
|
404 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentDownloadAll; |
|
405 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_all; |
|
406 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_all_mask; |
|
407 break; |
|
408 } |
|
409 case EMRBitmapSaveAttachment: |
|
410 { |
|
411 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentSave; |
|
412 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save; |
|
413 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_mask; |
|
414 break; |
|
415 } |
|
416 case EMRBitmapSaveAllAttachments: |
|
417 { |
|
418 bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentSaveAll; |
|
419 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_all; |
|
420 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_all_mask; |
|
421 break; |
|
422 } |
|
423 |
|
424 // TODO: Needs correct fallbacks |
|
425 case EMRBitmapInputCenter: |
|
426 { |
|
427 bitmapStruct.iItemId = KAknsIIDQsnFrInputCenter; |
|
428 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; |
|
429 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; |
|
430 break; |
|
431 } |
|
432 case EMRBitmapInputTop: |
|
433 { |
|
434 bitmapStruct.iItemId = KAknsIIDQsnFrInputSideT; |
|
435 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; |
|
436 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; |
|
437 break; |
|
438 } |
|
439 case EMRBitmapInputBottom: |
|
440 { |
|
441 bitmapStruct.iItemId = KAknsIIDQsnFrInputSideB; |
|
442 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; |
|
443 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; |
|
444 break; |
|
445 } |
|
446 case EMRBitmapInputLeft: |
|
447 { |
|
448 bitmapStruct.iItemId = KAknsIIDQsnFrInputSideL; |
|
449 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; |
|
450 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; |
|
451 break; |
|
452 } |
|
453 case EMRBitmapInputRight: |
|
454 { |
|
455 bitmapStruct.iItemId = KAknsIIDQsnFrInputSideR; |
|
456 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; |
|
457 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; |
|
458 break; |
|
459 } |
|
460 case EMRBitmapInputTopLeft: |
|
461 { |
|
462 bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerTl; |
|
463 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; |
|
464 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; |
|
465 break; |
|
466 } |
|
467 case EMRBitmapInputTopRight: |
|
468 { |
|
469 bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerTr; |
|
470 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; |
|
471 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; |
|
472 break; |
|
473 } |
|
474 case EMRBitmapInputBottomLeft: |
|
475 { |
|
476 bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerBl; |
|
477 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; |
|
478 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; |
|
479 break; |
|
480 } |
|
481 case EMRBitmapInputBottomRight: |
|
482 { |
|
483 bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerBr; |
|
484 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; |
|
485 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; |
|
486 break; |
|
487 } |
|
488 |
|
489 // TODO: Needs correct fallbacks |
|
490 case EMRBitmapSetOptCenter: |
|
491 { |
|
492 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCenter; |
|
493 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; |
|
494 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; |
|
495 break; |
|
496 } |
|
497 case EMRBitmapSetOptTop: |
|
498 { |
|
499 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideT; |
|
500 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; |
|
501 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; |
|
502 break; |
|
503 } |
|
504 case EMRBitmapSetOptBottom: |
|
505 { |
|
506 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideB; |
|
507 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; |
|
508 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; |
|
509 break; |
|
510 } |
|
511 case EMRBitmapSetOptLeft: |
|
512 { |
|
513 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideL; |
|
514 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; |
|
515 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; |
|
516 break; |
|
517 } |
|
518 case EMRBitmapSetOptRight: |
|
519 { |
|
520 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideR; |
|
521 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; |
|
522 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; |
|
523 break; |
|
524 } |
|
525 case EMRBitmapSetOptTopLeft: |
|
526 { |
|
527 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerTl; |
|
528 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; |
|
529 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; |
|
530 break; |
|
531 } |
|
532 case EMRBitmapSetOptTopRight: |
|
533 { |
|
534 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerTr; |
|
535 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; |
|
536 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; |
|
537 break; |
|
538 } |
|
539 case EMRBitmapSetOptBottomLeft: |
|
540 { |
|
541 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerBl; |
|
542 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; |
|
543 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; |
|
544 break; |
|
545 } |
|
546 case EMRBitmapSetOptBottomRight: |
|
547 { |
|
548 bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerBr; |
|
549 bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; |
|
550 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; |
|
551 break; |
|
552 } |
|
553 case EMRBitmapMailPre: |
|
554 { |
|
555 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailArrowPrevious; |
|
556 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_arrow_previous; |
|
557 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_previous_mask; |
|
558 break; |
|
559 } |
|
560 case EMRBitmapMailNext: |
|
561 { |
|
562 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailArrowNext; |
|
563 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_arrow_next; |
|
564 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_next_mask; |
|
565 break; |
|
566 } |
|
567 case EMRBitmapAttachmentTypeImage: |
|
568 { |
|
569 bitmapStruct.iItemId = KAknsIIDQgnIndiMceTbImage; |
|
570 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_mce_tb_image; |
|
571 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_mce_tb_image_mask; |
|
572 break; |
|
573 } |
|
574 case EMRBitmapAttachmentTypeVideo: |
|
575 { |
|
576 bitmapStruct.iItemId = KAknsIIDQgnIndiMceTbVideo; |
|
577 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_mce_tb_video; |
|
578 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_mce_tb_video_mask; |
|
579 break; |
|
580 } |
|
581 case EMRBitmapAttachmentTypeMusic: |
|
582 { |
|
583 bitmapStruct.iItemId = KAknsIIDQgnIndiMceTbAudio; |
|
584 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_mce_tb_audio; |
|
585 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_mce_tb_audio_mask; |
|
586 break; |
|
587 } |
|
588 |
|
589 case EMRBitmapAttachmentTypeNote: |
|
590 { |
|
591 bitmapStruct.iItemId = KAknsIIDQgnIndiTbNote; |
|
592 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_tb_note; |
|
593 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_tb_note_mask; |
|
594 break; |
|
595 } |
|
596 |
|
597 case EMRBitmapAttachmentTypePresentations: |
|
598 { |
|
599 bitmapStruct.iItemId = KAknsIIDQgnIndiMceTbPres; |
|
600 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_mce_tb_pres; |
|
601 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_mce_tb_pres_mask; |
|
602 break; |
|
603 } |
|
604 case EMRBitmapAttachmentTypeOther: |
|
605 { |
|
606 bitmapStruct.iItemId = KAknsIIDQgnIndiMceTbOther; |
|
607 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_mce_tb_other; |
|
608 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_mce_tb_other_mask; |
|
609 break; |
|
610 } |
|
611 case EMRBitmapLockField: |
|
612 { |
|
613 bitmapStruct.iItemId = KAknsIIDQgnIndiSettProtectedAdd; |
|
614 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_sett_protected_add; |
|
615 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_sett_protected_add_mask; |
|
616 break; |
|
617 } |
|
618 default: |
|
619 { |
|
620 // We shouldn't end up here. |
|
621 __ASSERT_DEBUG( EFalse, Panic( KUnhandledBitmapId ) ); |
|
622 bitmapStruct.iItemId = KAknsIIDQgnIndiCmailActionArrowRight; |
|
623 bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_action_arrow_right; |
|
624 bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_action_arrow_right_mask; |
|
625 break; |
|
626 } |
|
627 } |
|
628 |
|
629 return bitmapStruct; |
|
630 } |
|
631 |
|
632 // --------------------------------------------------------------------------- |
|
633 // NMRBitmapManager::GetSkinBasedBitmap |
|
634 // --------------------------------------------------------------------------- |
|
635 // |
|
636 EXPORT_C TInt NMRBitmapManager::GetSkinBasedBitmap( |
|
637 TMRBitmapId aBitmapId, |
|
638 CFbsBitmap*& aBitmap, |
|
639 CFbsBitmap*& aMask, |
|
640 TSize aSize ) |
|
641 { |
|
642 TInt retValue = KErrNone; |
|
643 delete aBitmap; |
|
644 aBitmap = NULL; |
|
645 delete aMask; |
|
646 aMask = NULL; |
|
647 |
|
648 TMRBitmapStruct bitmapStruct = GetBitmapStruct( aBitmapId ); |
|
649 |
|
650 TFileName bitmapFilePath; |
|
651 ESMRHelper::LocateResourceFile( |
|
652 KESMRMifFile, |
|
653 KDC_APP_BITMAP_DIR, |
|
654 bitmapFilePath ); |
|
655 |
|
656 TRAPD( error, AknsUtils::CreateIconL( AknsUtils::SkinInstance(), |
|
657 bitmapStruct.iItemId, |
|
658 aBitmap, |
|
659 aMask, |
|
660 bitmapFilePath, |
|
661 bitmapStruct.iFallbackIndex, |
|
662 bitmapStruct.iFallbackMaskIndex ) ); |
|
663 |
|
664 if ( error != KErrNone ) |
|
665 { |
|
666 return error; |
|
667 } |
|
668 |
|
669 AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); |
|
670 |
|
671 if( !aBitmap || !aMask ) |
|
672 { |
|
673 retValue = KErrNotFound; |
|
674 } |
|
675 return retValue; |
|
676 } |
|
677 |
|
678 // --------------------------------------------------------------------------- |
|
679 // NMRBitmapManager::GetSkinBasedBitmapLC |
|
680 // --------------------------------------------------------------------------- |
|
681 // |
|
682 EXPORT_C void NMRBitmapManager::GetSkinBasedBitmapLC( |
|
683 TMRBitmapId aBitmapId, |
|
684 CFbsBitmap*& aBitmap, |
|
685 CFbsBitmap*& aMask, |
|
686 TSize aSize ) |
|
687 { |
|
688 delete aBitmap; |
|
689 aBitmap = NULL; |
|
690 delete aMask; |
|
691 aMask = NULL; |
|
692 |
|
693 TMRBitmapStruct bitmapStruct = GetBitmapStruct( aBitmapId ); |
|
694 |
|
695 TFileName bitmapFilePath; |
|
696 ESMRHelper::LocateResourceFile( |
|
697 KESMRMifFile, |
|
698 KDC_APP_BITMAP_DIR, |
|
699 bitmapFilePath ); |
|
700 |
|
701 AknsUtils::CreateIconLC( AknsUtils::SkinInstance(), |
|
702 bitmapStruct.iItemId, |
|
703 aBitmap, |
|
704 aMask, |
|
705 bitmapFilePath, |
|
706 bitmapStruct.iFallbackIndex, |
|
707 bitmapStruct.iFallbackMaskIndex ); |
|
708 |
|
709 AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); |
|
710 } |
|
711 |
|
712 // --------------------------------------------------------------------------- |
|
713 // NMRBitmapManager::GetMaskIconBitmap |
|
714 // --------------------------------------------------------------------------- |
|
715 // |
|
716 EXPORT_C TInt NMRBitmapManager::GetMaskIconBitmap( TMRBitmapId aBitmapId, |
|
717 CFbsBitmap*& aBitmap, |
|
718 CFbsBitmap*& aMask, |
|
719 TInt aColorIndex, |
|
720 TSize aSize ) |
|
721 { |
|
722 TInt retValue = KErrNone; |
|
723 delete aBitmap; |
|
724 aBitmap = NULL; |
|
725 delete aMask; |
|
726 aMask = NULL; |
|
727 |
|
728 TMRBitmapStruct bitmapStruct = GetBitmapStruct( aBitmapId ); |
|
729 |
|
730 TFileName bitmapFilePath; |
|
731 ESMRHelper::LocateResourceFile( |
|
732 KESMRMifFile, |
|
733 KDC_APP_BITMAP_DIR, |
|
734 bitmapFilePath ); |
|
735 |
|
736 TRgb defaultColour( KRgbBlack ); |
|
737 |
|
738 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
739 AknsUtils::GetCachedColor( skin, defaultColour, |
|
740 KAknsIIDQsnIconColors, aColorIndex ); |
|
741 |
|
742 TRAPD(error, AknsUtils::CreateColorIconL( skin, |
|
743 bitmapStruct.iItemId, |
|
744 KAknsIIDQsnIconColors, |
|
745 aColorIndex, |
|
746 aBitmap, |
|
747 aMask, |
|
748 bitmapFilePath, |
|
749 bitmapStruct.iFallbackIndex, |
|
750 bitmapStruct.iFallbackMaskIndex, |
|
751 defaultColour ) ); |
|
752 |
|
753 if ( error != KErrNone ) |
|
754 { |
|
755 return error; |
|
756 } |
|
757 |
|
758 AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); |
|
759 |
|
760 if( !aBitmap || !aMask ) |
|
761 { |
|
762 retValue = KErrNotFound; |
|
763 } |
|
764 return retValue; |
|
765 } |
|
766 |
|
767 // --------------------------------------------------------------------------- |
|
768 // NMRBitmapManager::GetMaskIconBitmap |
|
769 // --------------------------------------------------------------------------- |
|
770 // |
|
771 EXPORT_C void NMRBitmapManager::GetMaskIconBitmapLC( TMRBitmapId aBitmapId, |
|
772 CFbsBitmap*& aBitmap, |
|
773 CFbsBitmap*& aMask, |
|
774 TInt aColorIndex, |
|
775 TSize aSize ) |
|
776 { |
|
777 delete aBitmap; |
|
778 aBitmap = NULL; |
|
779 delete aMask; |
|
780 aMask = NULL; |
|
781 |
|
782 TMRBitmapStruct bitmapStruct = GetBitmapStruct( aBitmapId ); |
|
783 |
|
784 TFileName bitmapFilePath; |
|
785 ESMRHelper::LocateResourceFile( |
|
786 KESMRMifFile, |
|
787 KDC_APP_BITMAP_DIR, |
|
788 bitmapFilePath ); |
|
789 |
|
790 TRgb defaultColour( KRgbBlack ); |
|
791 |
|
792 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
793 AknsUtils::GetCachedColor( skin, defaultColour, |
|
794 KAknsIIDQsnIconColors, aColorIndex ); |
|
795 |
|
796 AknsUtils::CreateColorIconLC( skin, |
|
797 bitmapStruct.iItemId, |
|
798 KAknsIIDQsnIconColors, |
|
799 aColorIndex, |
|
800 aBitmap, |
|
801 aMask, |
|
802 bitmapFilePath, |
|
803 bitmapStruct.iFallbackIndex, |
|
804 bitmapStruct.iFallbackMaskIndex, |
|
805 defaultColour ); |
|
806 |
|
807 AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); |
|
808 } |