|
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 * Declares container control for application. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef INCALLSTATUSBUBBLE_H |
|
21 #define INCALLSTATUSBUBBLE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <coecntrl.h> |
|
25 #include <avkon.hrh> |
|
26 |
|
27 #include <callstatus.mbg> |
|
28 |
|
29 #include <AknsItemID.h> |
|
30 #include <AknsConstants.h> |
|
31 #include <AknsItemData.h> |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CIncallAnim; |
|
35 class CEikImage; |
|
36 class CIncallMuted; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * CIncallStatusBubble container control class. |
|
42 * |
|
43 */ |
|
44 NONSHARABLE_CLASS(CIncallStatusBubble) : public CCoeControl |
|
45 { |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Bit Explanation |
|
50 * 0 and 1 Call state |
|
51 * 2 No Ciphering |
|
52 * 3 Is muted |
|
53 * 4 Is Visible |
|
54 * 5 Is a Fax |
|
55 * 6 Is a Data call |
|
56 * 7 Is a Hscsd data call |
|
57 * 8 Line 2 indication |
|
58 * 9 Is a Video call |
|
59 * 10 Is an emergency call |
|
60 * 11 Is a VoIP call |
|
61 * 12 Is a full screen touch input window show |
|
62 * 12 Is a full screen touch input window Hide |
|
63 |
|
64 * ... |
|
65 * ... |
|
66 * 31 Reserved for incall bubble notifier internal use. |
|
67 */ |
|
68 enum TCallStatusBubbleFlags |
|
69 { |
|
70 ESBAlerting = EAknStatusBubbleAlerting, // One of |
|
71 ESBActive = EAknStatusBubbleActive, // these |
|
72 ESBOnHold = EAknStatusBubbleOnHold, // to set |
|
73 ESBDisconnected = EAknStatusBubbleDisconnected, // the call state |
|
74 ESBNoCiphering = EAknStatusBubbleNoCiphering, |
|
75 ESBMuted = EAknStatusBubbleMuted, |
|
76 ESBVisible = EAknStatusBubbleVisible, |
|
77 ESBFax = EAknStatusBubbleFax, |
|
78 ESBData = EAknStatusBubbleData, |
|
79 ESBDataHscsd = EAknStatusBubbleDataHscsd, |
|
80 ESBLine2 = EAknStatusBubbleLine2, |
|
81 ESBVideo = EAknStatusBubbleVideo, |
|
82 ESBEmergency = EAknStatusBubbleEmergency, |
|
83 ESBVoIPCall = EAknStatusBubbleVoIP, |
|
84 ESBTouchShow = EAknStatusBubbleInputShow, |
|
85 ESBTouchHide = EAknStatusBubbleInputHide, |
|
86 |
|
87 ESBReservedInternal = EAknStatusBubbleReservedInternal |
|
88 }; |
|
89 |
|
90 public: // Constructors and destructor |
|
91 |
|
92 /** |
|
93 * Constructor |
|
94 * @aRect Used rectangle |
|
95 * @return New instance |
|
96 */ |
|
97 static CIncallStatusBubble* NewL( const TRect& aRect ); |
|
98 |
|
99 /** |
|
100 * Destructor. |
|
101 */ |
|
102 ~CIncallStatusBubble(); |
|
103 |
|
104 public: // New functions |
|
105 |
|
106 /** |
|
107 * Use this function to set the state of the bubble |
|
108 * @param aFlags Bits that define the outlook. |
|
109 */ |
|
110 void SetFlags( const TInt& aFlags ); |
|
111 |
|
112 /** |
|
113 * Use this function to get the state of the bubble |
|
114 * @return Bits that define the outlook. |
|
115 */ |
|
116 #ifdef __WINS__ |
|
117 const TInt Flags(); |
|
118 #else |
|
119 TInt Flags(); |
|
120 #endif |
|
121 |
|
122 /** |
|
123 * Fades incall status bubble window group. |
|
124 * |
|
125 * @param aFaded Fade state to be set. |
|
126 */ |
|
127 void SetFaded(TBool aFaded); |
|
128 |
|
129 /** |
|
130 * Gets given image (skinned if possible) |
|
131 * @param aImage This is where the bitmaps are set. |
|
132 * @param aImageId Id of the bitmap (see enum in AknIncallStatusBubble.h) |
|
133 * @param aImageMaskId Id of mask. KErrNotFound(-1) stands for |
|
134 * no mask. |
|
135 */ |
|
136 void GetImage( |
|
137 CEikImage& aImage, |
|
138 const TInt& aImageId, |
|
139 const TInt aImageMaskId = KErrNotFound ); |
|
140 |
|
141 public: // Functions from base classes |
|
142 |
|
143 /** |
|
144 * Use this function to set the place of the bubble |
|
145 * @param aRect A rectangle which define the drawing area. |
|
146 */ |
|
147 void SetRect( const TRect& aRect ); |
|
148 |
|
149 /** |
|
150 * From CCoeControl,HandleResourceChange. |
|
151 */ |
|
152 void HandleResourceChange( TInt aType ); |
|
153 |
|
154 /** |
|
155 * From CCoeControl,HandlePointerEventL. |
|
156 */ |
|
157 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
158 |
|
159 private: // Functions from base classes |
|
160 |
|
161 /** |
|
162 * From CoeControl,SizeChanged. |
|
163 */ |
|
164 void SizeChanged(); |
|
165 |
|
166 /** |
|
167 * From CoeControl,CountComponentControls. |
|
168 */ |
|
169 TInt CountComponentControls() const; |
|
170 |
|
171 /** |
|
172 * From CCoeControl,ComponentControl. |
|
173 */ |
|
174 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
175 |
|
176 /** |
|
177 * From CCoeControl,Draw. |
|
178 */ |
|
179 void Draw( const TRect& aRect ) const; |
|
180 |
|
181 |
|
182 private: //new functions |
|
183 |
|
184 // Data |
|
185 struct SSkinnedImage |
|
186 { |
|
187 public: |
|
188 SSkinnedImage(): iId( KAknsIIDNone ), iItemData( NULL ) {} |
|
189 ~SSkinnedImage() { delete iItemData; } |
|
190 |
|
191 public: |
|
192 TAknsItemID iId; |
|
193 CAknsItemData* iItemData; |
|
194 }; |
|
195 |
|
196 |
|
197 CIncallStatusBubble(); |
|
198 |
|
199 /** |
|
200 * EPOC default constructor. |
|
201 * @param aRect Frame rectangle for container. |
|
202 */ |
|
203 void ConstructL( const TRect& aRect ); |
|
204 |
|
205 /** |
|
206 * Loads images into cache. |
|
207 */ |
|
208 void LoadImagesL(); |
|
209 |
|
210 /** |
|
211 * Creates new CEikImage instance |
|
212 * @return New instance. Ownership given. |
|
213 */ |
|
214 CEikImage* CreateNewEikImageL() const; |
|
215 |
|
216 /** |
|
217 * Selects used bitmaps according the state flags. |
|
218 */ |
|
219 void SelectImages(); |
|
220 |
|
221 /** |
|
222 * Maps bitmap enumeration into skin id |
|
223 * @param aBmIcon Bitmap enumeration from AknIncallStatusBubble.h |
|
224 * @param aID Skinned ID. |
|
225 */ |
|
226 static void MapEnumToSkin( |
|
227 const TInt aBmIcon, TAknsItemID& aID ); |
|
228 |
|
229 /** |
|
230 * Gets skin data for given ID |
|
231 * @param aBmIcon Bitmap enumeration from AknIncallStatusBubble.h |
|
232 * return Skin data. NULL if not found. |
|
233 */ |
|
234 CAknsItemData* GetSkinForIcon( const TInt aBmIcon ); |
|
235 |
|
236 /** |
|
237 * Allocated new skinned image into the cache. Leaves in OOM case. |
|
238 * @param aId Skin id. |
|
239 * @return Skin data. |
|
240 */ |
|
241 CAknsItemData* LoadAndAppendSkinL( const TAknsItemID& aId ); |
|
242 |
|
243 /** |
|
244 * Sets skin to image if found. |
|
245 * @param aImage Used image. |
|
246 * @param aBmIcon Bitmap enumeration from CallStatus.mbg |
|
247 * @return Was skin set? ETrue if skin found and set. Else EFalse. |
|
248 */ |
|
249 TBool GetSkin( CEikImage& aImage, const TInt aBmIcon ); |
|
250 |
|
251 /** |
|
252 * Comparision function for two skin item |
|
253 */ |
|
254 static TInt CompareSkinnedData( |
|
255 const SSkinnedImage& aSkin1, |
|
256 const SSkinnedImage& aSkin2 ); |
|
257 |
|
258 /** |
|
259 * Loads a non-masked image and appends it in the image array. |
|
260 */ |
|
261 void LoadImageL( TInt aBitmapId ); |
|
262 |
|
263 /** |
|
264 * Loads a masked image and appends it in the image array. |
|
265 */ |
|
266 void LoadImageL( TInt aBitmapId, TInt aMaskId ); |
|
267 |
|
268 /** |
|
269 * Creates color skinned bitmap. |
|
270 */ |
|
271 CFbsBitmap* CreateSkinnedColourBitmapL(); |
|
272 |
|
273 private: //data |
|
274 |
|
275 TInt iFlags; |
|
276 |
|
277 CArrayPtrFlat<CFbsBitmap>* iBitmaps; |
|
278 |
|
279 RWindowGroup iMyWindowGroup; |
|
280 |
|
281 CEikImage* iSmallCallIndication; |
|
282 CIncallAnim* iSmallIndiAnim; |
|
283 CEikImage* iBubble; |
|
284 CEikImage* iTypeIndication1; |
|
285 CEikImage* iTypeIndication2; |
|
286 CEikImage* iCyphOffIcon; |
|
287 |
|
288 CIncallMuted* iMutedIcon; |
|
289 |
|
290 RPointerArray<SSkinnedImage> iSkins; |
|
291 TLinearOrder<SSkinnedImage> iOrder; |
|
292 CFbsBitmap* iSkinnedColourBitmap; |
|
293 TBool iPressedDown; // Whether we've pressed down the incall bubble. |
|
294 }; |
|
295 |
|
296 #endif // INCALLSTATUSBUBBLE_H |
|
297 |
|
298 // End of File |