|
1 /* |
|
2 * Copyright (c) 2007 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 * Abstract base class for headers |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef BUBBLEHEADER_H |
|
21 #define BUBBLEHEADER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "BMBubbleManager.h" |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * CBubbleHeader class |
|
30 * |
|
31 * Abstract base class for headers. |
|
32 * |
|
33 * @lib bubblemanager |
|
34 * @since 1.0 |
|
35 */ |
|
36 |
|
37 class CBubbleHeader : public CBase |
|
38 { |
|
39 public: |
|
40 // Different call image types |
|
41 enum TBMCallObjectImageType |
|
42 { |
|
43 ENotDefined, |
|
44 EThemeImage, |
|
45 EGalleryImage, |
|
46 ETextBasedImage |
|
47 }; |
|
48 |
|
49 public: // Constructors and destructor |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CBubbleHeader(); |
|
54 |
|
55 public: // Member functions |
|
56 |
|
57 /** |
|
58 * To put everything in initial state. |
|
59 */ |
|
60 virtual void Reset( ) = 0; |
|
61 |
|
62 /** |
|
63 * Next functions are for CBubbleManager to set current state |
|
64 */ |
|
65 |
|
66 /** |
|
67 * Set header in use/unuse. |
|
68 * @param aIsUsed ETrue if header is take into use. |
|
69 */ |
|
70 virtual void SetIsUsed( const TBool& aIsUsed ) = 0; |
|
71 |
|
72 /** |
|
73 * Set header to conference. |
|
74 * @param aIsInConference ETrue if set in conference call. |
|
75 * Panics if this is a conf header. |
|
76 */ |
|
77 void SetIsInConference( const TBool& aIsInConference ); |
|
78 |
|
79 /** |
|
80 * Set thumbnail image. Ownership is not tranferred. |
|
81 * @param aThumbnailBitmap The bitmap. NULL means no thumbnail. |
|
82 */ |
|
83 void SetTnBitmap( CFbsBitmap* aThumbnailBitmap ); |
|
84 |
|
85 /** |
|
86 * Set thumbnail mask. Ownership is not tranferred. |
|
87 * @param aThumbnailBitmapMask The bitmap. NULL means no mask. |
|
88 */ |
|
89 void SetTnBitmapMask( CFbsBitmap* aThumbnailBitmapMask ); |
|
90 |
|
91 /** |
|
92 * Set thumbnail ownership. By default thumbnail bitmaps (image and mask) |
|
93 * are owned externally. |
|
94 * @param aOwnership ETrue if ownership is transferred to header. |
|
95 */ |
|
96 void SetTnDataOwnership( TBool aOwnership ); |
|
97 |
|
98 /** |
|
99 * Set call object image. Ownership is not tranferred. |
|
100 * @param aCOImageBitmap Pointer to bitmap. NULL means no image. |
|
101 */ |
|
102 void SetCallObjectImage( CFbsBitmap* aCOImageBitmap ); |
|
103 |
|
104 /** |
|
105 * Set call object image mask. Ownership is not tranferred. |
|
106 * @param aCOImageBitmapMask Pointer to mask. NULL means no mask. |
|
107 */ |
|
108 void SetCallObjectImageMask( CFbsBitmap* aCOImageBitmapMask ); |
|
109 |
|
110 /** |
|
111 * Set call object file name. Ownership is tranferred. |
|
112 * @param aCOImageFileName Pointer to buffer holding the file name. |
|
113 */ |
|
114 void SetCallObjectFileName( const HBufC* aCOFileName ); |
|
115 |
|
116 /** |
|
117 * Set call object text. Ownership is tranferred. |
|
118 * @param aCOText Pointer to buffer holding the text. |
|
119 */ |
|
120 void SetCallObjectText( const HBufC* aCOText ); |
|
121 |
|
122 /** |
|
123 * Set call object image data ownership. By default image |
|
124 * data (image and mask) is owned externally. |
|
125 * @param aOwnership ETrue if ownership is transferred to header. |
|
126 */ |
|
127 void SetCallObjectImageDataOwnership( TBool aOwnership ); |
|
128 |
|
129 |
|
130 /** |
|
131 * Set type of assigned call image. |
|
132 * @param aType The type. |
|
133 */ |
|
134 void SetCallObjectImageType( |
|
135 TBMCallObjectImageType aType ); |
|
136 |
|
137 /** |
|
138 * Switches call image to thumbnail version, if available. |
|
139 * Bigger version is released. |
|
140 */ |
|
141 void SwitchToThumbnailImage(); |
|
142 |
|
143 /** |
|
144 * Set call state. |
|
145 * @param aPhoneCallState The state. |
|
146 */ |
|
147 void SetCallState( |
|
148 const CBubbleManager::TPhoneCallState& aPhoneCallState ); |
|
149 |
|
150 /** |
|
151 * Set number type. |
|
152 * @param aNumberType The number type enum (see CBubbleManaher.h). |
|
153 */ |
|
154 void SetNumberType( |
|
155 const CBubbleManager::TPhoneNumberType& aNumberType ); |
|
156 |
|
157 /** |
|
158 * Set call flags. |
|
159 * @param aCallFlags Call flags (see CBubbleManaher.h). |
|
160 */ |
|
161 void SetCallFlags( const TUint32& aCallFlags ); |
|
162 |
|
163 /** |
|
164 * Set current flag on. |
|
165 * @param aFlag The flag. |
|
166 */ |
|
167 void SetCallFlag( const CBubbleManager::TPhoneCallTypeFlags& aFlag ); |
|
168 |
|
169 /** |
|
170 * Remove flag |
|
171 * @param aFlag The flag. |
|
172 */ |
|
173 void RemoveCallFlag( const CBubbleManager::TPhoneCallTypeFlags& aFlag ); |
|
174 |
|
175 /** |
|
176 * Set bubble id for header. |
|
177 * @param aBubbleId The id. |
|
178 */ |
|
179 void SetBubbleId( const CBubbleManager::TBubbleId& aBubbleId ); |
|
180 |
|
181 /** |
|
182 * Set text label to header. |
|
183 * @param aText The label text. |
|
184 * @param aClipDirection Text clipping direction. |
|
185 */ |
|
186 void SetText( |
|
187 const TDesC16& aText, |
|
188 const CBubbleManager::TPhoneClippingDirection& aClipDirection ); |
|
189 |
|
190 /** |
|
191 * Set caller line identification to header. |
|
192 * @param aCLI The CLI. |
|
193 * @param aClipDirection Text clipping direction. |
|
194 */ |
|
195 void SetCLI( |
|
196 const CBubbleManager::TBubbleLabelString& aCLI, |
|
197 const CBubbleManager::TPhoneClippingDirection& aClipDirection ); |
|
198 |
|
199 /** |
|
200 * Set timer/cost value to header. |
|
201 * @param aTimerCost Timer or cost value. |
|
202 */ |
|
203 void SetTimerCost( |
|
204 const CBubbleManager::TBubbleLabelString& aTimerCost ); |
|
205 |
|
206 /** |
|
207 * Set caller name presentation to header. |
|
208 * @param aCNAP The CNAP. |
|
209 * @param aClipDirection Text clipping direction. |
|
210 * @since Series60 2.6 |
|
211 */ |
|
212 void SetCNAP( |
|
213 const CBubbleManager::TBubbleLabelString& aCNAP, |
|
214 const CBubbleManager::TPhoneClippingDirection& aClipDirection ); |
|
215 |
|
216 /** |
|
217 * Set CLI used in conference call participant list. |
|
218 * @since S60 5.0. |
|
219 * @param aParticipantCLI Participant list CLI type. |
|
220 */ |
|
221 void SetParticipantListCLI( |
|
222 CBubbleManager::TBubbleParticipantListCLI aParticipantCLI ); |
|
223 |
|
224 /** |
|
225 * Next functions are for CBubbleOutlook:s to fetch information |
|
226 */ |
|
227 |
|
228 /** |
|
229 * Is header in use? |
|
230 * @return ETrue if in use. |
|
231 */ |
|
232 virtual TBool IsUsed( ) const = 0; |
|
233 |
|
234 /** |
|
235 * Is header in conference call? |
|
236 * @return ETrue if header is in conf. |
|
237 */ |
|
238 TBool IsInConference( ) const; |
|
239 |
|
240 /** |
|
241 * Is this header conference header? |
|
242 * @return ETrue if this in conference header. |
|
243 */ |
|
244 virtual TBool IsConference( ) const = 0; |
|
245 |
|
246 /** |
|
247 * Get the thumbnail icon bitmap. |
|
248 * @return The icon bitmap. |
|
249 */ |
|
250 CFbsBitmap* TnIconBitmap( ) const; |
|
251 |
|
252 /** |
|
253 * Get bitmap. |
|
254 * @return The bitmap. |
|
255 */ |
|
256 CFbsBitmap* TnBitmap( ) const; |
|
257 |
|
258 /** |
|
259 * Get bitmap mask. |
|
260 * @return The mask. |
|
261 */ |
|
262 CFbsBitmap* TnBitmapMask( ) const; |
|
263 |
|
264 /** |
|
265 * Get call object image bitmap. |
|
266 * @return The bitmap. |
|
267 */ |
|
268 CFbsBitmap* CallObjectImage( ) const; |
|
269 |
|
270 /** |
|
271 * Get call object image mask. |
|
272 * @return The mask. |
|
273 */ |
|
274 CFbsBitmap* CallObjectImageMask( ) const; |
|
275 |
|
276 /** |
|
277 * Get call object file name. |
|
278 * @return The file name. |
|
279 */ |
|
280 const TDesC& CallObjectFileName( ) const; |
|
281 |
|
282 /** |
|
283 * Get call object text. |
|
284 * @return The text. |
|
285 */ |
|
286 const TDesC& CallObjectText( ) const; |
|
287 |
|
288 /** |
|
289 * Get call image type. This is valid only, if call image |
|
290 * bitmap exists. |
|
291 * @return The type. |
|
292 */ |
|
293 TBMCallObjectImageType CallObjectImageType() const; |
|
294 |
|
295 /** |
|
296 * Get call state. |
|
297 * @return The state. |
|
298 */ |
|
299 CBubbleManager::TPhoneCallState CallState( ) const; |
|
300 |
|
301 /** |
|
302 * Get previous call state. |
|
303 * @return The previous state. |
|
304 */ |
|
305 CBubbleManager::TPhoneCallState PreviousCallState( ) const; |
|
306 |
|
307 /** |
|
308 * Get number type. |
|
309 * @return The number type. |
|
310 */ |
|
311 CBubbleManager::TPhoneNumberType NumberType( ) const; |
|
312 |
|
313 /** |
|
314 * Get call flags. |
|
315 * @return The flags. |
|
316 */ |
|
317 TUint32 CallFlags( ) const; |
|
318 |
|
319 /** |
|
320 * Get bubble id. |
|
321 * @return The id. |
|
322 */ |
|
323 CBubbleManager::TBubbleId BubbleId( ) const; |
|
324 |
|
325 /** |
|
326 * Get label text. |
|
327 * @return The text. |
|
328 */ |
|
329 const TDesC16& Text( ) const; |
|
330 |
|
331 /** |
|
332 * Get label's clipping direction. |
|
333 * @return The clip dir. |
|
334 */ |
|
335 CBubbleManager::TPhoneClippingDirection TextClipDirection( ) const; |
|
336 |
|
337 /** |
|
338 * Get caller line identificatoin. |
|
339 * @return The CLI. |
|
340 */ |
|
341 const CBubbleManager::TBubbleLabelString& CLI( ) const; |
|
342 |
|
343 /** |
|
344 * Get CLI's clip direction. |
|
345 * @return The dir. |
|
346 */ |
|
347 CBubbleManager::TPhoneClippingDirection CLIClipDirection( ) const; |
|
348 |
|
349 /** |
|
350 * Get timer/cost text. |
|
351 * @return The text. |
|
352 */ |
|
353 const CBubbleManager::TBubbleLabelString& TimerCost( ) const; |
|
354 |
|
355 /** |
|
356 * Get caller name presentation. |
|
357 * @since Series60 2.6 |
|
358 * @return The CNAP. |
|
359 */ |
|
360 const CBubbleManager::TBubbleLabelString& CNAP( ) const; |
|
361 |
|
362 /** |
|
363 * Get CNAP's clip direction. |
|
364 * @since Series60 2.6 |
|
365 * @return The dir. |
|
366 */ |
|
367 CBubbleManager::TPhoneClippingDirection CNAPClipDirection( ) const; |
|
368 |
|
369 /** |
|
370 * Get CLI used in conference call participant list. |
|
371 * @since S60 5.0. |
|
372 * @return aParticipantCLI CLI type. |
|
373 */ |
|
374 CBubbleManager::TBubbleParticipantListCLI ParticipantListCLI() const; |
|
375 |
|
376 protected: |
|
377 |
|
378 /** |
|
379 * Base's 1st phase constructor. |
|
380 */ |
|
381 CBubbleHeader(); |
|
382 |
|
383 /** |
|
384 * Base's 2nd phase constructor. |
|
385 */ |
|
386 void ConstructL(const CBubbleManager::TBubbleId& aBubbleId); |
|
387 |
|
388 /** |
|
389 * For resetting the values. |
|
390 */ |
|
391 void ResetParent(); |
|
392 |
|
393 private: //data |
|
394 // Call state |
|
395 CBubbleManager::TPhoneCallState iPhoneCallState; |
|
396 // Previous call state |
|
397 CBubbleManager::TPhoneCallState iPreviousCallState; |
|
398 // Number tyoe |
|
399 CBubbleManager::TPhoneNumberType iNumberType; |
|
400 // Call flags |
|
401 TUint32 iCallFlags; |
|
402 // Internal flags |
|
403 TUint8 iInternalFlags; |
|
404 |
|
405 // Thumbnail icon bitmap |
|
406 CFbsBitmap* iThumbnailIconBitmap; |
|
407 |
|
408 // Thumbnail image |
|
409 CFbsBitmap* iThumbnailBitmap; |
|
410 // TN mask |
|
411 CFbsBitmap* iThumbnailBitmapMask; |
|
412 // Identifier |
|
413 CBubbleManager::TBubbleId iBubbleId; |
|
414 // Label text |
|
415 HBufC16* iText; |
|
416 // CLI text |
|
417 CBubbleManager::TBubbleLabelString iCLI; |
|
418 // Timer/cost value |
|
419 CBubbleManager::TBubbleLabelString iTimerCost; |
|
420 // Cnap text |
|
421 CBubbleManager::TBubbleLabelString iCNAP; |
|
422 // Call object image |
|
423 CFbsBitmap* iCOImageBitmap; |
|
424 // Call object image mask |
|
425 CFbsBitmap* iCOImageBitmapMask; |
|
426 // Call object file name |
|
427 const HBufC* iCOFileName; |
|
428 // Call object text |
|
429 const HBufC* iCOText; |
|
430 // Call object image data ownership |
|
431 enum TBMCOImageDataOwnership |
|
432 { |
|
433 EBubbleCallImageOwned = 1, |
|
434 EBubbleThumbnailImageOwned = 2 |
|
435 }; |
|
436 TBool iCOImageDataOwnership; |
|
437 // Call object image type |
|
438 TBMCallObjectImageType iCOImageType; |
|
439 // CLI for participant list. |
|
440 CBubbleManager::TBubbleParticipantListCLI iParticipantCLI; |
|
441 private: |
|
442 friend class CT_CBubbleHeader; |
|
443 |
|
444 }; |
|
445 |
|
446 #endif //BUBBLEHEADER_H |
|
447 |
|
448 // End of File |