|
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 #ifndef NMRBITMAPMANAGER_H |
|
19 #define NMRBITMAPMANAGER_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <AknsItemID.h> |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class CFbsBitmap; |
|
26 |
|
27 namespace NMRBitmapManager |
|
28 { |
|
29 enum TMRBitmapId |
|
30 { |
|
31 EMRBitmapNotSet = 0x00, |
|
32 EMRBitmapRightClickArrow = 0x01, |
|
33 EMRBitmapTrackingAccept, |
|
34 EMRBitmapTrackingReject, |
|
35 EMRBitmapTrackingTentative, |
|
36 EMRBitmapTrackingNone, |
|
37 EMRBitmapPriorityHigh, |
|
38 EMRBitmapPriorityLow, |
|
39 EMRBitmapPriorityNormal, |
|
40 EMRBitmapSynchronization, |
|
41 EMRBitmapSubject, |
|
42 EMRBitmapOccasion, |
|
43 EMRBitmapRecurrence, |
|
44 EMRBitmapBrowser, |
|
45 EMRBitmapIntranet, |
|
46 EMRBitmapBookmark, |
|
47 EMRBitmapAlarm, |
|
48 EMRBitmapAlarmClock, |
|
49 EMRBitmapCheckBoxOn, |
|
50 EMRBitmapCheckBoxOff, |
|
51 EMRBitmapClock, |
|
52 EMRBitmapLocation, |
|
53 EMRBitmapLocationWaypoint, |
|
54 EMRBitmapDateStart, |
|
55 EMRBitmapDateEnd, |
|
56 EMRBitmapAttachment, |
|
57 EMRBitmapCtrlBar, |
|
58 EMRBitmapSearchContacts, |
|
59 EMRBitmapCalendarSelection, |
|
60 EMRBitmapEventTypeMeeting, |
|
61 EMRBitmapEventTypeMR, |
|
62 EMRBitmapEventTypeMemo, |
|
63 EMRBitmapEventTypeAnniversary, |
|
64 EMRBitmapEventTypeTodo, |
|
65 EMRBitmapLockField, |
|
66 |
|
67 // Attachment handling icons |
|
68 EMRBitmapMailAttachment = 0x200, |
|
69 EMRBitmapOpenAttachmentView, |
|
70 EMRBitmapOpenAttachment, |
|
71 EMRBitmapDownloadAttachment, |
|
72 EMRBitmapDownloadAllAttachments, |
|
73 EMRBitmapSaveAttachment, |
|
74 EMRBitmapSaveAllAttachments, |
|
75 |
|
76 EMRBitmapListCenter, |
|
77 EMRBitmapListTop, |
|
78 EMRBitmapListBottom, |
|
79 EMRBitmapListLeft, |
|
80 EMRBitmapListRight, |
|
81 EMRBitmapListTopLeft, |
|
82 EMRBitmapListTopRight, |
|
83 EMRBitmapListBottomLeft, |
|
84 EMRBitmapListBottomRight, |
|
85 |
|
86 EMRBitmapInputCenter, |
|
87 EMRBitmapInputTop, |
|
88 EMRBitmapInputBottom, |
|
89 EMRBitmapInputLeft, |
|
90 EMRBitmapInputRight, |
|
91 EMRBitmapInputTopLeft, |
|
92 EMRBitmapInputTopRight, |
|
93 EMRBitmapInputBottomLeft, |
|
94 EMRBitmapInputBottomRight, |
|
95 |
|
96 EMRBitmapSetOptCenter, |
|
97 EMRBitmapSetOptTop, |
|
98 EMRBitmapSetOptBottom, |
|
99 EMRBitmapSetOptLeft, |
|
100 EMRBitmapSetOptRight, |
|
101 EMRBitmapSetOptTopLeft, |
|
102 EMRBitmapSetOptTopRight, |
|
103 EMRBitmapSetOptBottomLeft, |
|
104 EMRBitmapSetOptBottomRight, |
|
105 |
|
106 EMRBitmapMailPre, |
|
107 EMRBitmapMailNext, |
|
108 |
|
109 // Attachment type selection |
|
110 EMRBitmapAttachmentTypeImage, |
|
111 EMRBitmapAttachmentTypeVideo, |
|
112 EMRBitmapAttachmentTypeMusic, |
|
113 EMRBitmapAttachmentTypeNote, |
|
114 EMRBitmapAttachmentTypePresentations, |
|
115 EMRBitmapAttachmentTypeOther |
|
116 }; |
|
117 |
|
118 class TMRBitmapStruct |
|
119 { |
|
120 public: |
|
121 TMRBitmapStruct() : |
|
122 iFallbackIndex( 0 ), iFallbackMaskIndex( 0 ) |
|
123 { iItemId.iMajor = 0; iItemId.iMinor = 0; } |
|
124 |
|
125 public: // Data |
|
126 TAknsItemID iItemId; |
|
127 TInt iFallbackIndex; |
|
128 TInt iFallbackMaskIndex; |
|
129 }; |
|
130 |
|
131 /** |
|
132 * Converts logical TMRBitmapId to internal TMRBitmapStruct |
|
133 * which contains skin id for bitmap and fallback ids. |
|
134 * |
|
135 * @param aBitmapId Logical bitmap id. |
|
136 * @return TAknsItemID Skin graphics id. |
|
137 */ |
|
138 IMPORT_C TMRBitmapStruct GetBitmapStruct( TMRBitmapId aBitmapId ); |
|
139 |
|
140 /** |
|
141 * Creates bitmap and bitmap mask. Bitmap is skin/theme based |
|
142 * and it's retrived by the given ID.Bitmap is also resized to |
|
143 * the given size. |
|
144 * Ownership of these created bitmaps is transferred to the caller. |
|
145 * |
|
146 * @param aIconID - id of the wanted bitmap |
|
147 * @param aBitmap - reference to the pointer where new bitmap is stored |
|
148 * @param aMask - reference to the pointer where new bitmap mask is stored |
|
149 * @param aSize - Desired size for the bitmap |
|
150 * @return TInt - KErrNone if bitmap was constructed succesfully |
|
151 * KErrNotFound if any problems occured |
|
152 */ |
|
153 IMPORT_C TInt GetSkinBasedBitmap( TMRBitmapId aBitmapId, |
|
154 CFbsBitmap*& aBitmap, |
|
155 CFbsBitmap*& aMask, |
|
156 TSize aSize ); |
|
157 |
|
158 /** |
|
159 * Creates bitmap and bitmap mask. Bitmap is skin/theme based |
|
160 * and it's retrived by the given ID.Bitmap is also resized to |
|
161 * the given size. Both bitmap and bitmap mask are left into the |
|
162 * CleanupStack in undefined order and type. Function leaves in case |
|
163 * of any error. |
|
164 * |
|
165 * @param aIconID - id of the wanted bitmap |
|
166 * @param aBitmap - reference to the pointer where new bitmap is stored |
|
167 * @param aMask - reference to the pointer where new bitmap mask is stored |
|
168 * @param aSize - Desired size for the bitmap |
|
169 */ |
|
170 IMPORT_C void GetSkinBasedBitmapLC( TMRBitmapId aBitmapId, |
|
171 CFbsBitmap*& aBitmap, |
|
172 CFbsBitmap*& aMask, |
|
173 TSize aSize ); |
|
174 |
|
175 /** |
|
176 * Creates bitmap and bitmap mask. Bitmap is mask icon with color group |
|
177 * customized and it's retrived by the given ID.Bitmap is also resized to |
|
178 * the given size. |
|
179 * Ownership of these created bitmaps is transferred to the caller. |
|
180 * |
|
181 * @param aIconID - id of the wanted bitmap |
|
182 * @param aBitmap - reference to the pointer where new bitmap is stored |
|
183 * @param aMask - reference to the pointer where new bitmap mask is stored |
|
184 * @param aSize - Desired size for the bitmap |
|
185 * @return TInt - KErrNone if bitmap was constructed succesfully |
|
186 * KErrNotFound if any problems occured |
|
187 */ |
|
188 IMPORT_C TInt GetMaskIconBitmap( TMRBitmapId aBitmapId, |
|
189 CFbsBitmap*& aBitmap, |
|
190 CFbsBitmap*& aMask, |
|
191 TInt aColorIndex, |
|
192 TSize aSize ); |
|
193 |
|
194 /** |
|
195 * Creates bitmap and bitmap mask. Bitmap is mask icon with color group |
|
196 * customized and it's retrived by the given ID.Bitmap is also resized to |
|
197 * the given size. Both bitmap and bitmap mask are left into the |
|
198 * CleanupStack in undefined order and type. Function leaves in case |
|
199 * of any error. |
|
200 * |
|
201 * @param aIconID - id of the wanted bitmap |
|
202 * @param aBitmap - reference to the pointer where new bitmap is stored |
|
203 * @param aMask - reference to the pointer where new bitmap mask is stored |
|
204 * @param aSize - Desired size for the bitmap |
|
205 */ |
|
206 IMPORT_C void GetMaskIconBitmapLC( TMRBitmapId aBitmapId, |
|
207 CFbsBitmap*& aBitmap, |
|
208 CFbsBitmap*& aMask, |
|
209 TInt aColorIndex, |
|
210 TSize aSize ); |
|
211 } |
|
212 |
|
213 #endif |