|
1 /* |
|
2 * Copyright (c) 2002 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: Pictograph factory. |
|
15 * Creates pictographs according to definition table. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef AKN_PICTOGRAPH_FACTORY_H |
|
22 #define AKN_PICTOGRAPH_FACTORY_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include "AknPictographConstants.h" |
|
27 #include "AknPictographDrawerInterface.h" |
|
28 #include <e32std.h> |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 struct TAknPictographData; |
|
34 class CFont; |
|
35 class CFbsBitmapDevice; |
|
36 class CFbsBitmap; |
|
37 class CFbsBitGc; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * Pictograph factory. |
|
43 * Used for retrieving pictograph definitions. |
|
44 * Only this class accesses the pictograph definition tables. |
|
45 */ |
|
46 NONSHARABLE_CLASS(AknPictographFactory) |
|
47 { |
|
48 public: // New functions |
|
49 |
|
50 static HBufC* SupportedPictographCodesL(); |
|
51 |
|
52 static TInt StaticPictographData( |
|
53 TText aCode, |
|
54 TAknPictographHeight aHeight, |
|
55 TAknPictographData& aData ); |
|
56 |
|
57 static TInt AnimatedPictographData( |
|
58 TText aCode, |
|
59 TAknPictographHeight aHeight, |
|
60 TUint aCounter, |
|
61 TAknPictographData& aData ); |
|
62 |
|
63 static const TAknStaticPictographDefinition* StaticPictographTable(); |
|
64 static const TAknAnimatedPictographDefinition* AnimatedPictographTable(); |
|
65 |
|
66 |
|
67 /** |
|
68 * Loads the bitmaps and masks for the supported heights to allocated array objects. |
|
69 * The array objects are returned and owned by the caller. |
|
70 * |
|
71 * A bitmap can be looked up for a given height using indexes returned by function |
|
72 * GetArrayIndexForHeight. |
|
73 * |
|
74 * @since 2.8 |
|
75 * @param aBitmaps stores the loaded bitmaps for the supported heights |
|
76 * @param aMasks stores the loaded masks for the bitmaps for the supported heights |
|
77 */ |
|
78 static void LoadBitmapsL( |
|
79 RPointerArray<CFbsBitmap>*& aBitmaps, |
|
80 RPointerArray<CFbsBitmap>*& aMasks |
|
81 ); |
|
82 |
|
83 /** |
|
84 * Gets an array index for a supported height value. This index can be used |
|
85 * to access data specific to a given height in arrays. |
|
86 * |
|
87 * @since 2.8 |
|
88 * @param aHeight Pictograph height. |
|
89 * @param aIndex returns the array index if the call is successful |
|
90 * @return KErrNone if aHeight is supported otherwise returns KErrNotSupported |
|
91 */ |
|
92 static TInt GetArrayIndexForHeight( |
|
93 TAknPictographHeight aHeight, |
|
94 TUint& aIndex |
|
95 ); |
|
96 |
|
97 /** |
|
98 * Tries to find a matching pictograph height for a given font. |
|
99 * |
|
100 * @since 2.8 |
|
101 * @param aFont Used font. |
|
102 * @param aHeight Pictograph height. |
|
103 * @return KErrNone if a supported pictograph height is found that matches |
|
104 * aFont otherwise returns KErrNotSupported |
|
105 */ |
|
106 static TInt SelectPictographHeightForFont( |
|
107 const CFont& aFont, |
|
108 TAknPictographHeight& aHeight |
|
109 ); |
|
110 |
|
111 /** |
|
112 * Creates white bitmaps to be used when drawing pictographs in EDrawingModeWhite mode. |
|
113 * The objects are returned and owned by the caller. |
|
114 * aMaskGc should be used to copy the actual pictograph mask to aMask before drawing |
|
115 * the pictograph. |
|
116 * |
|
117 * |
|
118 * @since 2.8 |
|
119 * @param aBitmap white bitmap |
|
120 * @param aBitmap white bitmap mask |
|
121 * @param aMaskBitmapDevice bitmap device for aBitmap |
|
122 * @param aMaskGc graphics context for aBitmap |
|
123 */ |
|
124 static void CreateWhiteBitmapsL( |
|
125 CFbsBitmap*& aBitmap, |
|
126 CFbsBitmap*& aMask, |
|
127 CFbsBitmapDevice*& aMaskBitmapDevice, |
|
128 CFbsBitGc*& aMaskGc |
|
129 ); |
|
130 |
|
131 private: |
|
132 |
|
133 /** |
|
134 * C++ default constructor. |
|
135 */ |
|
136 AknPictographFactory(); |
|
137 }; |
|
138 |
|
139 #endif // AKN_PICTOGRAPH_FACTORY_H |
|
140 |
|
141 // End of File |