|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef AKN_ICON_SRV_ICON_ITEM_H |
|
21 #define AKN_ICON_SRV_ICON_ITEM_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <gdi.h> |
|
26 #include <AknIconUtils.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 |
|
30 struct TAknIconParams; |
|
31 class CFbsBitmap; |
|
32 class CAknIconFileNameCache; |
|
33 |
|
34 // CONSTANTS |
|
35 |
|
36 // CLASS DEFINITIONS |
|
37 |
|
38 NONSHARABLE_CLASS(CAknIconSrvIconItem) : public CBase |
|
39 { |
|
40 public: // Constructor and destructor |
|
41 |
|
42 /** |
|
43 * @param aInfo info |
|
44 * @param aBitmap ownership transferred to this object |
|
45 * @param aMask ownership transferred to this object |
|
46 * @param aDimensions content dimensions of the icon |
|
47 * @param aFileNameCache file name cache passed by the caller |
|
48 * for retrieving/storing icon file name |
|
49 */ |
|
50 static CAknIconSrvIconItem* NewL( |
|
51 const TAknIconParams& aInfo, |
|
52 CFbsBitmap* aBitmap, |
|
53 CFbsBitmap* aMask, |
|
54 const TAknContentDimensions& aDimensions, |
|
55 CAknIconFileNameCache& aFileNameCache ); |
|
56 |
|
57 /** |
|
58 * Constructor for compare items. |
|
59 */ |
|
60 CAknIconSrvIconItem( const TAknIconParams& aInfo ); |
|
61 |
|
62 ~CAknIconSrvIconItem(); |
|
63 |
|
64 public: // New functions |
|
65 |
|
66 static TInt LinearOrder( |
|
67 const CAknIconSrvIconItem& aFirst, |
|
68 const CAknIconSrvIconItem& aSecond ); |
|
69 |
|
70 void GetInfo( TAknIconParams& aInfo ) const; |
|
71 |
|
72 inline TBool IsCached() const; |
|
73 inline void SetCached(); |
|
74 inline void ClearCached(); |
|
75 |
|
76 inline TBool IsPermanentlyCached() const; |
|
77 inline void SetPermanentlyCached(); |
|
78 inline void ClearPermanentlyCached(); |
|
79 |
|
80 inline TBool IsCachedFromSkin() const; |
|
81 inline void SetCachedFromSkin(); |
|
82 inline void ClearCachedFromSkin(); |
|
83 |
|
84 inline TBool IsMbmIcon() const; |
|
85 inline void SetMbmIcon(); |
|
86 |
|
87 inline TBool IsExcludedFromCache() const; |
|
88 inline void ExcludeFromCache(); |
|
89 |
|
90 inline TBool IsCompressionDisabled() const; |
|
91 inline void DisableCompression(); |
|
92 |
|
93 private: // Private constructors |
|
94 |
|
95 CAknIconSrvIconItem(); |
|
96 |
|
97 void ConstructL( |
|
98 const TAknIconParams& aInfo, |
|
99 CFbsBitmap* aBitmap, |
|
100 CFbsBitmap* aMask, |
|
101 const TAknContentDimensions& aDimensions, |
|
102 CAknIconFileNameCache& aFileNameCache ); |
|
103 |
|
104 public: // Data |
|
105 |
|
106 enum TFlags |
|
107 { |
|
108 // Flags must not use the low 16 bits. |
|
109 EFlagCached = 0x00010000, // dynamic cache |
|
110 EFlagPermanentlyCached = 0x00020000, // always cached |
|
111 EFlagCachedFromSkin = 0x00040000, |
|
112 EFlagMbmIcon = 0x00080000, |
|
113 EFlagExcludeFromCache = 0x00100000, // do not cache dynamically |
|
114 EFlagDisableCompression = 0x00200000 // disable bitmap compression |
|
115 }; |
|
116 |
|
117 HBufC* iFileName; // not owned |
|
118 const TDesC* iFileNameRef; // used by compare items |
|
119 TInt16 iBitmapId; |
|
120 TInt16 iMaskId; |
|
121 TSize iSize; |
|
122 TInt iModeAndFlags; // mode in low 16 bits, flags in high 16 bits. |
|
123 TInt iRotationAngle; |
|
124 TInt iUserCount; |
|
125 CFbsBitmap* iBitmap; |
|
126 CFbsBitmap* iMask; |
|
127 // For color skinning |
|
128 TRgb iColor; |
|
129 // Info of the content dimensions of the icon is stored here. |
|
130 TAknContentDimensions iDimensions; |
|
131 TBool iAppIcon; // set true for application icon |
|
132 |
|
133 // indicates if the icon is marked to be precached |
|
134 TBool iPrecacheItem; |
|
135 }; |
|
136 |
|
137 #include "AknIconSrvIconItem.inl" |
|
138 |
|
139 #endif // AKN_ICON_SRV_ICON_ITEM_H |
|
140 |
|
141 // End of File |