textinput/peninputsplititut/src/peninputsplititutwindow.cpp
branchRCL_3
changeset 5 a47de9135b21
parent 0 eb1f2e154e89
child 6 6ceef9a83b1a
equal deleted inserted replaced
3:f5a1e66df979 5:a47de9135b21
    28 #include <AknFepGlobalEnums.h>
    28 #include <AknFepGlobalEnums.h>
    29 #include <aknfeppeninputenums.h>
    29 #include <aknfeppeninputenums.h>
    30 #include <peninputdropdownlist.h>
    30 #include <peninputdropdownlist.h>
    31 #include <s32mem.h>
    31 #include <s32mem.h>
    32 #include <peninputlabel.h>
    32 #include <peninputlabel.h>
    33 //#include <peninputlayoutbubblectrl.h>
    33 #include <peninputlayoutbubblectrl.h>
       
    34 #include <aknlayoutscalable_apps.cdl.h>
    34 
    35 
    35 #include "peninputsplititutwindow.h"
    36 #include "peninputsplititutwindow.h"
    36 #include "peninputsplititutdatamgr.h"
    37 #include "peninputsplititutdatamgr.h"
    37 #include "peninputsplititutuimgrbase.h"
    38 #include "peninputsplititutuimgrbase.h"
    38 #include "peninputsplititutuistatebase.h"
    39 #include "peninputsplititutuistatebase.h"
    40 #include "peninputsplititutwesternuimgr.h"
    41 #include "peninputsplititutwesternuimgr.h"
    41 #include "peninputsplititutconverter.h"
    42 #include "peninputsplititutconverter.h"
    42 #include "peninputcommonbgctrl.h"
    43 #include "peninputcommonbgctrl.h"
    43 
    44 
    44 _LIT(KBmpFileName, "z:\\resource\\apps\\peninputsplititut.mbm");
    45 _LIT(KBmpFileName, "z:\\resource\\apps\\peninputsplititut.mbm");
       
    46 _LIT(KEmptyString, "");
    45 
    47 
    46 const TInt KImageMajorSkinId = EAknsMajorGeneric;
    48 const TInt KImageMajorSkinId = EAknsMajorGeneric;
    47 const TUint KDefaultSpellTextColor = 0;
    49 const TUint KDefaultSpellTextColor = 0;
    48 
    50 
    49 const TInt KSpaceUnicode = 32;
    51 const TInt KSpaceUnicode = 32;
    50 const TInt KButtonOneUnicode = 49;
    52 const TInt KButtonOneUnicode = 49;
    51 const TInt KInvalidBmp = -1;
    53 const TInt KInvalidBmp = -1;
       
    54 
       
    55 const TUint KDefaultIcfTextColor = 0x000000;
       
    56 const TUint KDefaultIcfFrameColor = 0x000000;
       
    57 
       
    58 
       
    59 
    52 
    60 
    53 
    61 
    54 // ============================ MEMBER FUNCTIONS =============================
    62 // ============================ MEMBER FUNCTIONS =============================
    55 
    63 
    56 // ---------------------------------------------------------------------------
    64 // ---------------------------------------------------------------------------
    89 //
    97 //
    90 CSplitItutWindow::~CSplitItutWindow()
    98 CSplitItutWindow::~CSplitItutWindow()
    91     {
    99     {
    92     delete iBmpRotator;
   100     delete iBmpRotator;
    93     }
   101     }
       
   102 
    94 
   103 
    95 // ---------------------------------------------------------------------------
   104 // ---------------------------------------------------------------------------
    96 // CSplitItutWindow::SetPropertyL
   105 // CSplitItutWindow::SetPropertyL
    97 // ---------------------------------------------------------------------------
   106 // ---------------------------------------------------------------------------
    98 //
   107 //
   168     iStandardItutKp->SetResourceId(KInvalidResId);
   177     iStandardItutKp->SetResourceId(KInvalidResId);
   169 	
   178 	
   170 	// read keypad image info
   179 	// read keypad image info
   171 	ConstructKeyImageFromResourceL( R_ITUT_KEYPAD_BITMAP );
   180 	ConstructKeyImageFromResourceL( R_ITUT_KEYPAD_BITMAP );
   172 	
   181 	
   173     iStandardItutKp->SetKeyTextColorGroup( EAknsCIQsnTextColorsCG68 );
   182     iStandardItutKp->SetKeyTextColorGroup( EAknsCIQsnTextColorsCG65 );
   174     iStandardItutKp->SetDrawOpaqueBackground(EFalse);
   183     iStandardItutKp->SetDrawOpaqueBackground(EFalse);
   175     
   184     
   176     // read key shift icon res
   185     // read key shift icon res
   177     CPenInputColorIcon* shiftIcon = CPenInputColorIcon::NewL( R_ITUT_KEYPAD_SHIFT_ICON );
   186     CPenInputColorIcon* shiftIcon = CPenInputColorIcon::NewL( R_ITUT_KEYPAD_SHIFT_ICON );
   178     shiftIcon->ResizeL( iDataMgr->iShiftIconRect.Size() );
   187     shiftIcon->ResizeL( iDataMgr->iShiftIconRect.Size() );
   662     AddControlL(iPuncCandsList);
   671     AddControlL(iPuncCandsList);
   663     iPuncCandsList->SetEventIdForCandidateSelected(EItutCmdCandidateSelected);
   672     iPuncCandsList->SetEventIdForCandidateSelected(EItutCmdCandidateSelected);
   664 	iPuncCandsList->SetDropdownListImgID(candiDrawInfo);
   673 	iPuncCandsList->SetDropdownListImgID(candiDrawInfo);
   665     iPuncCandsList->Hide(ETrue);
   674     iPuncCandsList->Hide(ETrue);
   666     }
   675     }
       
   676 
       
   677 // ---------------------------------------------------------------------------
       
   678 // CSplitItutWindow::ConstructIcfFromResourceL
       
   679 // ---------------------------------------------------------------------------
       
   680 //
       
   681 void CSplitItutWindow::ConstructIcfFromResourceL()
       
   682     {
       
   683     if (!iICF->ResourceId())
       
   684         {
       
   685         return;
       
   686         }
       
   687     
       
   688     TResourceReader icfreader;
       
   689     CCoeEnv::Static()->CreateResourceReaderLC(icfreader, iICF->ResourceId());
       
   690     TInt32 colorMajorSkinId = icfreader.ReadInt32();
       
   691     TInt skinitemid = icfreader.ReadInt16();
       
   692     TInt coloridx = icfreader.ReadInt16();
       
   693 
       
   694     TAknsItemID colorid;
       
   695     colorid.Set(TInt(colorMajorSkinId), skinitemid);
       
   696 
       
   697     TRgb icftextcolor;
       
   698     MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
       
   699     TInt error = AknsUtils::GetCachedColor( skininstance, 
       
   700                                             icftextcolor, 
       
   701                                             colorid, 
       
   702                                             coloridx );
       
   703 
       
   704     if ( error != KErrNone )
       
   705         {
       
   706         icftextcolor = TRgb( KDefaultIcfTextColor );
       
   707         }
       
   708 
       
   709     iICF->SetTextColorL( icftextcolor );    
       
   710     
       
   711     // Set highlight color
       
   712     TRgb icfhightlightcolor;
       
   713     error = AknsUtils::GetCachedColor( skininstance, 
       
   714                                        icfhightlightcolor, 
       
   715                                        KAknsIIDQsnHighlightColors,
       
   716                                        EAknsCIQsnHighlightColorsCG2 ); 
       
   717     if ( error == KErrNone ) 
       
   718         {
       
   719         iICF->SetTextSelColorL( icfhightlightcolor );
       
   720         }
       
   721 
       
   722     skinitemid = icfreader.ReadInt16();
       
   723     coloridx = icfreader.ReadInt16();
       
   724     
       
   725     colorid.Set(TInt(colorMajorSkinId), skinitemid);
       
   726     
       
   727     TRgb icfframecolor;
       
   728     error = AknsUtils::GetCachedColor(skininstance, 
       
   729                                       icfframecolor, 
       
   730                                       colorid, 
       
   731                                       coloridx);
       
   732 
       
   733     if ( error != KErrNone )
       
   734         {
       
   735     	icfframecolor = TRgb(KDefaultIcfFrameColor);
       
   736         }
       
   737 
       
   738     iICF->SetBorderColor( icfframecolor );
       
   739     CleanupStack::PopAndDestroy( 1 ); // icfreader
       
   740     }
       
   741  
       
   742  
       
   743 // ---------------------------------------------------------------------------
       
   744 // CSplitItutWindow::CreateICFL
       
   745 // ---------------------------------------------------------------------------
       
   746 //
       
   747 void CSplitItutWindow::CreateICFL()
       
   748     {
       
   749     CFont* icffont = TItutDataConverter::AnyToFont(iDataMgr->RequestData(EIcfFont));
       
   750     TRect rect = TItutDataConverter::AnyToRect(iDataMgr->RequestData(ESpellICFRect));
       
   751     
       
   752     // Create ICF
       
   753     iICF = CFepLayoutMultiLineIcf::NewL( rect, 
       
   754                                          iLayoutOwner, 
       
   755                                          ECtrlIdICF, 
       
   756                                          iDataMgr->iIcfTextHeight,
       
   757                                          icffont->FontMaxHeight(),
       
   758                                          icffont );
       
   759 
       
   760     iICF->SetFocus(ETrue);
       
   761     iICF->SetResourceId( R_SPLIT_ITUT_ICF );
       
   762     ConstructIcfFromResourceL();
       
   763     iICF->SetBgImgSkinId( KAknsIIDQsnFrCall2Rect );
       
   764     
       
   765     AddControlL( iICF );
       
   766     
       
   767     // Set indicator parameters
       
   768     TAknWindowLineLayout iBubbleSize = AknLayoutScalable_Apps::popup_char_count_window().LayoutLine();
       
   769     TAknTextLineLayout iBubbleTextLayout = AknLayoutScalable_Apps::popup_char_count_window_t1(0).LayoutLine();
       
   770     
       
   771     iICF->MsgBubbleCtrl()->SetTextFormat(iBubbleTextLayout);
       
   772     iICF->MsgBubbleCtrl()->SetTextColorIndex( EAknsCIQsnTextColorsCG67 );
       
   773     
       
   774     //Change the ID when ID into release
       
   775     iICF->MsgBubbleCtrl()->SetBitmapParam( NULL,
       
   776     									   NULL,
       
   777     									   KAknsIIDQsnFrInputPreviewSideL,
       
   778     									   KAknsIIDQsnFrInputPreviewMiddle,
       
   779     									   KAknsIIDQsnFrInputPreviewSideR );  
       
   780     iICF->SetMsgBubbleCtrlSize(TSize(iBubbleSize.iW,iBubbleSize.iH));
       
   781     
       
   782     iICF->MsgBubbleCtrl()->SetTextL( KEmptyString );
       
   783     
       
   784     iICF->SetTextMargin( iDataMgr->iIcfTextLeftMargin,
       
   785             			 iDataMgr->iIcfTextRightMargin,
       
   786             			 iDataMgr->iIcfTextTopMargin,
       
   787             			 iDataMgr->iIcfTextBottomMargin );
       
   788             					  
       
   789     iICF->SetLineSpace( iDataMgr->iIcfTextLineSpaceMargin );    					  
       
   790         	 
       
   791     SetIndiBubble();
       
   792     iICF->Hide( ETrue );
       
   793     }
       
   794  
   667     
   795     
   668 // ---------------------------------------------------------------------------
   796 // ---------------------------------------------------------------------------
   669 // CSplitItutWindow::ConstructL
   797 // CSplitItutWindow::ConstructL
   670 // ---------------------------------------------------------------------------
   798 // ---------------------------------------------------------------------------
   671 //
   799 //
   672 void CSplitItutWindow::ConstructL()
   800 void CSplitItutWindow::ConstructL()
   673     {
   801     {
   674     iBmpRotator = CPeninputSyncBitmapRotator::NewL();
   802     iBmpRotator = CPeninputSyncBitmapRotator::NewL();
   675     CreateAllButtonL();
   803     CreateAllButtonL();
   676     CreateItutKeypadL();
   804     CreateItutKeypadL();
       
   805     CreateICFL();
   677     }
   806     }
   678 
   807 
   679 // ---------------------------------------------------------------------------
   808 // ---------------------------------------------------------------------------
   680 // CSplitItutWindow::AddControlL
   809 // CSplitItutWindow::AddControlL
   681 // ---------------------------------------------------------------------------
   810 // ---------------------------------------------------------------------------
   792 
   921 
   793 // ---------------------------------------------------------------------------
   922 // ---------------------------------------------------------------------------
   794 // CSplitItutWindow::SetCtrlRect
   923 // CSplitItutWindow::SetCtrlRect
   795 // ---------------------------------------------------------------------------
   924 // ---------------------------------------------------------------------------
   796 //
   925 //
   797 void CSplitItutWindow::SetCtrlRect(CFepUiBaseCtrl* aCtrl, TInt aRectIdx)
   926 void CSplitItutWindow::SetCtrlRect(CFepUiBaseCtrl* aCtrl, TInt aRectIdx, const TBool aOffset )
   798     {
   927     {
   799     aCtrl->SetRect(TItutDataConverter::AnyToRect(iDataMgr->RequestData(aRectIdx)));
   928     TRect rect = TItutDataConverter::AnyToRect(iDataMgr->RequestData(aRectIdx));
       
   929     if(aOffset)
       
   930         {
       
   931         TPoint offset = TItutDataConverter::AnyToPoint(iDataMgr->RequestData(ELayoutOffset));
       
   932         rect.Move(offset);
       
   933         }
       
   934     aCtrl->SetRect(rect);
   800     }
   935     }
   801 
   936 
   802 // ---------------------------------------------------------------------------
   937 // ---------------------------------------------------------------------------
   803 // CSplitItutWindow::SizeChanged
   938 // CSplitItutWindow::SizeChanged
   804 // ---------------------------------------------------------------------------
   939 // ---------------------------------------------------------------------------
   928     	{
  1063     	{
   929     	HandleButtonResOnLangDirChange( ECtrlIdBackspace );
  1064     	HandleButtonResOnLangDirChange( ECtrlIdBackspace );
   930     	iDataMgr->SetLangDirectionSwitch( EFalse );	
  1065     	iDataMgr->SetLangDirectionSwitch( EFalse );	
   931     	}   
  1066     	}   
   932     }
  1067     }
       
  1068  
       
  1069 // ---------------------------------------------------------------------------
       
  1070 // CSplitItutWindow::ApplyVariantLafDataForSpellL
       
  1071 // ---------------------------------------------------------------------------
       
  1072 //
       
  1073 void CSplitItutWindow::ApplyVariantLafDataForSpellL()
       
  1074     {
       
  1075     TBool bSizeChanged = EFalse;       
       
  1076     ControlSizeChanged( ECtrlIdArrowLeft, EArrowLeftRect, ELeftInnerRect, ETrue );
       
  1077     ControlSizeChanged( ECtrlIdArrowRight, EArrowRightRect, ERightInnerRect, ETrue );
       
  1078     
       
  1079     bSizeChanged = ControlSizeChanged( ECtrlIdBackspace, ESpellBackSpcae, 
       
  1080     		                           ESpellBackSpcaeInner, ETrue );
       
  1081    						  	
       
  1082     // resize all controls
       
  1083     SetCtrlRect( iBackgroundCtrl, EBackgroundRect );
       
  1084     SetCtrlRect( iStandardItutKp, EKeypadRect, ETrue ); 
       
  1085     
       
  1086     // Handle control res when language direction changing here.
       
  1087     if ( iDataMgr->IsLangDirectionSwitch() || 
       
  1088     	( bSizeChanged && iDataMgr->IsRtoLLanguage()))
       
  1089     	{
       
  1090     	HandleButtonResOnLangDirChange( ECtrlIdBackspace );
       
  1091     	iDataMgr->SetLangDirectionSwitch( EFalse );	
       
  1092     	}
       
  1093     
       
  1094     CFont* icffont = TItutDataConverter::AnyToFont(iDataMgr->RequestData( EIcfFont ));
       
  1095     iICF->Hide( ETrue ); 
       
  1096     iICF->SizeChangedL( TItutDataConverter::AnyToRect( iDataMgr->RequestData( ESpellICFRect )), 
       
  1097        	                iDataMgr->iIcfTextHeight,
       
  1098     	                icffont->FontMaxHeight(),
       
  1099     	                icffont );
       
  1100     iICF->Hide( EFalse );
       
  1101     }
       
  1102     
   933 
  1103 
   934 // ---------------------------------------------------------------------------
  1104 // ---------------------------------------------------------------------------
   935 // CSplitItutWindow::ResizeCandidateList
  1105 // CSplitItutWindow::ResizeCandidateList
   936 // ---------------------------------------------------------------------------
  1106 // ---------------------------------------------------------------------------
   937 //
  1107 //
  1273 
  1443 
  1274     unicodesArr1.Close();
  1444     unicodesArr1.Close();
  1275     unicodesInt.Close();
  1445     unicodesInt.Close();
  1276 
  1446 
  1277     }
  1447     }
       
  1448 
       
  1449 void CSplitItutWindow::UpdateIndiBubbleL( TUint8* aData )
       
  1450     {  
       
  1451     RDesReadStream readStream;
       
  1452     TFepIndicatorInfo indicatorData;
       
  1453 
       
  1454     TPtr8 countPtr( aData, 4*sizeof(TInt), 4*sizeof(TInt) );            
       
  1455     readStream.Open(countPtr);
       
  1456     CleanupClosePushL(readStream);
       
  1457 
       
  1458     indicatorData.iIndicatorImgID = readStream.ReadInt32L();
       
  1459     indicatorData.iIndicatorMaskID = readStream.ReadInt32L();
       
  1460     indicatorData.iIndicatorTextImgID = readStream.ReadInt32L();
       
  1461     indicatorData.iIndicatorTextMaskID = readStream.ReadInt32L();
       
  1462 
       
  1463     CleanupStack::PopAndDestroy(&readStream);
       
  1464 
       
  1465     if ( indicatorData.iIndicatorImgID != 0 && 
       
  1466          indicatorData.iIndicatorMaskID != 0 && 
       
  1467          indicatorData.iIndicatorTextImgID != 0 &&
       
  1468          indicatorData.iIndicatorTextMaskID != 0)
       
  1469         {
       
  1470         iDataMgr->SetIndicatorData( indicatorData );
       
  1471         iImDimensionSet = ETrue;
       
  1472 
       
  1473         SetIndiBubbleImageL( indicatorData.iIndicatorImgID,
       
  1474                              indicatorData.iIndicatorMaskID,
       
  1475                              indicatorData.iIndicatorTextImgID,
       
  1476                              indicatorData.iIndicatorTextMaskID );
       
  1477             
       
  1478 		TBuf<100> text;	
       
  1479         iICF->MsgBubbleCtrl()->GetText( text );
       
  1480         iICF->ShowBubble( text, iICF->MsgBubbleCtrl()->Rect());
       
  1481         }
       
  1482     }
       
  1483 
       
  1484 // ---------------------------------------------------------------------------
       
  1485 // CSplitItutWindow::CalIndicatorRect
       
  1486 // ---------------------------------------------------------------------------
       
  1487 //
       
  1488 void CSplitItutWindow::CalIndicatorRect(const TRect& aBoundRect,
       
  1489                                           TRect& aRealRect1,
       
  1490                                           TRect& aRealRect2,
       
  1491                                           TIndicatorAlign aAlign) 
       
  1492 	{
       
  1493 	if (!iImDimensionSet)
       
  1494 		{
       
  1495 		return;
       
  1496 		}
       
  1497 	
       
  1498 	TInt imgAspectText = iIndicatorTextSize.iWidth / iIndicatorTextSize.iHeight;
       
  1499 	TInt imgAspectIndi = iIndicatorSize.iWidth / iIndicatorSize.iHeight;
       
  1500     TSize imgSizeText( aBoundRect.Size().iHeight * imgAspectText, 
       
  1501     			  	   aBoundRect.Size().iHeight );
       
  1502 	TSize imgSizeIndi( aBoundRect.Size().iHeight * imgAspectIndi, 
       
  1503     			   			   aBoundRect.Size().iHeight );
       
  1504 	// check if the length of img > bound rect width
       
  1505 	TInt nTotalWidth = imgSizeText.iWidth + imgSizeIndi.iWidth;
       
  1506 	if( nTotalWidth > aBoundRect.Size().iWidth )
       
  1507 		{
       
  1508 		TReal nAspect = (TReal)imgSizeText.iWidth / nTotalWidth;
       
  1509 		imgSizeText.iWidth = aBoundRect.Size().iWidth * nAspect;
       
  1510 		imgSizeIndi.iWidth = aBoundRect.Size().iWidth - imgSizeText.iWidth;
       
  1511 		imgSizeText.iHeight = imgSizeText.iWidth / imgAspectText;
       
  1512 		// make sure the height of two rect is equal
       
  1513 		imgSizeIndi.iHeight = imgSizeText.iHeight;
       
  1514 		}
       
  1515 	if( aAlign == EIndiAlignRight )
       
  1516 		{
       
  1517     	aRealRect2 = TRect(TPoint( aBoundRect.iBr.iX - imgSizeText.iWidth, aBoundRect.iTl.iY),
       
  1518     			   	   imgSizeText);
       
  1519 		aRealRect1 = TRect(TPoint(aRealRect2.iTl.iX - imgSizeIndi.iWidth, aRealRect2.iTl.iY),
       
  1520 				       imgSizeIndi);
       
  1521 		}
       
  1522 	else if( aAlign == EIndiAlignCenter )
       
  1523 		{
       
  1524 		TInt offsetX = ( aBoundRect.Size().iWidth - imgSizeText.iWidth - imgSizeIndi.iWidth ) / 2;
       
  1525 		TInt offsetY = ( aBoundRect.Size().iHeight - imgSizeText.iHeight ) / 2;
       
  1526     	aRealRect2 = TRect( TPoint( aBoundRect.iBr.iX - imgSizeText.iWidth - offsetX, 
       
  1527     							   aBoundRect.iTl.iY + offsetY),
       
  1528     			   	   	    imgSizeText );
       
  1529 		aRealRect1 = TRect( TPoint(aRealRect2.iTl.iX - imgSizeIndi.iWidth, aRealRect2.iTl.iY),
       
  1530 				       imgSizeIndi );
       
  1531 		}
       
  1532 	else if( aAlign == EIndiAlignLeft )
       
  1533 		{
       
  1534 		aRealRect1 = TRect( aBoundRect.iTl, imgSizeIndi );
       
  1535 		aRealRect2 = TRect( TPoint( aRealRect1.iBr.iX, aRealRect1.iTl.iY ), imgSizeText );
       
  1536 		}
       
  1537 	}
       
  1538 
       
  1539 // ---------------------------------------------------------------------------
       
  1540 // CSplitItutWindow::SetPromptTextL
       
  1541 // ---------------------------------------------------------------------------
       
  1542 //
       
  1543 void CSplitItutWindow::SetPromptTextL( TUint8* aData )
       
  1544     {
       
  1545     RDesReadStream readStream;
       
  1546 
       
  1547     TPtr8 countPtr( aData, 2*sizeof(TInt), 2*sizeof(TInt));
       
  1548 	readStream.Open(countPtr);
       
  1549 	CleanupClosePushL(readStream);
       
  1550     const TInt dataCount = readStream.ReadInt32L();
       
  1551 	const TInt textCount = readStream.ReadInt32L();
       
  1552     CleanupStack::PopAndDestroy(&readStream);
       
  1553     
       
  1554     TPtr8 ptr( aData+2*sizeof(TInt), dataCount+textCount, dataCount+textCount );            
       
  1555 	readStream.Open(ptr);
       
  1556 	CleanupClosePushL(readStream);
       
  1557 	
       
  1558 	HBufC8* dataBuf = HBufC8::NewLC(dataCount);
       
  1559 	TPtr8 dataBufPtr = dataBuf->Des();
       
  1560 	readStream.ReadL(dataBufPtr, dataCount);
       
  1561 
       
  1562     TFepPromptText* pIcfData = 
       
  1563     		reinterpret_cast<TFepPromptText*>(const_cast<TUint8*>(dataBufPtr.Ptr()));
       
  1564 
       
  1565     HBufC* textBuf;
       
  1566     if ( textCount > 0 )
       
  1567         {
       
  1568         textBuf = HBufC::NewLC( textCount/2 );
       
  1569     	TPtr textBufPtr = textBuf->Des();
       
  1570     	readStream.ReadL( textBufPtr, textCount/2 );
       
  1571          
       
  1572         const HBufC* icfPromptText = iICF->PromptText();
       
  1573         
       
  1574         if (!icfPromptText || icfPromptText->Compare( textBuf->Des()) != 0 )
       
  1575         	{
       
  1576         	iICF->SetPromptTextL( textBuf->Des(), pIcfData->iCleanContent );	
       
  1577         	}
       
  1578         CleanupStack::PopAndDestroy( textBuf );
       
  1579         }
       
  1580     else
       
  1581         {
       
  1582         iICF->SetPromptTextL( KNullDesC, pIcfData->iCleanContent );
       
  1583         }
       
  1584 
       
  1585       CleanupStack::PopAndDestroy( dataBuf );
       
  1586 	  CleanupStack::PopAndDestroy( &readStream );
       
  1587     }
       
  1588 
       
  1589 // ---------------------------------------------------------------------------
       
  1590 // CSplitItutWindow::SetIndiBubbleImageL
       
  1591 // ---------------------------------------------------------------------------
       
  1592 //
       
  1593 void CSplitItutWindow::SetIndiBubbleImageL( const TInt aImgID1,
       
  1594                                             const TInt aMaskID1,
       
  1595                                             const TInt aImgID2,
       
  1596                                             const TInt aMaskID2 )
       
  1597     {
       
  1598     MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
       
  1599 
       
  1600     CFbsBitmap* bmp1 = NULL;
       
  1601     CFbsBitmap* mask1 = NULL;
       
  1602     
       
  1603     TInt colorIndex = EAknsCIQsnIconColorsCG30;
       
  1604 
       
  1605     AknsUtils::CreateColorIconL( skininstance,
       
  1606                                  KAknsIIDQsnIconColors,
       
  1607                                  KAknsIIDQsnIconColors,
       
  1608                                  colorIndex,
       
  1609                                  bmp1,
       
  1610                                  mask1,
       
  1611                                  AknIconUtils::AvkonIconFileName(),
       
  1612                                  aImgID1,
       
  1613                                  aMaskID1,
       
  1614                                  KRgbGray );
       
  1615     CleanupStack::PushL( bmp1 );
       
  1616     CleanupStack::PushL( mask1 );
       
  1617                                 
       
  1618     AknIconUtils::GetContentDimensions( bmp1, iIndicatorSize );
       
  1619 
       
  1620     CFbsBitmap* bmp2 = NULL;
       
  1621     CFbsBitmap* mask2 = NULL;
       
  1622     AknsUtils::CreateColorIconL( skininstance,
       
  1623                                  KAknsIIDQsnIconColors,
       
  1624                                  KAknsIIDQsnIconColors,
       
  1625                                  colorIndex,
       
  1626                                  bmp2,
       
  1627                                  mask2,
       
  1628                                  AknIconUtils::AvkonIconFileName(),
       
  1629                                  aImgID2,
       
  1630                                  aMaskID2,
       
  1631                                  KRgbGray );
       
  1632  
       
  1633     CleanupStack::PushL( bmp2 );
       
  1634     CleanupStack::PushL( mask2 );
       
  1635     
       
  1636     AknIconUtils::GetContentDimensions( bmp2, iIndicatorTextSize );
       
  1637     
       
  1638     TRect boundRect;
       
  1639     boundRect = TItutDataConverter::AnyToRect(
       
  1640                 iDataMgr->RequestData( EIndiIconWithoutTextRect ));
       
  1641     
       
  1642     TRect imgrect, textrect;
       
  1643     
       
  1644     CalIndicatorRect( boundRect, imgrect, textrect, EIndiAlignCenter );
       
  1645     AknIconUtils::SetSize( bmp1, imgrect.Size(), EAspectRatioNotPreserved );
       
  1646     AknIconUtils::SetSize( mask1, imgrect.Size(), EAspectRatioNotPreserved );
       
  1647     AknIconUtils::SetSize( bmp2, textrect.Size(), EAspectRatioNotPreserved) ;
       
  1648     AknIconUtils::SetSize( mask2, textrect.Size(), EAspectRatioNotPreserved );
       
  1649 
       
  1650     CFbsBitmap* bmp3 = AknPenImageUtils::CombineTwoImagesL(bmp1, bmp2, EColor256);
       
  1651     CFbsBitmap* mask3 = AknPenImageUtils::CombineTwoImagesL(mask1, mask2, EGray256);
       
  1652     
       
  1653     iICF->MsgBubbleCtrl()->SetBitmapParam( bmp3, mask3, 
       
  1654                     KAknsIIDQsnFrInputPreviewSideL,
       
  1655                     KAknsIIDQsnFrInputPreviewMiddle,
       
  1656                     KAknsIIDQsnFrInputPreviewSideR );
       
  1657     
       
  1658     CleanupStack::PopAndDestroy( mask2 );
       
  1659     CleanupStack::PopAndDestroy( bmp2 );
       
  1660     CleanupStack::PopAndDestroy( mask1 );
       
  1661     CleanupStack::PopAndDestroy( bmp1 );
       
  1662     }
       
  1663 
       
  1664 // ---------------------------------------------------------------------------
       
  1665 // CSplitItutWindow::SetIndiBubble
       
  1666 // ---------------------------------------------------------------------------
       
  1667 //
       
  1668 void CSplitItutWindow::SetIndiBubble()
       
  1669     {
       
  1670     if ( iICF )
       
  1671         {
       
  1672         TRect bubbleRect = TItutDataConverter::AnyToRect( 
       
  1673                 iDataMgr->RequestData( EIndiPaneWithoutTextRect ));
       
  1674         TRect iconRect = TItutDataConverter::AnyToRect( 
       
  1675                 iDataMgr->RequestData( EIndiIconWithoutTextRect ));
       
  1676         
       
  1677         TSize offset( 0, 6 );
       
  1678         TSize size( iconRect.Width(), iconRect.Height());
       
  1679         
       
  1680         iICF->MsgBubbleCtrl()->SetRect( bubbleRect );
       
  1681         iICF->MsgBubbleCtrl()->SetIconOffsetAndSize( offset, size );
       
  1682         }
       
  1683     }
       
  1684 
  1278 // End Of File
  1685 // End Of File