|
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: Header |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "BMBubbleHeader.h" |
|
21 #include "BMPanic.h" |
|
22 |
|
23 #include <AknsUtils.h> |
|
24 |
|
25 // CONSTANTS |
|
26 const TUint8 KBubbleHeaderIsInConf = 0x01; // 1 if is in conf |
|
27 const TUint8 KBubbleHeaderCLIClipDirLeft = 0x02; // 1 if clipped from left |
|
28 const TUint8 KBubbleHeaderLabelClipDirLeft = 0x04; |
|
29 const TUint8 KBubbleHeaderCNAPClipDirLeft = 0x08; // 1 if clipped from left |
|
30 |
|
31 // ========================= MEMBER FUNCTIONS ================================ |
|
32 |
|
33 // Constructor |
|
34 CBubbleHeader::CBubbleHeader( ) |
|
35 { |
|
36 } |
|
37 |
|
38 |
|
39 // --------------------------------------------------------------------------- |
|
40 // CBubbleHeader::ConstructL |
|
41 // Symbian OS two phased constructor called by inherited classes |
|
42 // |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 void CBubbleHeader::ConstructL( const CBubbleManager::TBubbleId& aBubbleId ) |
|
46 { |
|
47 iBubbleId = aBubbleId; |
|
48 } |
|
49 |
|
50 // Destructor |
|
51 CBubbleHeader::~CBubbleHeader() |
|
52 { |
|
53 delete iThumbnailIconBitmap; |
|
54 if ( iCOImageDataOwnership & EBubbleThumbnailImageOwned ) |
|
55 { |
|
56 delete iThumbnailBitmap; |
|
57 delete iThumbnailBitmapMask; |
|
58 } |
|
59 |
|
60 if ( iCOImageDataOwnership & EBubbleCallImageOwned ) |
|
61 { |
|
62 delete iCOImageBitmap; |
|
63 delete iCOImageBitmapMask; |
|
64 } |
|
65 delete iText; |
|
66 delete iCOFileName; |
|
67 delete iCOText; |
|
68 } |
|
69 |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // CBubbleHeader::SetIsInConference |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 void CBubbleHeader::SetIsInConference( const TBool& aIsInConference ) |
|
76 { |
|
77 // can't put conference in conference |
|
78 if ( IsConference( ) ) |
|
79 { |
|
80 __ASSERT_ALWAYS( !aIsInConference, |
|
81 Panic( EBMPanicReferredHeaderIsConferenceHeader ) ); |
|
82 } |
|
83 |
|
84 if ( aIsInConference ) |
|
85 { |
|
86 iInternalFlags |= iInternalFlags|KBubbleHeaderIsInConf; |
|
87 return; |
|
88 } |
|
89 |
|
90 iInternalFlags &= iInternalFlags&~KBubbleHeaderIsInConf; |
|
91 } |
|
92 |
|
93 |
|
94 // --------------------------------------------------------------------------- |
|
95 // CBubbleHeader::SetTnBitmap |
|
96 // --------------------------------------------------------------------------- |
|
97 // |
|
98 void CBubbleHeader::SetTnBitmap( CFbsBitmap* aThumbnailBitmap ) |
|
99 { |
|
100 // can't set thumbnail for conference call |
|
101 if ( IsConference( ) ) |
|
102 { |
|
103 __ASSERT_DEBUG( aThumbnailBitmap == NULL, |
|
104 Panic( EBMPanicReferredHeaderIsConferenceHeader ) ); |
|
105 } |
|
106 |
|
107 if ( iCOImageDataOwnership & EBubbleThumbnailImageOwned ) |
|
108 { |
|
109 delete iThumbnailBitmap; |
|
110 |
|
111 } |
|
112 iThumbnailBitmap = aThumbnailBitmap; |
|
113 if ( aThumbnailBitmap != NULL && |
|
114 !(iCOImageDataOwnership & EBubbleThumbnailImageOwned ) ) |
|
115 { |
|
116 CFbsBitmap* bitmap = new CFbsBitmap; |
|
117 if ( bitmap != NULL ) |
|
118 { |
|
119 bitmap->Duplicate( aThumbnailBitmap->Handle() ); |
|
120 delete iThumbnailIconBitmap; |
|
121 iThumbnailIconBitmap = NULL; |
|
122 TRAP_IGNORE( |
|
123 iThumbnailIconBitmap = AknIconUtils::CreateIconL( bitmap )); |
|
124 } |
|
125 } |
|
126 } |
|
127 |
|
128 // --------------------------------------------------------------------------- |
|
129 // CBubbleHeader::SetTnBitmapMask |
|
130 // --------------------------------------------------------------------------- |
|
131 // |
|
132 void CBubbleHeader::SetTnBitmapMask( CFbsBitmap* aThumbnailBitmapMask ) |
|
133 { |
|
134 // can't set thumbnail for conference call |
|
135 if ( IsConference( ) ) |
|
136 { |
|
137 __ASSERT_DEBUG( aThumbnailBitmapMask == NULL, |
|
138 Panic( EBMPanicReferredHeaderIsConferenceHeader ) ); |
|
139 } |
|
140 |
|
141 if ( iCOImageDataOwnership & EBubbleThumbnailImageOwned ) |
|
142 { |
|
143 delete iThumbnailBitmapMask; |
|
144 |
|
145 } |
|
146 iThumbnailBitmapMask = aThumbnailBitmapMask; |
|
147 } |
|
148 |
|
149 // --------------------------------------------------------------------------- |
|
150 // CBubbleHeader::SetTnDataOwnership |
|
151 // --------------------------------------------------------------------------- |
|
152 // |
|
153 void CBubbleHeader::SetTnDataOwnership( TBool aOwnership ) |
|
154 { |
|
155 if ( aOwnership ) |
|
156 { |
|
157 iCOImageDataOwnership |= EBubbleThumbnailImageOwned; |
|
158 } |
|
159 else |
|
160 { |
|
161 iCOImageDataOwnership &= ~EBubbleThumbnailImageOwned; |
|
162 } |
|
163 } |
|
164 |
|
165 // --------------------------------------------------------------------------- |
|
166 // CBubbleHeader::SetCallObjectImage |
|
167 // --------------------------------------------------------------------------- |
|
168 // |
|
169 void CBubbleHeader::SetCallObjectImage( CFbsBitmap* aCOImageBitmap ) |
|
170 { |
|
171 if ( iCOImageDataOwnership & EBubbleCallImageOwned ) |
|
172 { |
|
173 delete iCOImageBitmap; |
|
174 } |
|
175 |
|
176 iCOImageBitmap = aCOImageBitmap; |
|
177 } |
|
178 |
|
179 // --------------------------------------------------------------------------- |
|
180 // CBubbleHeader::SetCallObjectImageMask |
|
181 // --------------------------------------------------------------------------- |
|
182 // |
|
183 void CBubbleHeader::SetCallObjectImageMask( CFbsBitmap* aCOImageBitmapMask ) |
|
184 { |
|
185 if ( iCOImageDataOwnership & EBubbleCallImageOwned ) |
|
186 { |
|
187 delete iCOImageBitmapMask; |
|
188 } |
|
189 |
|
190 iCOImageBitmapMask = aCOImageBitmapMask; |
|
191 } |
|
192 |
|
193 // --------------------------------------------------------------------------- |
|
194 // CBubbleHeader::SetCallObjectFileName |
|
195 // --------------------------------------------------------------------------- |
|
196 // |
|
197 void CBubbleHeader::SetCallObjectFileName( const HBufC* aCOFileName ) |
|
198 { |
|
199 delete iCOFileName; |
|
200 iCOFileName = aCOFileName; |
|
201 } |
|
202 |
|
203 // --------------------------------------------------------------------------- |
|
204 // CBubbleHeader::SetCallObjectText |
|
205 // --------------------------------------------------------------------------- |
|
206 // |
|
207 void CBubbleHeader::SetCallObjectText( const HBufC* aCOText ) |
|
208 { |
|
209 // can't set text for conference call |
|
210 if ( IsConference( ) ) |
|
211 { |
|
212 __ASSERT_DEBUG( aCOText == NULL, |
|
213 Panic( EBMPanicReferredHeaderIsConferenceHeader ) ); |
|
214 } |
|
215 |
|
216 delete iCOText; |
|
217 iCOText = aCOText; |
|
218 } |
|
219 |
|
220 // --------------------------------------------------------------------------- |
|
221 // CBubbleHeader::SetCallObjectImageDataOwnership |
|
222 // --------------------------------------------------------------------------- |
|
223 // |
|
224 void CBubbleHeader::SetCallObjectImageDataOwnership( TBool aOwnership ) |
|
225 { |
|
226 if ( aOwnership ) |
|
227 { |
|
228 iCOImageDataOwnership |= EBubbleCallImageOwned; |
|
229 } |
|
230 else |
|
231 { |
|
232 iCOImageDataOwnership &= ~EBubbleCallImageOwned; |
|
233 } |
|
234 } |
|
235 |
|
236 // --------------------------------------------------------------------------- |
|
237 // CBubbleHeader::SetCallObjectImageType() |
|
238 // --------------------------------------------------------------------------- |
|
239 // |
|
240 void CBubbleHeader::SetCallObjectImageType( TBMCallObjectImageType aType ) |
|
241 { |
|
242 iCOImageType = aType; |
|
243 } |
|
244 |
|
245 // --------------------------------------------------------------------------- |
|
246 // CBubbleHeader::SwitchToThumbnailImage |
|
247 // --------------------------------------------------------------------------- |
|
248 // |
|
249 void CBubbleHeader::SwitchToThumbnailImage() |
|
250 { |
|
251 if ( iThumbnailBitmap ) |
|
252 { |
|
253 // Release big image |
|
254 if ( iCOImageDataOwnership & EBubbleCallImageOwned ) |
|
255 { |
|
256 delete iCOImageBitmap; |
|
257 delete iCOImageBitmapMask; |
|
258 } |
|
259 |
|
260 // Switch bitmaps |
|
261 iCOImageBitmap = iThumbnailBitmap; |
|
262 iThumbnailBitmap = NULL; |
|
263 iCOImageBitmapMask = iThumbnailBitmapMask; |
|
264 iThumbnailBitmapMask = NULL; |
|
265 |
|
266 // Update ownerships |
|
267 if ( iCOImageDataOwnership & EBubbleThumbnailImageOwned ) |
|
268 { |
|
269 iCOImageDataOwnership |= EBubbleCallImageOwned; |
|
270 } |
|
271 else |
|
272 { |
|
273 iCOImageDataOwnership &= ~EBubbleCallImageOwned; |
|
274 } |
|
275 iCOImageDataOwnership &= ~EBubbleThumbnailImageOwned; |
|
276 } |
|
277 } |
|
278 |
|
279 // --------------------------------------------------------------------------- |
|
280 // CBubbleHeader::SetCallState |
|
281 // --------------------------------------------------------------------------- |
|
282 // |
|
283 void CBubbleHeader::SetCallState( |
|
284 const CBubbleManager::TPhoneCallState& aPhoneCallState ) |
|
285 { |
|
286 // can't set conference to incoming, outgoing or waiting state |
|
287 if ( IsConference( ) ) |
|
288 { |
|
289 __ASSERT_ALWAYS( aPhoneCallState!=CBubbleManager::EWaiting && |
|
290 aPhoneCallState!=CBubbleManager::EIncoming && |
|
291 aPhoneCallState!=CBubbleManager::EAlerting && |
|
292 aPhoneCallState!=CBubbleManager::EOutgoing, |
|
293 Panic( EBMPanicReferredHeaderIsConferenceHeader ) ); |
|
294 } |
|
295 |
|
296 // if state is changed to disconnected, previous stage must be checked |
|
297 // to get the correct disconnect mode. |
|
298 if ( aPhoneCallState == CBubbleManager::EDisconnected ) |
|
299 { |
|
300 if ( iPhoneCallState == CBubbleManager::EWaiting || |
|
301 iPhoneCallState == CBubbleManager::EIncoming || |
|
302 iPhoneCallState == CBubbleManager::EAlerting || |
|
303 iPhoneCallState == CBubbleManager::EOutgoing || |
|
304 iPhoneCallState == CBubbleManager::EAlertToDisconnected ) |
|
305 { |
|
306 // changes the bubbles to be rectangles |
|
307 if ( aPhoneCallState != iPhoneCallState ) |
|
308 { |
|
309 iPreviousCallState = iPhoneCallState; |
|
310 } |
|
311 iPhoneCallState = CBubbleManager::EAlertToDisconnected; |
|
312 return; |
|
313 } |
|
314 } |
|
315 // else put normal disconnected or what ever the new state is |
|
316 if ( aPhoneCallState != iPhoneCallState ) |
|
317 { |
|
318 iPreviousCallState = iPhoneCallState; |
|
319 } |
|
320 iPhoneCallState = aPhoneCallState; |
|
321 } |
|
322 |
|
323 // --------------------------------------------------------------------------- |
|
324 // CBubbleHeader::SetNumberType |
|
325 // --------------------------------------------------------------------------- |
|
326 // |
|
327 void CBubbleHeader::SetNumberType( |
|
328 const CBubbleManager::TPhoneNumberType& aNumberType ) |
|
329 { |
|
330 // can't set the number type else than ENotSet for conference |
|
331 if ( IsConference( ) ) |
|
332 { |
|
333 __ASSERT_DEBUG( aNumberType==CBubbleManager::ENotSet, |
|
334 Panic( EBMPanicReferredHeaderIsConferenceHeader ) ); |
|
335 } |
|
336 |
|
337 iNumberType = aNumberType; |
|
338 } |
|
339 |
|
340 // --------------------------------------------------------------------------- |
|
341 // CBubbleHeader::SetCallFlags |
|
342 // --------------------------------------------------------------------------- |
|
343 // |
|
344 void CBubbleHeader::SetCallFlags( const TUint32& aCallFlags ) |
|
345 { |
|
346 iCallFlags = aCallFlags; |
|
347 } |
|
348 |
|
349 // --------------------------------------------------------------------------- |
|
350 // CBubbleHeader::SetCallFlag |
|
351 // |
|
352 // |
|
353 // --------------------------------------------------------------------------- |
|
354 // |
|
355 void CBubbleHeader::SetCallFlag( |
|
356 const CBubbleManager::TPhoneCallTypeFlags& aFlag ) |
|
357 { |
|
358 if ( aFlag == CBubbleManager::ENormal ) |
|
359 { |
|
360 iCallFlags = 0; |
|
361 return; |
|
362 } |
|
363 |
|
364 iCallFlags |= aFlag; |
|
365 } |
|
366 |
|
367 // --------------------------------------------------------------------------- |
|
368 // CBubbleHeader::RemoveCallFlag |
|
369 // --------------------------------------------------------------------------- |
|
370 // |
|
371 void CBubbleHeader::RemoveCallFlag( |
|
372 const CBubbleManager::TPhoneCallTypeFlags& aFlag ) |
|
373 { |
|
374 if ( aFlag == CBubbleManager::ENormal ) |
|
375 { |
|
376 return; |
|
377 } |
|
378 iCallFlags &= ~aFlag; |
|
379 } |
|
380 |
|
381 // --------------------------------------------------------------------------- |
|
382 // CBubbleHeader::SetBubbleId |
|
383 // --------------------------------------------------------------------------- |
|
384 // |
|
385 void CBubbleHeader::SetBubbleId( const CBubbleManager::TBubbleId& aBubbleId ) |
|
386 { |
|
387 iBubbleId = aBubbleId; |
|
388 } |
|
389 |
|
390 // --------------------------------------------------------------------------- |
|
391 // CBubbleHeader::SetText |
|
392 // --------------------------------------------------------------------------- |
|
393 // |
|
394 void CBubbleHeader::SetText( |
|
395 const TDesC16& aText, |
|
396 const CBubbleManager::TPhoneClippingDirection& aClipDirection ) |
|
397 { |
|
398 if ( iText ) |
|
399 { |
|
400 delete iText; |
|
401 iText = NULL; |
|
402 } |
|
403 |
|
404 iText = aText.Alloc(); |
|
405 |
|
406 if ( aClipDirection == CBubbleManager::ELeft ) |
|
407 { |
|
408 iInternalFlags |= iInternalFlags|KBubbleHeaderLabelClipDirLeft; |
|
409 return; |
|
410 } |
|
411 iInternalFlags &= iInternalFlags&~KBubbleHeaderLabelClipDirLeft; |
|
412 } |
|
413 |
|
414 // --------------------------------------------------------------------------- |
|
415 // CBubbleHeader::SetCLI |
|
416 // --------------------------------------------------------------------------- |
|
417 // |
|
418 void CBubbleHeader::SetCLI( |
|
419 const CBubbleManager::TBubbleLabelString& aCLI, |
|
420 const CBubbleManager::TPhoneClippingDirection& aClipDirection ) |
|
421 { |
|
422 iCLI = aCLI; |
|
423 |
|
424 if ( aClipDirection == CBubbleManager::ELeft ) |
|
425 { |
|
426 iInternalFlags |= iInternalFlags|KBubbleHeaderCLIClipDirLeft; |
|
427 return; |
|
428 } |
|
429 iInternalFlags &= iInternalFlags&~KBubbleHeaderCLIClipDirLeft; |
|
430 } |
|
431 |
|
432 // --------------------------------------------------------------------------- |
|
433 // CBubbleHeader::SetTimerCost |
|
434 // --------------------------------------------------------------------------- |
|
435 // |
|
436 void CBubbleHeader::SetTimerCost( |
|
437 const CBubbleManager::TBubbleLabelString& aTimerCost ) |
|
438 { |
|
439 iTimerCost = aTimerCost; |
|
440 } |
|
441 |
|
442 // --------------------------------------------------------------------------- |
|
443 // CBubbleHeader::SetCNAP |
|
444 // --------------------------------------------------------------------------- |
|
445 // |
|
446 void CBubbleHeader::SetCNAP( |
|
447 const CBubbleManager::TBubbleLabelString& aCNAP, |
|
448 const CBubbleManager::TPhoneClippingDirection& aClipDirection ) |
|
449 { |
|
450 iCNAP = aCNAP; |
|
451 |
|
452 if ( aClipDirection == CBubbleManager::ELeft ) |
|
453 { |
|
454 iInternalFlags |= iInternalFlags|KBubbleHeaderCNAPClipDirLeft; |
|
455 return; |
|
456 } |
|
457 iInternalFlags &= iInternalFlags&~KBubbleHeaderCNAPClipDirLeft; |
|
458 } |
|
459 |
|
460 // --------------------------------------------------------------------------- |
|
461 // CBubbleHeader::SetParticipantListCLI |
|
462 // --------------------------------------------------------------------------- |
|
463 // |
|
464 void CBubbleHeader::SetParticipantListCLI( |
|
465 CBubbleManager::TBubbleParticipantListCLI aParticipantCLI ) |
|
466 { |
|
467 iParticipantCLI = aParticipantCLI; |
|
468 } |
|
469 |
|
470 // --------------------------------------------------------------------------- |
|
471 // CBubbleHeader::IsInConference |
|
472 // --------------------------------------------------------------------------- |
|
473 // |
|
474 TBool CBubbleHeader::IsInConference( ) const |
|
475 { |
|
476 if ( iInternalFlags&KBubbleHeaderIsInConf ) |
|
477 { |
|
478 return ETrue; |
|
479 } |
|
480 return EFalse; |
|
481 } |
|
482 |
|
483 // --------------------------------------------------------------------------- |
|
484 // CBubbleHeader::TnIconBitmap |
|
485 // --------------------------------------------------------------------------- |
|
486 // |
|
487 CFbsBitmap* CBubbleHeader::TnIconBitmap( ) const |
|
488 { |
|
489 return iThumbnailIconBitmap; |
|
490 } |
|
491 |
|
492 // --------------------------------------------------------------------------- |
|
493 // CBubbleHeader::TnBitmap |
|
494 // --------------------------------------------------------------------------- |
|
495 // |
|
496 CFbsBitmap* CBubbleHeader::TnBitmap( ) const |
|
497 { |
|
498 return iThumbnailBitmap; |
|
499 } |
|
500 |
|
501 // --------------------------------------------------------------------------- |
|
502 // CBubbleHeader::TnBitmapMask |
|
503 // --------------------------------------------------------------------------- |
|
504 // |
|
505 CFbsBitmap* CBubbleHeader::TnBitmapMask( ) const |
|
506 { |
|
507 return iThumbnailBitmapMask; |
|
508 } |
|
509 |
|
510 // --------------------------------------------------------------------------- |
|
511 // CBubbleHeader::CallObjectImage |
|
512 // --------------------------------------------------------------------------- |
|
513 // |
|
514 CFbsBitmap* CBubbleHeader::CallObjectImage( ) const |
|
515 { |
|
516 return iCOImageBitmap; |
|
517 } |
|
518 |
|
519 // --------------------------------------------------------------------------- |
|
520 // CBubbleHeader::CallObjectImageMask |
|
521 // --------------------------------------------------------------------------- |
|
522 // |
|
523 CFbsBitmap* CBubbleHeader::CallObjectImageMask( ) const |
|
524 { |
|
525 return iCOImageBitmapMask; |
|
526 } |
|
527 |
|
528 // --------------------------------------------------------------------------- |
|
529 // CBubbleHeader::CallObjectFileName |
|
530 // --------------------------------------------------------------------------- |
|
531 // |
|
532 const TDesC& CBubbleHeader::CallObjectFileName( ) const |
|
533 { |
|
534 if ( iCOFileName && iCOFileName->Length() ) |
|
535 { |
|
536 return *iCOFileName; |
|
537 } |
|
538 else |
|
539 { |
|
540 return KNullDesC; |
|
541 } |
|
542 } |
|
543 |
|
544 // --------------------------------------------------------------------------- |
|
545 // CBubbleHeader::CallObjectText |
|
546 // --------------------------------------------------------------------------- |
|
547 // |
|
548 const TDesC& CBubbleHeader::CallObjectText( ) const |
|
549 { |
|
550 if ( iCOText && iCOText->Length() ) |
|
551 { |
|
552 return *iCOText; |
|
553 } |
|
554 else |
|
555 { |
|
556 return KNullDesC; |
|
557 } |
|
558 } |
|
559 |
|
560 // --------------------------------------------------------------------------- |
|
561 // CBubbleHeader::CallObjectImageType() |
|
562 // --------------------------------------------------------------------------- |
|
563 // |
|
564 CBubbleHeader::TBMCallObjectImageType CBubbleHeader::CallObjectImageType() |
|
565 const |
|
566 { |
|
567 return iCOImageType; |
|
568 } |
|
569 |
|
570 // --------------------------------------------------------------------------- |
|
571 // CBubbleHeader::CallState |
|
572 // --------------------------------------------------------------------------- |
|
573 // |
|
574 CBubbleManager::TPhoneCallState CBubbleHeader::CallState( ) const |
|
575 { |
|
576 return iPhoneCallState; |
|
577 } |
|
578 |
|
579 // --------------------------------------------------------------------------- |
|
580 // CBubbleHeader::PreviousCallState |
|
581 // --------------------------------------------------------------------------- |
|
582 // |
|
583 CBubbleManager::TPhoneCallState CBubbleHeader::PreviousCallState( ) const |
|
584 { |
|
585 return iPreviousCallState; |
|
586 } |
|
587 |
|
588 // --------------------------------------------------------------------------- |
|
589 // CBubbleHeader::NumberType |
|
590 // --------------------------------------------------------------------------- |
|
591 // |
|
592 CBubbleManager::TPhoneNumberType CBubbleHeader::NumberType( ) const |
|
593 { |
|
594 return iNumberType; |
|
595 } |
|
596 |
|
597 // --------------------------------------------------------------------------- |
|
598 // CBubbleHeader::CallFlags |
|
599 // --------------------------------------------------------------------------- |
|
600 // |
|
601 TUint32 CBubbleHeader::CallFlags( ) const |
|
602 { |
|
603 return iCallFlags; |
|
604 } |
|
605 |
|
606 // --------------------------------------------------------------------------- |
|
607 // CBubbleHeader::Text |
|
608 // --------------------------------------------------------------------------- |
|
609 // |
|
610 const TDesC16& CBubbleHeader::Text() const |
|
611 { |
|
612 if ( iText ) |
|
613 { |
|
614 return *iText; |
|
615 } |
|
616 |
|
617 return KNullDesC; |
|
618 } |
|
619 |
|
620 // --------------------------------------------------------------------------- |
|
621 // CBubbleHeader::TextClipDirection |
|
622 // --------------------------------------------------------------------------- |
|
623 // |
|
624 CBubbleManager::TPhoneClippingDirection |
|
625 CBubbleHeader::TextClipDirection( ) const |
|
626 { |
|
627 if ( iInternalFlags&KBubbleHeaderLabelClipDirLeft ) |
|
628 { |
|
629 return CBubbleManager::ELeft; |
|
630 } |
|
631 return CBubbleManager::ERight; |
|
632 } |
|
633 |
|
634 // --------------------------------------------------------------------------- |
|
635 // CBubbleHeader::CLI |
|
636 // --------------------------------------------------------------------------- |
|
637 // |
|
638 const CBubbleManager::TBubbleLabelString& CBubbleHeader::CLI() const |
|
639 { |
|
640 return iCLI; |
|
641 } |
|
642 |
|
643 // --------------------------------------------------------------------------- |
|
644 // CBubbleHeader::CLIClipDirection |
|
645 // --------------------------------------------------------------------------- |
|
646 // |
|
647 CBubbleManager::TPhoneClippingDirection |
|
648 CBubbleHeader::CLIClipDirection( ) const |
|
649 { |
|
650 if ( iInternalFlags&KBubbleHeaderCLIClipDirLeft ) |
|
651 { |
|
652 return CBubbleManager::ELeft; |
|
653 } |
|
654 return CBubbleManager::ERight; |
|
655 } |
|
656 |
|
657 // --------------------------------------------------------------------------- |
|
658 // CBubbleHeader::TimerCost |
|
659 // --------------------------------------------------------------------------- |
|
660 // |
|
661 const CBubbleManager::TBubbleLabelString& CBubbleHeader::TimerCost() const |
|
662 { |
|
663 return iTimerCost; |
|
664 } |
|
665 |
|
666 // --------------------------------------------------------------------------- |
|
667 // CBubbleHeader::CNAP |
|
668 // --------------------------------------------------------------------------- |
|
669 // |
|
670 const CBubbleManager::TBubbleLabelString& CBubbleHeader::CNAP() const |
|
671 { |
|
672 return iCNAP; |
|
673 } |
|
674 |
|
675 // --------------------------------------------------------------------------- |
|
676 // CBubbleHeader::CNAPClipDirection |
|
677 // --------------------------------------------------------------------------- |
|
678 // |
|
679 CBubbleManager::TPhoneClippingDirection |
|
680 CBubbleHeader::CNAPClipDirection( ) const |
|
681 { |
|
682 if ( iInternalFlags&KBubbleHeaderCNAPClipDirLeft ) |
|
683 { |
|
684 return CBubbleManager::ELeft; |
|
685 } |
|
686 return CBubbleManager::ERight; |
|
687 } |
|
688 // --------------------------------------------------------------------------- |
|
689 // CBubbleHeader::BubbleId |
|
690 // --------------------------------------------------------------------------- |
|
691 // |
|
692 CBubbleManager::TBubbleId CBubbleHeader::BubbleId() const |
|
693 { |
|
694 return iBubbleId; |
|
695 } |
|
696 |
|
697 // --------------------------------------------------------------------------- |
|
698 // CBubbleHeader::ParticipantListCLI |
|
699 // --------------------------------------------------------------------------- |
|
700 // |
|
701 CBubbleManager::TBubbleParticipantListCLI |
|
702 CBubbleHeader::ParticipantListCLI() const |
|
703 { |
|
704 return iParticipantCLI; |
|
705 } |
|
706 |
|
707 |
|
708 // --------------------------------------------------------------------------- |
|
709 // CBubbleHeader::ResetParent |
|
710 // |
|
711 // Puts everything in initial state |
|
712 // --------------------------------------------------------------------------- |
|
713 // |
|
714 void CBubbleHeader::ResetParent() |
|
715 { |
|
716 iPhoneCallState = CBubbleManager::ENone; |
|
717 iNumberType = CBubbleManager::ENotSet; |
|
718 iCallFlags = 0; //normal |
|
719 delete iThumbnailIconBitmap; |
|
720 iThumbnailIconBitmap = NULL; |
|
721 |
|
722 if ( iCOImageDataOwnership & EBubbleThumbnailImageOwned ) |
|
723 { |
|
724 delete iThumbnailBitmap; |
|
725 delete iThumbnailBitmapMask; |
|
726 } |
|
727 |
|
728 iThumbnailBitmap = NULL; |
|
729 iThumbnailBitmapMask = NULL; |
|
730 |
|
731 if ( iCOImageDataOwnership & EBubbleCallImageOwned ) |
|
732 { |
|
733 delete iCOImageBitmap; |
|
734 delete iCOImageBitmapMask; |
|
735 } |
|
736 |
|
737 iCOImageBitmap = NULL; |
|
738 iCOImageBitmapMask = NULL; |
|
739 delete iCOText; |
|
740 iCOText = NULL; |
|
741 delete iCOFileName; |
|
742 iCOFileName = NULL; |
|
743 |
|
744 iCOImageDataOwnership = 0; |
|
745 iCOImageType = ENotDefined; |
|
746 |
|
747 if ( iText ) |
|
748 { |
|
749 delete iText; |
|
750 iText = NULL; |
|
751 } |
|
752 |
|
753 iCLI.Zero(); |
|
754 iTimerCost.Zero(); |
|
755 iCNAP.Zero(); |
|
756 iInternalFlags = 0; //normal |
|
757 iParticipantCLI = CBubbleManager::EParticipantListCLIText; |
|
758 } |
|
759 |
|
760 // End of Fíle |