uifw/EikStd/coctlsrc/EIKEDWIN.CPP
branchRCL_3
changeset 25 941195f2d488
parent 23 3d340a0166ff
child 29 a8834a2e9a96
equal deleted inserted replaced
23:3d340a0166ff 25:941195f2d488
   661             {
   661             {
   662             TCursorSelection inlineText( state->CurrentInlineEditSpan() );
   662             TCursorSelection inlineText( state->CurrentInlineEditSpan() );
   663             if ( aDocumentPosition >= inlineText.LowerPos() && 
   663             if ( aDocumentPosition >= inlineText.LowerPos() && 
   664                 aDocumentPosition + length <= inlineText.HigherPos() )
   664                 aDocumentPosition + length <= inlineText.HigherPos() )
   665                 {
   665                 {
   666                 iEdwin.iEdwinExtension->iSmiley->ConvertTextForSmileyL(
   666                 smiley->ConvertTextForSmileyL( aDocumentPosition, aEditorContent, 
   667                     aDocumentPosition, aEditorContent, EFalse );
   667                     EFalse );
   668                 }
   668                 }
   669             }
   669             }
   670         TBool prevIsCode( EFalse );
       
   671         for ( TInt i( 0 ); i < length; i++ )
   670         for ( TInt i( 0 ); i < length; i++ )
   672             {
   671             {
   673             if ( aEditorContent[i] == CSmileyManager::KCompensateChar )
   672             if ( smiley->SmileyCodeByPos( aDocumentPosition + i ) > 0 &&
   674                 {
   673                 !CSmileyManager::IsSmileyCode( aEditorContent[i] ) )
   675                 if ( i == 0 )
   674                 {
   676                     {
   675                 aEditorContent[i] = CSmileyManager::KPlaceHolder;
   677                     prevIsCode = ( CSmileyManager::IsSmileyCode( 
       
   678                         smiley->SmileyCodeByPos( aDocumentPosition ) ) );
       
   679                     }
       
   680                 if ( prevIsCode )
       
   681                     {
       
   682                     aEditorContent[i] = CSmileyManager::KPlaceHolder;
       
   683                     }
       
   684                 }
       
   685             else
       
   686                 {
       
   687                 prevIsCode = CSmileyManager::IsSmileyCode( aEditorContent[i] );
       
   688                 }
   676                 }
   689             }
   677             }
   690         }
   678         }
   691     }
   679     }
   692 
   680 
  2102             DeleteHighlightL(formatHasChanged,code==EKeyBackspace);
  2090             DeleteHighlightL(formatHasChanged,code==EKeyBackspace);
  2103             const TInt lower=toDelete.LowerPos();
  2091             const TInt lower=toDelete.LowerPos();
  2104             const TCursorSelection sel(lower,lower);
  2092             const TCursorSelection sel(lower,lower);
  2105             iTextView->SetPendingSelection(sel);
  2093             iTextView->SetPendingSelection(sel);
  2106             iTextView->HandleInsertDeleteL(sel,toDelete.Length(),formatHasChanged);
  2094             iTextView->HandleInsertDeleteL(sel,toDelete.Length(),formatHasChanged);
       
  2095             cursorPos = lower;
  2107             reportChange=ETrue;
  2096             reportChange=ETrue;
  2108             }
  2097             }
  2109         else if ( replaceSelection ) // All neutral protection cases 
  2098         else if ( replaceSelection ) // All neutral protection cases 
  2110             {
  2099             {
  2111             if ( !deleteSelection ) // selection has not been set yet
  2100             if ( !deleteSelection ) // selection has not been set yet
  6749         }
  6738         }
  6750         break;
  6739         break;
  6751     case KEikInputLanguageChange:
  6740     case KEikInputLanguageChange:
  6752         {
  6741         {
  6753         UpdateCache(KEikInputLanguageChange);
  6742         UpdateCache(KEikInputLanguageChange);
       
  6743         TLanguage language = CAknEnv::Static()->SettingCache().InputLanguage(); 
       
  6744 		if ( language == ELangArabic || language == ELangFarsi || 
       
  6745 			language == ELangUrdu || language == ELangHebrew )
       
  6746 			{
       
  6747 			iEdwinUserFlags &= ~EAvkonEnableSmileySupport;
       
  6748 			EnableSmileySupportL( EFalse );
       
  6749 			}
       
  6750 		else if ( iEdwinExtension->iEnableSmileySupported )
       
  6751 			{
       
  6752 			iEdwinUserFlags |= EAvkonEnableSmileySupport;
       
  6753 			EnableSmileySupportL( ETrue );
       
  6754 			}
  6754         DoAlignment();
  6755         DoAlignment();
  6755         }
  6756         }
  6756         break;
  6757         break;
  6757     default:
  6758     default:
  6758         break;
  6759         break;
  7626     {
  7627     {
  7627     iEdwinUserFlags|=aFlag;
  7628     iEdwinUserFlags|=aFlag;
  7628     SetVKBStatus(); 
  7629     SetVKBStatus(); 
  7629     if ( aFlag & EAvkonEnableSmileySupport )
  7630     if ( aFlag & EAvkonEnableSmileySupport )
  7630         {
  7631         {
       
  7632         iEdwinExtension->iEnableSmileySupported = ETrue;
  7631         EnableSmileySupportL( ETrue );
  7633         EnableSmileySupportL( ETrue );
  7632         }
  7634         }
  7633     }
  7635     }
  7634 
  7636 
  7635 EXPORT_C void CEikEdwin::RemoveFlagFromUserFlags(TUint32 aFlag)
  7637 EXPORT_C void CEikEdwin::RemoveFlagFromUserFlags(TUint32 aFlag)
  7636     {
  7638     {
  7637     iEdwinUserFlags&=~aFlag;
  7639     iEdwinUserFlags&=~aFlag;
  7638     SetVKBStatus(); 
  7640     SetVKBStatus(); 
  7639     if ( aFlag & EAvkonEnableSmileySupport )
  7641     if ( aFlag & EAvkonEnableSmileySupport )
  7640         {    
  7642         {    
       
  7643         iEdwinExtension->iEnableSmileySupported = EFalse;
  7641         EnableSmileySupportL( EFalse );
  7644         EnableSmileySupportL( EFalse );
  7642         }
  7645         }
  7643     }
  7646     }
  7644 
  7647 
  7645 EXPORT_C TUint32 CEikEdwin::UserFlags() const
  7648 EXPORT_C TUint32 CEikEdwin::UserFlags() const
  8297 // for smiley support
  8300 // for smiley support
  8298 void CEikEdwin::EnableSmileySupportL( TBool aEnableSmiley )
  8301 void CEikEdwin::EnableSmileySupportL( TBool aEnableSmiley )
  8299     {
  8302     {
  8300     if ( aEnableSmiley && !AknLayoutUtils::LayoutMirrored() && iEdwinExtension )
  8303     if ( aEnableSmiley && !AknLayoutUtils::LayoutMirrored() && iEdwinExtension )
  8301         {
  8304         {
  8302         if ( !iEdwinExtension->iSmiley )
  8305         TLanguage language = CAknEnv::Static()->SettingCache().InputLanguage();
  8303             {
  8306 		if ( language != ELangArabic && language != ELangFarsi && 
  8304             iEdwinExtension->iSmiley = CSmileyManager::NewL( *this );
  8307 			language != ELangUrdu && language != ELangHebrew )
  8305             iEdwinExtension->iSmiley->SetAnimationPlayTimes( KNormalAnimPlayTimes );
  8308 			{
  8306             if ( IsReadOnly() || iEdwinUserFlags & EDisplayOnly )
  8309 			if ( !iEdwinExtension->iSmiley )
  8307                 {
  8310 				{
  8308                 iEdwinExtension->iSmiley->SetAnimationPlayTimes( 
  8311 				iEdwinExtension->iSmiley = CSmileyManager::NewL( *this );
  8309                     KInfiniteAnimPlayTimes );
  8312 				iEdwinExtension->iSmiley->SetAnimationPlayTimes( KNormalAnimPlayTimes );
  8310                 }
  8313 				if ( IsReadOnly() || iEdwinUserFlags & EDisplayOnly )
  8311             }        
  8314 					{
  8312         if ( TextLayout() )
  8315 					iEdwinExtension->iSmiley->SetAnimationPlayTimes( 
  8313             {
  8316 						KInfiniteAnimPlayTimes );
  8314             TextLayout()->SetCustomWrap( iEdwinExtension->iSmileyWrap );
  8317 					}
  8315             }
  8318 				}        
       
  8319 			if ( TextLayout() )
       
  8320 				{
       
  8321 				TextLayout()->SetCustomWrap( iEdwinExtension->iSmileyWrap );
       
  8322 				}
       
  8323 			}
  8316         }    
  8324         }    
  8317     else if ( iEdwinExtension )
  8325     else if ( iEdwinExtension )
  8318         {
  8326         {
  8319         delete iEdwinExtension->iSmiley;
  8327         delete iEdwinExtension->iSmiley;
  8320         iEdwinExtension->iSmiley = NULL;
  8328         iEdwinExtension->iSmiley = NULL;