|
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 |
|
21 #ifndef AKN_ICON_SRV_DEF_H |
|
22 #define AKN_ICON_SRV_DEF_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <gdi.h> |
|
27 #include <AknIconUtils.h> |
|
28 #include "AknIconTraces.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CBitwiseBitmap; |
|
32 class CAknIconSrvIconItem; |
|
33 class CAknIconDataItem; |
|
34 |
|
35 // CONSTANTS |
|
36 |
|
37 const TUint32 KColorNotDefined = 0xFF000000; |
|
38 |
|
39 _LIT( KAknIconDefaultDir, "z:\\resource\\apps\\" ); |
|
40 const TInt KAknIconDefaultDirLength = 17; |
|
41 _LIT( KDriveZ, "Z:" ); |
|
42 const TInt KDriveLength = 2; |
|
43 |
|
44 // DATA STRUCTURES |
|
45 |
|
46 struct TAknIconSrvReturnData |
|
47 { |
|
48 // bitmap |
|
49 TInt iBitmapHandle; |
|
50 // mask |
|
51 TInt iMaskHandle; |
|
52 // content dimensions |
|
53 TAknContentDimensions iContentDimensions; |
|
54 }; |
|
55 |
|
56 // Init. data moved from server side to client side when session is connected. |
|
57 struct TAknIconInitData |
|
58 { |
|
59 // configuration from resource file |
|
60 TInt iCompression; |
|
61 |
|
62 TDisplayMode iIconMode; |
|
63 TDisplayMode iIconMaskMode; |
|
64 |
|
65 TDisplayMode iPhotoMode; |
|
66 |
|
67 TDisplayMode iVideoMode; |
|
68 |
|
69 TDisplayMode iOffscreenMode; |
|
70 TDisplayMode iOffscreenMaskMode; |
|
71 }; |
|
72 |
|
73 struct TAknIconParams |
|
74 { |
|
75 enum TFlags |
|
76 { |
|
77 EFlagUsesDefaultIconDir = 0x0001, |
|
78 EFlagMbmIcon = 0x0002, |
|
79 EFlagExcludeFromCache = 0x0004, // do not cache dynamically |
|
80 EFlagDisableCompression = 0x0008 // disable bitmap compression |
|
81 }; |
|
82 |
|
83 TAknIconParams::TAknIconParams():iFlags(0) |
|
84 { |
|
85 } |
|
86 |
|
87 TBool IsDefaultIconDirUsed() const |
|
88 { |
|
89 return iFlags & EFlagUsesDefaultIconDir; |
|
90 } |
|
91 |
|
92 void SetDefaultIconDirUsed() |
|
93 { |
|
94 iFlags |= EFlagUsesDefaultIconDir; |
|
95 } |
|
96 |
|
97 TBool IsMbmIcon() const |
|
98 { |
|
99 return iFlags & EFlagMbmIcon; |
|
100 } |
|
101 |
|
102 void SetMbmIcon() |
|
103 { |
|
104 iFlags |= EFlagMbmIcon; |
|
105 } |
|
106 |
|
107 TBool IsExcludedFromCache() const |
|
108 { |
|
109 return iFlags & EFlagExcludeFromCache; |
|
110 } |
|
111 |
|
112 void ExcludeFromCache() |
|
113 { |
|
114 iFlags |= EFlagExcludeFromCache; |
|
115 } |
|
116 |
|
117 TBool IsCompressionDisabled() const |
|
118 { |
|
119 return iFlags & EFlagDisableCompression; |
|
120 } |
|
121 |
|
122 void DisableCompression() |
|
123 { |
|
124 iFlags |= EFlagDisableCompression; |
|
125 } |
|
126 |
|
127 #ifdef __AKNICON_TRACES |
|
128 void PrintInfo() |
|
129 { |
|
130 RDebug::Print( _L("AknIcon: %x TAknIconParams info begin"), this); |
|
131 RDebug::Print( _L("AknIcon: %x TAknIconParams iFileName=%S"), this,&iFileName); |
|
132 RDebug::Print( _L("AknIcon: %x TAknIconParams iBitmapId=%d, iMaskId=%d"), this, iBitmapId, iMaskId); |
|
133 RDebug::Print( _L("AknIcon: %x TAknIconParams iSize=(%d,%d), iMode=%d, iRotationAngle=%d"), this, iSize.iWidth, iSize.iHeight, iMode, iRotationAngle); |
|
134 RDebug::Print( _L("AknIcon: %x TAknIconParams iColor=%d, iFile=%x, iFlags=%x"), this, iColor, iFlags); |
|
135 RDebug::Print( _L("AknIcon: %x TAknIconParams info end"), this); |
|
136 } |
|
137 #endif |
|
138 |
|
139 // Note! Default icon dir must always be excluded from this file name! |
|
140 TFileName iFileName; |
|
141 TInt iBitmapId; |
|
142 TInt iMaskId; |
|
143 TSize iSize; |
|
144 TInt iMode; |
|
145 TInt iRotationAngle; |
|
146 TRgb iColor; |
|
147 |
|
148 // Used when client supplies file handle. This cannot be used directly |
|
149 // on the other side of an IPC boundary. Instead, RFile's "transfer" |
|
150 // and "adopt" methods must be used. |
|
151 RFile iFile; |
|
152 TBool iAppIcon; |
|
153 private: |
|
154 TInt iFlags; // flags |
|
155 }; |
|
156 |
|
157 struct TAknIconSrvSessionIconItem |
|
158 { |
|
159 const CAknIconSrvIconItem* iIcon; |
|
160 TInt iUserCount; // both bitmap and mask increase this |
|
161 |
|
162 static TInt LinearOrder( |
|
163 const TAknIconSrvSessionIconItem& aFirst, |
|
164 const TAknIconSrvSessionIconItem& aSecond ) |
|
165 { |
|
166 return reinterpret_cast<TInt>(aFirst.iIcon)- |
|
167 reinterpret_cast<TInt>(aSecond.iIcon); |
|
168 } |
|
169 }; |
|
170 |
|
171 struct TAknIconSrvSessionPreservedItem |
|
172 { |
|
173 const CAknIconDataItem* iDataItem; |
|
174 TInt iUserCount; |
|
175 }; |
|
176 |
|
177 #endif // AKN_ICON_SRV_DEF_H |
|
178 |
|
179 // End of File |