|
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: CAknIconManager class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "AknIconFormatHandler.h" |
|
20 #include "AknBitmap.h" |
|
21 |
|
22 inline TInt CAknIconManager::BitmapId() const |
|
23 { |
|
24 return iBitmapId; |
|
25 } |
|
26 |
|
27 inline TInt CAknIconManager::MaskId() const |
|
28 { |
|
29 return (iBitmap&&iBitmap->MaskDestroyed()?iOriginalMaskId:iMaskId); |
|
30 } |
|
31 |
|
32 inline void CAknIconManager::GetInitializedParams( TAknIconParams& aInfo ) const |
|
33 { |
|
34 aInfo.iMode = iInitializedMode; |
|
35 aInfo.iSize = iInitializedSize; |
|
36 aInfo.iRotationAngle = iInitializedAngle; |
|
37 aInfo.iColor = iInitializedColor; |
|
38 |
|
39 if (IsCompressionDisabledCleanUp()) |
|
40 { |
|
41 aInfo.DisableCompression(); |
|
42 } |
|
43 if (IsExcludedFromCache()) |
|
44 { |
|
45 aInfo.ExcludeFromCache(); |
|
46 } |
|
47 } |
|
48 |
|
49 inline void CAknIconManager::SetInitializedParams( |
|
50 const TAknIconParams& aInfo ) |
|
51 { |
|
52 iInitializedMode = aInfo.iMode; |
|
53 iInitializedSize = aInfo.iSize; |
|
54 iInitializedAngle = aInfo.iRotationAngle; |
|
55 iInitializedColor = aInfo.iColor; |
|
56 |
|
57 if (aInfo.IsCompressionDisabled()) |
|
58 { |
|
59 SetDisableCompressionCleanUp(); |
|
60 } |
|
61 else |
|
62 { |
|
63 ClearDisableCompressionCleanUp(); |
|
64 } |
|
65 } |
|
66 |
|
67 |
|
68 inline void CAknIconManager::DeleteIconFormatHandler() |
|
69 { |
|
70 delete iHandler; |
|
71 iHandler = NULL; |
|
72 } |
|
73 |
|
74 inline TBool CAknIconManager::HasValidFileExtension( const TDesC& aFileName ) const |
|
75 { |
|
76 return ( aFileName.Length() >= KExtensionLength && |
|
77 ( aFileName.Right( KExtensionLength ).CompareF( KMbmExtension ) == 0 || |
|
78 aFileName.Right( KExtensionLength ).CompareF( KMifExtension ) == 0 ) ); |
|
79 } |
|
80 |
|
81 inline TBool CAknIconManager::IsDefaultIconDirUsed() const |
|
82 { |
|
83 return iFlags & EFlagUsesDefaultIconDir; |
|
84 } |
|
85 |
|
86 inline void CAknIconManager::SetDefaultIconDirUsed() |
|
87 { |
|
88 iFlags |= EFlagUsesDefaultIconDir; |
|
89 } |
|
90 |
|
91 inline TBool CAknIconManager::IsExcludedFromCache() const |
|
92 { |
|
93 return iFlags & EFlagExcludeFromCache; |
|
94 } |
|
95 |
|
96 inline void CAknIconManager::ExcludeFromCache() |
|
97 { |
|
98 iFlags |= EFlagExcludeFromCache; |
|
99 } |
|
100 |
|
101 inline TBool CAknIconManager::IsCompressionDisabled() const |
|
102 { |
|
103 return iFlags & EFlagDisableCompression; |
|
104 } |
|
105 |
|
106 inline void CAknIconManager::DisableCompression() |
|
107 { |
|
108 iFlags |= EFlagDisableCompression; |
|
109 } |
|
110 |
|
111 inline TBool CAknIconManager::IsIconDataPreserved() const |
|
112 { |
|
113 return iFlags & EFlagIconDataPreserved; |
|
114 } |
|
115 |
|
116 inline void CAknIconManager::SetIconDataPreserved() |
|
117 { |
|
118 iFlags |= EFlagIconDataPreserved; |
|
119 } |
|
120 |
|
121 inline void CAknIconManager::ClearIconDataPreserved() |
|
122 { |
|
123 iFlags &= ~EFlagIconDataPreserved; |
|
124 } |
|
125 |
|
126 inline TBool CAknIconManager::IsAnimated() const |
|
127 { |
|
128 return iFlags & EFlagAnimated; |
|
129 } |
|
130 |
|
131 inline void CAknIconManager::SetAnimated() |
|
132 { |
|
133 iFlags |= EFlagAnimated; |
|
134 } |
|
135 |
|
136 inline TBool CAknIconManager::IsFileExtRemoved() const |
|
137 { |
|
138 return iFlags & EFlagFileExtRemoved; |
|
139 } |
|
140 |
|
141 inline void CAknIconManager::SetFileExtRemoved() |
|
142 { |
|
143 iFlags |= EFlagFileExtRemoved; |
|
144 } |
|
145 |
|
146 inline TBool CAknIconManager::IsCompressionDisabledCleanUp() const |
|
147 { |
|
148 return iFlags & EFlagDisableCompressionCleanUp; |
|
149 } |
|
150 |
|
151 inline void CAknIconManager::SetDisableCompressionCleanUp() |
|
152 { |
|
153 iFlags |= EFlagDisableCompressionCleanUp; |
|
154 } |
|
155 |
|
156 inline void CAknIconManager::ClearDisableCompressionCleanUp() |
|
157 { |
|
158 iFlags &= ~EFlagDisableCompressionCleanUp; |
|
159 } |
|
160 inline TBool CAknIconManager::IsAppIcon() const |
|
161 { |
|
162 if ( iBitmap ) |
|
163 { |
|
164 return iBitmap->IsAppIcon(); |
|
165 } |
|
166 return EFalse; |
|
167 } |
|
168 inline void CAknIconManager::SetAppIcon(TBool aAppIcon) |
|
169 { |
|
170 iAppIcon = aAppIcon; |
|
171 } |
|
172 inline TBool CAknIconManager::GetAppIcon() const |
|
173 { |
|
174 return iAppIcon; |
|
175 } |
|
176 // End of File |