uifw/EikStd/coctlsrc/EIKEDWIN.CPP
branchRCL_3
changeset 59 978afdc0236f
parent 56 d48ab3b357f1
child 64 85902f042028
equal deleted inserted replaced
56:d48ab3b357f1 59:978afdc0236f
    95 #include <eikrted.h>
    95 #include <eikrted.h>
    96 #include <NumberGroupingCRKeys.h>
    96 #include <NumberGroupingCRKeys.h>
    97 #include <aknpointereventsuppressor.h>
    97 #include <aknpointereventsuppressor.h>
    98 #include <aknnotedialog.h>
    98 #include <aknnotedialog.h>
    99 #include <AknFepGlobalEnums.h>
    99 #include <AknFepGlobalEnums.h>
   100 
   100 #include <AknSmileyUtils.h>
   101 #include "smileymanager.h"
   101 #include "smileymanager.h"
   102 #include "smileycustomwrap.h"
   102 #include "smileycustomwrap.h"
   103 #include <touchfeedback.h>
   103 #include <touchfeedback.h>
   104 
   104 
   105 // declare function
   105 // declare function
   106 void ReadSpecialCharFromSCTL( TPtr& ptr, TInt sctResourceId );
   106 void ReadSpecialCharFromSCTL( TPtr& ptr, TInt sctResourceId );
   107 void ReadSCTHeadPane( TResourceReader& aReader );
   107 void ReadSCTHeadPane( TResourceReader& aReader );
       
   108 // for supporting TapToWrite
       
   109 #include <AvkonInternalCRKeys.h>
       
   110 #include <e32property.h>
       
   111 #include <AknFepInternalPSKeys.h>
       
   112 #include <AknFontAccess.h>
   108 
   113 
   109 GLDEF_C void Panic(TEikEdwinPanic aPanic)
   114 GLDEF_C void Panic(TEikEdwinPanic aPanic)
   110     {
   115     {
   111     _LIT(KPanicCat,"EIKON-EDWIN");
   116     _LIT(KPanicCat,"EIKON-EDWIN");
   112     User::Panic(KPanicCat,aPanic);
   117     User::Panic(KPanicCat,aPanic);
   155 
   160 
   156 const TInt KNmericSCTLimit( 256 );
   161 const TInt KNmericSCTLimit( 256 );
   157 const TInt KTInt16Length( sizeof( TInt16 ) );
   162 const TInt KTInt16Length( sizeof( TInt16 ) );
   158 const TInt KTInt32Length( sizeof( TInt32 ) );
   163 const TInt KTInt32Length( sizeof( TInt32 ) );
   159 const TInt KTUint32Length( sizeof( TUint32 ) );
   164 const TInt KTUint32Length( sizeof( TUint32 ) );
       
   165 const TInt KBlackMap( 179 );
       
   166 const TInt KWhiteMap( 76 );
       
   167 _LIT( KParagraphSeparator, "\x2029" );
       
   168 TRgb FadeRgb( TRgb aColor, TUint8 aBlackMap, TUint8 aWhiteMap );
   160 
   169 
   161 //
   170 //
   162 // class CEikEdwin::CUndoBuffer
   171 // class CEikEdwin::CUndoBuffer
   163 //
   172 //
   164 
   173 
   504                 }
   513                 }
   505             }
   514             }
   506         }
   515         }
   507     iEdwin.iTextView->HandleInsertDeleteL( select, aNumberOfCharactersSuccessfullyDeleted,
   516     iEdwin.iTextView->HandleInsertDeleteL( select, aNumberOfCharactersSuccessfullyDeleted,
   508         aParagraphContainingStartPositionOfInlineTextHasChangedFormat );
   517         aParagraphContainingStartPositionOfInlineTextHasChangedFormat );
       
   518     // try to draw "tap to write"
       
   519     iEdwin.TryToDrawT2W();
       
   520     
   509     User::LeaveIfError(aError);
   521     User::LeaveIfError(aError);
   510     iEdwin.SetScrollBarsL();
   522     iEdwin.SetScrollBarsL();
   511     iEdwin.DoReportEventL(MCoeControlObserver::EEventStateChanged);
   523     iEdwin.DoReportEventL(MCoeControlObserver::EEventStateChanged);
   512     if (aParagraphContainingStartPositionOfInlineTextHasChangedFormat)
   524     if (aParagraphContainingStartPositionOfInlineTextHasChangedFormat)
   513         {
   525         {
   796         // Replace all 'i' following smiley code to invisbile placeholder for
   808         // Replace all 'i' following smiley code to invisbile placeholder for
   797         // Touch Input can not recognize it as part of smiley code string.
   809         // Touch Input can not recognize it as part of smiley code string.
   798         TInt smileyEndPos( 0 );
   810         TInt smileyEndPos( 0 );
   799         for ( TInt i( 0 ); i < length; i++ )
   811         for ( TInt i( 0 ); i < length; i++ )
   800             {
   812             {
   801             if ( aEditorContent[i] == CSmileyManager::KCompensateChar )
   813             if ( aEditorContent[i] == CAknSmileyManager::KCompensateChar )
   802                 {
   814                 {
   803                 // when 'i' is the first character, it is unkonwn whether it is
   815                 // when 'i' is the first character, it is unkonwn whether it is
   804                 // part of a smiley code string or not, so we have to use another 
   816                 // part of a smiley code string or not, so we have to use another 
   805                 // function to decide.
   817                 // function to decide.
   806                 if ( ( i > 0 && i < smileyEndPos ) ||
   818                 if ( ( i > 0 && i < smileyEndPos ) ||
   807                      ( i == 0 && smiley->SmileyCodeByPos( aDocumentPosition ) > 0 ) )
   819                      ( i == 0 && smiley->SmileyCodeByPos( aDocumentPosition ) > 0 ) )
   808                     {
   820                     {
   809                     aEditorContent[i] = CSmileyManager::KPlaceHolder;
   821                     aEditorContent[i] = CAknSmileyManager::KPlaceHolder;
   810                     }
   822                     }
   811                 }
   823                 }
   812             else if ( smiley->IsSmileyCode( aEditorContent[i] ) )
   824             else if ( smiley->IsSmileyCode( aEditorContent[i] ) )
   813                 {
   825                 {
   814                 smileyEndPos = i + smiley->SmileyLength( aDocumentPosition + i );
   826                 smileyEndPos = i + smiley->SmileyLength( aDocumentPosition + i );
  1074         {
  1086         {
  1075         // Mark the object as destroyed.
  1087         // Mark the object as destroyed.
  1076         *iDestroyedPtr = ETrue;
  1088         *iDestroyedPtr = ETrue;
  1077         iDestroyedPtr = NULL;
  1089         iDestroyedPtr = NULL;
  1078         }
  1090         }
       
  1091     delete iT2WBuf;
  1079     delete iSmiley;
  1092     delete iSmiley;
  1080     delete iSmileyWrap;
  1093     delete iSmileyWrap;
  1081     }
  1094     }
  1082 
  1095 
  1083 EXPORT_C CAknEdwinFormAccessor* CEikEdwin::CEikEdwinExtension::FormAccessor() const
  1096 EXPORT_C CAknEdwinFormAccessor* CEikEdwin::CEikEdwinExtension::FormAccessor() const
  2284             DeleteHighlightL(formatHasChanged,code==EKeyBackspace);
  2297             DeleteHighlightL(formatHasChanged,code==EKeyBackspace);
  2285             const TInt lower=toDelete.LowerPos();
  2298             const TInt lower=toDelete.LowerPos();
  2286             const TCursorSelection sel(lower,lower);
  2299             const TCursorSelection sel(lower,lower);
  2287             iTextView->SetPendingSelection(sel);
  2300             iTextView->SetPendingSelection(sel);
  2288             iTextView->HandleInsertDeleteL(sel,toDelete.Length(),formatHasChanged);
  2301             iTextView->HandleInsertDeleteL(sel,toDelete.Length(),formatHasChanged);
       
  2302             // try to draw "tap to write"
       
  2303             TryToDrawT2W();
  2289             cursorPos = lower;
  2304             cursorPos = lower;
  2290             reportChange=ETrue;
  2305             reportChange=ETrue;
  2291             }
  2306             }
  2292         else if ( replaceSelection ) // All neutral protection cases 
  2307         else if ( replaceSelection ) // All neutral protection cases 
  2293             {
  2308             {
  2343                 TCursorSelection selection=(isPicture? TCursorSelection(cursorPos,cursorPos+1) : TCursorSelection(cursorPos,cursorPos));
  2358                 TCursorSelection selection=(isPicture? TCursorSelection(cursorPos,cursorPos+1) : TCursorSelection(cursorPos,cursorPos));
  2344                 DeleteL(formatHasChanged,selection,code==EKeyBackspace,isPicture);
  2359                 DeleteL(formatHasChanged,selection,code==EKeyBackspace,isPicture);
  2345                 if (!isPicture)
  2360                 if (!isPicture)
  2346                     ClearUndo();
  2361                     ClearUndo();
  2347                 iTextView->HandleCharEditL(charEditType,formatHasChanged);
  2362                 iTextView->HandleCharEditL(charEditType,formatHasChanged);
       
  2363                 TryToDrawT2W();
  2348                 reportChange=ETrue;
  2364                 reportChange=ETrue;
  2349                 formatChange=formatHasChanged;
  2365                 formatChange=formatHasChanged;
  2350                 }
  2366                 }
  2351             }
  2367             }
  2352         if ( reportChange && iEdwinExtension && iEdwinExtension->iSmiley )
  2368         if ( reportChange && iEdwinExtension && iEdwinExtension->iSmiley )
  2420             pending.iAnchorPos=pending.iCursorPos;
  2436             pending.iAnchorPos=pending.iCursorPos;
  2421             iTextView->SetPendingSelection(pending);
  2437             iTextView->SetPendingSelection(pending);
  2422             selection=pending;
  2438             selection=pending;
  2423             --selection.iAnchorPos;
  2439             --selection.iAnchorPos;
  2424             iTextView->HandleInsertDeleteL(selection,selectionLength,formatHasChanged);
  2440             iTextView->HandleInsertDeleteL(selection,selectionLength,formatHasChanged);
       
  2441             // try to draw "tap to write"
       
  2442             TryToDrawT2W();
  2425             User::LeaveIfError(err);
  2443             User::LeaveIfError(err);
  2426             reportChange=ETrue;
  2444             reportChange=ETrue;
  2427             formatChange=formatHasChanged;
  2445             formatChange=formatHasChanged;
  2428             break;
  2446             break;
  2429             }
  2447             }
  2437                 iEdwinExtension->iSmiley->HandleInsertL( cursorPos, 1 );
  2455                 iEdwinExtension->iSmiley->HandleInsertL( cursorPos, 1 );
  2438                 ConvertTextForSmileyL( TCursorSelection( cursorPos, cursorPos ), 
  2456                 ConvertTextForSmileyL( TCursorSelection( cursorPos, cursorPos ), 
  2439                     ETrue );
  2457                     ETrue );
  2440                 }
  2458                 }
  2441             iTextView->HandleCharEditL(charEditType);
  2459             iTextView->HandleCharEditL(charEditType);
       
  2460             TryToDrawT2W();
  2442             reportChange=ETrue;
  2461             reportChange=ETrue;
  2443             }
  2462             }
  2444         else
  2463         else
  2445             {
  2464             {
  2446             ClearUndo();
  2465             ClearUndo();
  2543 paragraph the cursor was on before the edit, EFalse if from the start of the
  2562 paragraph the cursor was on before the edit, EFalse if from the start of the
  2544 line the cursor was on before the edit.
  2563 line the cursor was on before the edit.
  2545 @return The number of pixels scrolled horizontally and vertically. ( Ignored )
  2564 @return The number of pixels scrolled horizontally and vertically. ( Ignored )
  2546 */
  2565 */
  2547     (void)iTextView->HandleInsertDeleteL( selection, deletedChars, aFormatHasChanged);
  2566     (void)iTextView->HandleInsertDeleteL( selection, deletedChars, aFormatHasChanged);
       
  2567     // try to draw "tap to write"
       
  2568     TryToDrawT2W();
  2548     User::LeaveIfError(err);
  2569     User::LeaveIfError(err);
  2549     }
  2570     }
  2550 
  2571 
  2551 EXPORT_C void* CEikEdwin::ExtensionInterface( TUid /*aInterface*/ )
  2572 EXPORT_C void* CEikEdwin::ExtensionInterface( TUid /*aInterface*/ )
  2552     {
  2573     {
  3122     {
  3143     {
  3123     if (!iTextView)
  3144     if (!iTextView)
  3124         return;
  3145         return;
  3125     const TBool focused=IsFocused();
  3146     const TBool focused=IsFocused();
  3126     TRAP_IGNORE(SetCursorVisibilityL(focused));
  3147     TRAP_IGNORE(SetCursorVisibilityL(focused));
       
  3148     if ( iEdwinExtension )
       
  3149         {
       
  3150         if ( focused )
       
  3151             {
       
  3152             iEdwinExtension->iT2WState |= CEikEdwinExtension::EFocusOn;
       
  3153             TryToDrawT2W();
       
  3154             }
       
  3155         else 
       
  3156             {
       
  3157             TBool change = ( TextLength() == 0 && IsT2WEnabled() );
       
  3158             iEdwinExtension->iT2WState &= ~CEikEdwinExtension::EFocusOn;
       
  3159             if ( change )
       
  3160                 {
       
  3161                 TryToDrawT2W( ETrue );
       
  3162                 }
       
  3163             }
       
  3164         }
  3127     if (!focused && iEdwinUserFlags&EAlwaysShowSelection)
  3165     if (!focused && iEdwinUserFlags&EAlwaysShowSelection)
  3128         ;
  3166         ;
  3129     else
  3167     else
  3130         {
  3168         {
  3131         TRAP_IGNORE( SetSelectionVisibilityL( focused ) );// !! inefficient
  3169         TRAP_IGNORE( SetSelectionVisibilityL( focused ) );// !! inefficient
  3986             // Text view may not occupy the whole control area.  So we need to draw in the gaps
  4024             // Text view may not occupy the whole control area.  So we need to draw in the gaps
  3987             DrawBackgroundAroundTextView( gc, rect, viewRect, backgroundColor );
  4025             DrawBackgroundAroundTextView( gc, rect, viewRect, backgroundColor );
  3988             }
  4026             }
  3989 
  4027 
  3990         TrappedDraw(viewRect);
  4028         TrappedDraw(viewRect);
       
  4029         
       
  4030         // try to draw "tap to write"
       
  4031         if ( TextLength() == 0 && IsT2WEnabled() )
       
  4032             {
       
  4033             TRAP_IGNORE( DrawT2WTextL() );
       
  4034             }
  3991 
  4035 
  3992     #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
  4036     #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
  3993         // Workaround for clipping rect problem in multiline queries with text
  4037         // Workaround for clipping rect problem in multiline queries with text
  3994         // entries.  Because of differences between CRemoteGc and CWindowGc, 
  4038         // entries.  Because of differences between CRemoteGc and CWindowGc, 
  3995         // parts of the query wouldn't be drawn by CRemoteGc.  The Reset() call
  4039         // parts of the query wouldn't be drawn by CRemoteGc.  The Reset() call
  4006     {
  4050     {
  4007     CFont** fontPtr = (CFont**)aFont;
  4051     CFont** fontPtr = (CFont**)aFont;
  4008     CEikonEnv::Static()->ScreenDevice()->ReleaseFont(*fontPtr);
  4052     CEikonEnv::Static()->ScreenDevice()->ReleaseFont(*fontPtr);
  4009     }
  4053     }
  4010 
  4054 
  4011 void CEikEdwin::DrawFirstLineTextL() const
  4055 void CEikEdwin::DrawT2WTextL() const
  4012     {
  4056     {
  4013    
  4057     if ( iEdwinExtension && iEdwinExtension->iT2WBuf )
  4014     HBufC* clipbuf = GetTextInHBufL();
  4058         {
  4015     CleanupStack::PushL(clipbuf);
  4059         // rect
  4016 
  4060         TRect edwinRect = RectForFirstLineText();
  4017     TPtrC clipbufPtr = clipbuf->Des();
  4061         
       
  4062         // font
       
  4063         TAknTextLineLayout textLayout =
       
  4064                 AknLayoutScalable_Avkon::data_form_wide_pane_t1(0).LayoutLine();
       
  4065         const CAknLayoutFont* font = AknLayoutUtils::LayoutFontFromId(
       
  4066                 textLayout.FontId());
       
  4067         TFontSpec fontSpec = CursorFontSpec();
       
  4068         fontSpec.iFontStyle.SetStrokeWeight( EStrokeWeightNormal );
       
  4069 
       
  4070         CGraphicsDevice* screenDevice = iEikonEnv->ScreenDevice();
       
  4071         CFbsFont* customFont( NULL );
       
  4072         TInt err = screenDevice->GetNearestFontInTwips((CFont*&) customFont,
       
  4073                 fontSpec);
       
  4074         
       
  4075         //color
       
  4076         TRgb textColor = iEikonEnv->ControlColor(EColorControlText, *this);
       
  4077         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
  4078         if ( skin && SkinColorId() != KErrNotFound )
       
  4079             {
       
  4080             AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, 
       
  4081                     SkinColorId() );
       
  4082             }
       
  4083         
       
  4084         // reorder the buffer
       
  4085         TPtrC clipbufPtr = iEdwinExtension->iT2WBuf->Des();
       
  4086         AknBidiTextUtils::PrepareRunInfoArray( clipbufPtr );
       
  4087         HBufC* reorderedText = HBufC::NewLC( clipbufPtr.Length() + TBidiLogicalToVisual::KMinCharAvailable);
       
  4088         TPtr reorderedTextPtr = reorderedText->Des();
       
  4089         TInt width = edwinRect.Size().iWidth;
       
  4090         AknBidiTextUtils::ConvertToVisualAndClip( clipbufPtr, reorderedTextPtr, *font, width, width );
       
  4091         
       
  4092         CWindowGc& gc = SystemGc();
       
  4093         gc.SetBrushStyle(CGraphicsContext::ENullBrush);
       
  4094         gc.SetPenStyle(CGraphicsContext::ESolidPen);
       
  4095         gc.SetPenColor( FadeRgb( textColor, KBlackMap , KWhiteMap ) );
       
  4096         gc.UseFont( customFont );
       
  4097         gc.DrawText( reorderedTextPtr, edwinRect, font->TextPaneTopToBaseline(),
       
  4098                      AlignForFirstLineText( reorderedTextPtr ) );
       
  4099         gc.DiscardFont();
       
  4100         screenDevice->ReleaseFont( customFont );
       
  4101         CleanupStack::PopAndDestroy( reorderedText );
       
  4102         }
       
  4103     }
       
  4104 
       
  4105 TRect CEikEdwin::RectForFirstLineText() const
       
  4106     {
  4018     TMargins8 margins = Margins();
  4107     TMargins8 margins = Margins();
  4019     const TRect rect(Rect());
  4108     const TRect rect(Rect());
  4020     TInt cursorWidth = CursorWidth(); // need to add cursor width to right hand margin
  4109     TInt cursorWidth = CursorWidth(); // need to add cursor width to right hand margin
  4021     TRect edwinRect = AknLayoutUtils::RectFromCoords(rect, margins.iLeft, margins.iTop, margins.iRight+cursorWidth, margins.iBottom, ELayoutEmpty, ELayoutEmpty);
  4110     TRect edwinRect = AknLayoutUtils::RectFromCoords(rect, margins.iLeft, margins.iTop, margins.iRight+cursorWidth, 
  4022 
  4111             margins.iBottom, ELayoutEmpty, ELayoutEmpty);
  4023     TAknTextLineLayout textLayout = AknLayoutScalable_Avkon::data_form_wide_pane_t1(0).LayoutLine();
  4112     return edwinRect;
  4024     const CAknLayoutFont* font = AknLayoutUtils::LayoutFontFromId( textLayout.FontId());
  4113     }
  4025 
  4114 
  4026     // reorder the text
  4115 CGraphicsContext::TTextAlign CEikEdwin::AlignForFirstLineText( const TPtr & aReorderedTextPtr ) const
  4027     AknBidiTextUtils::PrepareRunInfoArray(clipbufPtr);
  4116     {
  4028 
       
  4029     HBufC* reorderedText = HBufC::NewLC(clipbufPtr.Length() + TBidiLogicalToVisual::KMinCharAvailable);
       
  4030     TPtr reorderedTextPtr = reorderedText->Des();
       
  4031     TInt width = edwinRect.Size().iWidth;
       
  4032     AknBidiTextUtils::ConvertToVisualAndClip(clipbufPtr, reorderedTextPtr, *font, width, width);
       
  4033     AknTextUtils::ReplaceCharacters( reorderedTextPtr, _L("\x2029"), TChar(' ') );
       
  4034     CleanupStack::Pop(reorderedText);   
       
  4035     CleanupStack::PopAndDestroy(clipbuf);   
       
  4036     CleanupStack::PushL(reorderedText);
       
  4037 
       
  4038     CGraphicsContext::TTextAlign alignment = CGraphicsContext::ELeft;
  4117     CGraphicsContext::TTextAlign alignment = CGraphicsContext::ELeft;
  4039     switch(CurrentAlignment())
  4118     switch(CurrentAlignment())
  4040         {
  4119         {
  4041         case EAknEditorAlignLeft:
  4120         case EAknEditorAlignLeft:
  4042             alignment = CGraphicsContext::ELeft;
  4121             alignment = CGraphicsContext::ELeft;
  4049             break;
  4128             break;
  4050         case EAknEditorAlignNone: // drop through to default
  4129         case EAknEditorAlignNone: // drop through to default
  4051         case EAknEditorAlignBidi: // drop through to default
  4130         case EAknEditorAlignBidi: // drop through to default
  4052         default:
  4131         default:
  4053             {
  4132             {
  4054             if (TBidiText::TextDirectionality(reorderedTextPtr) == TBidiText::ELeftToRight)
  4133             if ( TBidiText::TextDirectionality( aReorderedTextPtr ) == TBidiText::ELeftToRight )
  4055                 alignment = CGraphicsContext::ELeft;
  4134                 alignment = CGraphicsContext::ELeft;
  4056             else
  4135             else
  4057                 alignment = CGraphicsContext::ERight;
  4136                 alignment = CGraphicsContext::ERight;
  4058             }
  4137             }
  4059             break;
  4138             break;
  4060         }
  4139         }
       
  4140     return alignment;
       
  4141     }
       
  4142 void CEikEdwin::DrawFirstLineTextL() const
       
  4143     {
       
  4144     // rect
       
  4145     TRect edwinRect = RectForFirstLineText();
       
  4146     // font
       
  4147     TAknTextLineLayout textLayout = AknLayoutScalable_Avkon::data_form_wide_pane_t1(0).LayoutLine();
       
  4148     const CAknLayoutFont* font = AknLayoutUtils::LayoutFontFromId( textLayout.FontId());
       
  4149     // reorder the text
       
  4150     HBufC* clipbuf = GetTextInHBufL();
       
  4151     CleanupStack::PushL(clipbuf);
       
  4152     TPtrC clipbufPtr = clipbuf->Des();
       
  4153     AknBidiTextUtils::PrepareRunInfoArray( clipbufPtr );
       
  4154     HBufC* reorderedText = HBufC::NewLC( clipbufPtr.Length() + TBidiLogicalToVisual::KMinCharAvailable );
       
  4155     TPtr reorderedTextPtr = reorderedText->Des();
       
  4156     TInt width = edwinRect.Size().iWidth;
       
  4157     AknBidiTextUtils::ConvertToVisualAndClip( clipbufPtr, reorderedTextPtr, *font, width, width );
       
  4158     AknTextUtils::ReplaceCharacters( reorderedTextPtr, KParagraphSeparator, TChar(' ') );
       
  4159     CleanupStack::Pop( reorderedText );   
       
  4160     CleanupStack::PopAndDestroy( clipbuf );   
       
  4161     CleanupStack::PushL( reorderedText );
  4061         
  4162         
  4062     CWindowGc& gc=SystemGc();               
  4163     CWindowGc& gc=SystemGc();               
  4063     gc.UseFont(font);
  4164     gc.UseFont( font );
  4064 
  4165     gc.SetBrushStyle( CGraphicsContext::ENullBrush );
  4065     // Following patching up of the GC are now necessary after calling LafCustomDrawerfor background
  4166     gc.SetPenStyle( CGraphicsContext::ESolidPen );
  4066     gc.SetBrushStyle(CGraphicsContext::ENullBrush);
  4167     gc.SetPenColor( iEikonEnv->ControlColor( EColorControlText, *this ) );  // Text color
  4067     gc.SetPenStyle(CGraphicsContext::ESolidPen);
  4168     gc.DrawText( reorderedTextPtr, edwinRect, font->TextPaneTopToBaseline(), 
  4068     TRgb textColor=iEikonEnv->ControlColor(EColorControlText,*this);
  4169             AlignForFirstLineText( reorderedTextPtr ) );
  4069 
  4170     CleanupStack::PopAndDestroy(reorderedText); 
  4070     gc.SetPenColor(textColor);  // Text color
  4171     gc.DiscardFont();
  4071 
       
  4072     // Edwin is assumed to be laid out already with LayoutEdwin. In that case
       
  4073     // the textpane top is the top of the edwin
       
  4074     TInt ascent = font->TextPaneTopToBaseline();
       
  4075     
       
  4076     gc.DrawText(reorderedTextPtr, edwinRect, ascent, alignment);
       
  4077 
       
  4078     CleanupStack::PopAndDestroy(reorderedText);
       
  4079     
       
  4080     gc.DiscardFont(); // So the GC will not try to use the font.
       
  4081     }
  4172     }
  4082 
  4173 
  4083 EXPORT_C void CEikEdwin::TrappedDraw(const TRect& aViewRect) const
  4174 EXPORT_C void CEikEdwin::TrappedDraw(const TRect& aViewRect) const
  4084     {
  4175     {
  4085     if ( iEdwinExtension && iEdwinExtension->iDrawInvoked == CEikEdwinExtension::ENotDraw )
  4176     if ( iEdwinExtension && iEdwinExtension->iDrawInvoked == CEikEdwinExtension::ENotDraw )
  4384     {
  4475     {
  4385     __ASSERT_DEBUG(iText,Panic(EEikPanicEdwinNoText));
  4476     __ASSERT_DEBUG(iText,Panic(EEikPanicEdwinNoText));
  4386     return(iText->DocumentLength());
  4477     return(iText->DocumentLength());
  4387     }
  4478     }
  4388 
  4479 
       
  4480 TBool CEikEdwin::IsT2WEnabled() const
       
  4481     {
       
  4482     /**
       
  4483      * 1,If the editor is read only or it is display only "tap to write" is disabled
       
  4484      * 2,If iEdwinExtension->iT2WBuf is NULL, "tap to write" is disabled. 
       
  4485      * 3,If Qwerty key borad is opened, "tap to write" is disabled
       
  4486      * 4,If focus off, "tap to write" is disabled
       
  4487      * 5,If split input is enabled, "tap to write" is disabled 
       
  4488      */ 
       
  4489     return iEdwinExtension && !( iEdwinUserFlags & EReadOnly ) && 
       
  4490          !( iEdwinUserFlags & EDisplayOnly ) && iEdwinExtension->iT2WBuf && 
       
  4491          ( iEdwinExtension->iT2WState & CEikEdwinExtension::EFocusOn ) &&
       
  4492          !( iEdwinExtension->iT2WState & CEikEdwinExtension::ESplitInputEnabled ) && 
       
  4493          !( iEdwinExtension->iExtendedInputCapabilities->Capabilities() & 
       
  4494            CAknExtendedInputCapabilities::EInputEditorQwertyInputActive );
       
  4495     }
       
  4496 
  4389 void CEikEdwin::SetCursorVisibilityL(TBool aEmphasis)
  4497 void CEikEdwin::SetCursorVisibilityL(TBool aEmphasis)
  4390     {
  4498     {
  4391     TCursor::TVisibility textCursor=(aEmphasis? TCursor::EFCursorFlashing : TCursor::EFCursorInvisible);
  4499     TCursor::TVisibility textCursor=(aEmphasis? TCursor::EFCursorFlashing : TCursor::EFCursorInvisible);
  4392     TCursor::TVisibility lineCursor=((iEdwinUserFlags&ELineCursor && aEmphasis)? 
  4500     TCursor::TVisibility lineCursor=((iEdwinUserFlags&ELineCursor && aEmphasis)? 
  4393                                         TCursor::EFCursorVisible : TCursor::EFCursorInvisible);
  4501                                         TCursor::EFCursorVisible : TCursor::EFCursorInvisible);
  4395         { 
  4503         { 
  4396         textCursor = TCursor::EFCursorInvisible;
  4504         textCursor = TCursor::EFCursorInvisible;
  4397         lineCursor = TCursor::EFCursorInvisible;
  4505         lineCursor = TCursor::EFCursorInvisible;
  4398         }
  4506         }
  4399     
  4507     
       
  4508     if ( iEdwinExtension && ( iEdwinExtension->iT2WState & CEikEdwinExtension::ERecordCursor ) )
       
  4509         {
       
  4510         if ( aEmphasis )
       
  4511             {
       
  4512             iEdwinExtension->iT2WState |= CEikEdwinExtension::ECursorVisible;
       
  4513             }
       
  4514         else 
       
  4515             {
       
  4516             iEdwinExtension->iT2WState &= ~CEikEdwinExtension::ECursorVisible;
       
  4517             }
       
  4518         }
       
  4519     
       
  4520     if ( TextLength() == 0 && IsT2WEnabled() )
       
  4521         {
       
  4522         textCursor = TCursor::EFCursorInvisible;
       
  4523         }
  4400     iTextView->SetCursorVisibilityL(lineCursor,textCursor);
  4524     iTextView->SetCursorVisibilityL(lineCursor,textCursor);
  4401     CAknEdwinState*edwinState = EditorState();
  4525     CAknEdwinState*edwinState = EditorState();
  4402     if( !edwinState )
  4526     if( !edwinState )
  4403     	return;
  4527     	return;
  4404     if( textCursor != TCursor::EFCursorInvisible )
  4528     if( textCursor != TCursor::EFCursorInvisible )
  4856             {
  4980             {
  4857             iEdwinExtension->iSmiley->HandleInsertL( lower, undoneLength );
  4981             iEdwinExtension->iSmiley->HandleInsertL( lower, undoneLength );
  4858             ConvertTextForSmileyL( TCursorSelection( lower, undoneLength ), ETrue );
  4982             ConvertTextForSmileyL( TCursorSelection( lower, undoneLength ), ETrue );
  4859             }
  4983             }
  4860         TRAPD(err2,iTextView->HandleInsertDeleteL(TCursorSelection(lower,lower+undoneLength),newText.Length(),changed));
  4984         TRAPD(err2,iTextView->HandleInsertDeleteL(TCursorSelection(lower,lower+undoneLength),newText.Length(),changed));
       
  4985         // try to draw "tap to write"
       
  4986         TryToDrawT2W();
  4861         ClearUndo();
  4987         ClearUndo();
  4862         if (NeedToChangeFormattingModeL())
  4988         if (NeedToChangeFormattingModeL())
  4863             SetAmountToFormatL();
  4989             SetAmountToFormatL();
  4864         ForceScrollBarUpdateL();
  4990         ForceScrollBarUpdateL();
  4865         User::LeaveIfError(err);
  4991         User::LeaveIfError(err);
  4938         }
  5064         }
  4939     const TInt newLength=iText->DocumentLength();
  5065     const TInt newLength=iText->DocumentLength();
  4940     const TInt newCursorPos=cursorPos+newLength-oldLength;
  5066     const TInt newCursorPos=cursorPos+newLength-oldLength;
  4941     iTextView->SetPendingSelection(TCursorSelection(newCursorPos,newCursorPos));
  5067     iTextView->SetPendingSelection(TCursorSelection(newCursorPos,newCursorPos));
  4942     if (NeedToChangeFormattingModeL())
  5068     if (NeedToChangeFormattingModeL())
       
  5069         {
  4943         SetAmountToFormatL();
  5070         SetAmountToFormatL();
       
  5071         }
  4944     else
  5072     else
       
  5073         {
  4945         iTextView->HandleInsertDeleteL(TCursorSelection(newCursorPos,cursorPos),0,ETrue);
  5074         iTextView->HandleInsertDeleteL(TCursorSelection(newCursorPos,cursorPos),0,ETrue);
       
  5075         // try to draw "tap to write"
       
  5076         TryToDrawT2W();
       
  5077         }
  4946     DrawContents();
  5078     DrawContents();
  4947     UpdateScrollBarsL();
  5079     UpdateScrollBarsL();
  4948     ReportEdwinEventL( MEikEdwinObserver::EEventTextUpdate );
  5080     ReportEdwinEventL( MEikEdwinObserver::EEventTextUpdate );
  4949     DoReportEventL( MCoeControlObserver::EEventStateChanged );
  5081     DoReportEventL( MCoeControlObserver::EEventStateChanged );
  4950     iEikonEnv->BusyMsgCancel();
  5082     iEikonEnv->BusyMsgCancel();
  5021                 const TCursorSelection pending(lower,lower);
  5153                 const TCursorSelection pending(lower,lower);
  5022                 iTextView->SetPendingSelection(pending);
  5154                 iTextView->SetPendingSelection(pending);
  5023                 selection.iAnchorPos=lower;
  5155                 selection.iAnchorPos=lower;
  5024                 selection.iCursorPos=lower;
  5156                 selection.iCursorPos=lower;
  5025                 iTextView->HandleInsertDeleteL(selection,selLength,formatHasChanged);
  5157                 iTextView->HandleInsertDeleteL(selection,selLength,formatHasChanged);
       
  5158                 // try to draw "tap to write"
       
  5159                 TryToDrawT2W();
  5026                 reportChange=ETrue;
  5160                 reportChange=ETrue;
  5027                 }
  5161                 }
  5028             CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog();
  5162             CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog();
  5029             dlg->SetTimeout( CAknNoteDialog::EShortTimeout );
  5163             dlg->SetTimeout( CAknNoteDialog::EShortTimeout );
  5030             dlg->SetTone( CAknNoteDialog::ENoTone );
  5164             dlg->SetTone( CAknNoteDialog::ENoTone );
  5169         {
  5303         {
  5170         SetAmountToFormatL();
  5304         SetAmountToFormatL();
  5171         DrawContents();
  5305         DrawContents();
  5172         }
  5306         }
  5173     else
  5307     else
       
  5308         {
  5174         iTextView->HandleInsertDeleteL(selection,selLength,formatHasChanged);
  5309         iTextView->HandleInsertDeleteL(selection,selLength,formatHasChanged);
       
  5310         // try to draw "tap to write"
       
  5311         TryToDrawT2W();
       
  5312         }
  5175     iEikonEnv->BusyMsgCancel();
  5313     iEikonEnv->BusyMsgCancel();
  5176     User::LeaveIfError(err);
  5314     User::LeaveIfError(err);
  5177     }
  5315     }
  5178 
  5316 
  5179 void CEikEdwin::DoPasteFromStoreL(const CStreamStore& aStore,const CStreamDictionary& aDict)
  5317 void CEikEdwin::DoPasteFromStoreL(const CStreamStore& aStore,const CStreamDictionary& aDict)
  6516         selection.iCursorPos=selection.iAnchorPos+aModel->iReplaceText.Length();
  6654         selection.iCursorPos=selection.iAnchorPos+aModel->iReplaceText.Length();
  6517         }
  6655         }
  6518     const TCursorSelection pending(selection.iCursorPos,selection.iCursorPos);
  6656     const TCursorSelection pending(selection.iCursorPos,selection.iCursorPos);
  6519     iTextView->SetPendingSelection(pending);
  6657     iTextView->SetPendingSelection(pending);
  6520     iTextView->HandleInsertDeleteL(selection,aModel->iText.Length(),formatHasChanged);
  6658     iTextView->HandleInsertDeleteL(selection,aModel->iText.Length(),formatHasChanged);
       
  6659     // try to draw "tap to write"
       
  6660     TryToDrawT2W();
  6521     if ( NeedToChangeFormattingModeL())
  6661     if ( NeedToChangeFormattingModeL())
  6522         SetAmountToFormatL();
  6662         SetAmountToFormatL();
  6523     ReportEdwinEventL( MEikEdwinObserver::EEventTextUpdate );
  6663     ReportEdwinEventL( MEikEdwinObserver::EEventTextUpdate );
  6524     DoReportEventL( MCoeControlObserver::EEventStateChanged );
  6664     DoReportEventL( MCoeControlObserver::EEventStateChanged );
  6525     User::LeaveIfError(err);
  6665     User::LeaveIfError(err);
  6823         selection.iAnchorPos=anchor;
  6963         selection.iAnchorPos=anchor;
  6824         selection.iCursorPos=anchor+fieldLength;
  6964         selection.iCursorPos=anchor+fieldLength;
  6825         if (iUndoStore)
  6965         if (iUndoStore)
  6826             iUndoStore->SetNewText(selection);
  6966             iUndoStore->SetNewText(selection);
  6827         iTextView->HandleInsertDeleteL(selection,selectionLength,formatHasChanged);
  6967         iTextView->HandleInsertDeleteL(selection,selectionLength,formatHasChanged);
       
  6968         // try to draw "tap to write"
       
  6969         TryToDrawT2W();
  6828         ReportEdwinEventL( MEikEdwinObserver::EEventTextUpdate );
  6970         ReportEdwinEventL( MEikEdwinObserver::EEventTextUpdate );
  6829         DoReportEventL( MCoeControlObserver::EEventStateChanged );
  6971         DoReportEventL( MCoeControlObserver::EEventStateChanged );
  6830         User::LeaveIfError(err);
  6972         User::LeaveIfError(err);
  6831         }
  6973         }
  6832     }
  6974     }
  6926             TInt yPos = ( viewRect.iBr.iY + viewRect.iTl.iY )/2;
  7068             TInt yPos = ( viewRect.iBr.iY + viewRect.iTl.iY )/2;
  6927             yPosQ.SetMakeLineFullyVisible();
  7069             yPosQ.SetMakeLineFullyVisible();
  6928             yPosQ.SetFillScreen();
  7070             yPosQ.SetFillScreen();
  6929             TRAP_IGNORE( iTextView->SetViewL( docPos, yPos, yPosQ ) ); 
  7071             TRAP_IGNORE( iTextView->SetViewL( docPos, yPos, yPosQ ) ); 
  6930             }                
  7072             }                
       
  7073         TRAP_IGNORE( MoveViewToCursorLineL() );
  6931         }
  7074         }
  6932         break;
  7075         break;
  6933     case KEikMessageVirtualCursorStateChange:
  7076     case KEikMessageVirtualCursorStateChange:
  6934         {
  7077         {
  6935         TEikVirtualCursor& cursor=iEikonEnv->VirtualCursor();
  7078         TEikVirtualCursor& cursor=iEikonEnv->VirtualCursor();
  6967 			EnableSmileySupportL( ETrue );
  7110 			EnableSmileySupportL( ETrue );
  6968 			}
  7111 			}
  6969         DoAlignment();
  7112         DoAlignment();
  6970         }
  7113         }
  6971         break;
  7114         break;
       
  7115     case KAknSplitInputEnabled:
       
  7116     	{
       
  7117         if ( iEdwinExtension )
       
  7118             {
       
  7119             TBool change = ( TextLength() == 0 && IsT2WEnabled() );
       
  7120             iEdwinExtension->iT2WState |= CEikEdwinExtension::ESplitInputEnabled;           
       
  7121             if ( change )
       
  7122                 {
       
  7123                 TryToDrawT2W( ETrue );
       
  7124                 }
       
  7125             }
       
  7126     	}
       
  7127     	break;
       
  7128     case KAknSplitInputDisabled:
       
  7129     	{
       
  7130         if ( iEdwinExtension )
       
  7131             {
       
  7132             iEdwinExtension->iT2WState &= ~CEikEdwinExtension::ESplitInputEnabled;
       
  7133             TryToDrawT2W();
       
  7134             }
       
  7135     	}
       
  7136     	break;
  6972     default:
  7137     default:
  6973         break;
  7138         break;
  6974         }
  7139         }
  6975     }
  7140     }
  6976 
  7141 
  7180         iEdwinExtension->iSmiley->HandleInsertL( aInsertPos, aText.Length() );
  7345         iEdwinExtension->iSmiley->HandleInsertL( aInsertPos, aText.Length() );
  7181         ConvertTextForSmileyL( TCursorSelection( aInsertPos, 
  7346         ConvertTextForSmileyL( TCursorSelection( aInsertPos, 
  7182             aInsertPos + aText.Length() ), ETrue );
  7347             aInsertPos + aText.Length() ), ETrue );
  7183         }
  7348         }
  7184     iTextView->HandleInsertDeleteL(TCursorSelection(aInsertPos,aInsertPos+aText.Length()),length,formatChanged);
  7349     iTextView->HandleInsertDeleteL(TCursorSelection(aInsertPos,aInsertPos+aText.Length()),length,formatChanged);
       
  7350     // try to draw "tap to write"
       
  7351     TryToDrawT2W();
  7185     }
  7352     }
  7186 
  7353 
  7187 EXPORT_C void CEikEdwin::SetNonPrintingCharsVisibility(TNonPrintingCharVisibility aVisibility)
  7354 EXPORT_C void CEikEdwin::SetNonPrintingCharsVisibility(TNonPrintingCharVisibility aVisibility)
  7188     {
  7355     {
  7189     __ASSERT_DEBUG(iLayout,Panic(EEikPanicEdwinNoLayout));
  7356     __ASSERT_DEBUG(iLayout,Panic(EEikPanicEdwinNoLayout));
  8435     if ( scroll )
  8602     if ( scroll )
  8436         {
  8603         {
  8437         UpdateScrollBarsL();
  8604         UpdateScrollBarsL();
  8438         }
  8605         }
  8439     }
  8606     }
       
  8607 
       
  8608 // ---------------------------------------------------------------------------
       
  8609 // CEikEdwin::MoveViewToCursorLineL
       
  8610 // ---------------------------------------------------------------------------
       
  8611 //
       
  8612 void CEikEdwin::MoveViewToCursorLineL()
       
  8613     {
       
  8614     if ( !iTextView )
       
  8615         {
       
  8616         return;
       
  8617         }
       
  8618 
       
  8619     const TInt cursorPos ( CursorPos() );
       
  8620     const TRect viewRect( AdjustedViewRect() );
       
  8621 
       
  8622     const TPoint startPoint ( viewRect.iTl );
       
  8623     const TPoint endPoint ( viewRect.iBr );
       
  8624 
       
  8625     TPoint cursorPoint;
       
  8626     iTextView->DocPosToXyPosL( cursorPos, cursorPoint );
       
  8627 
       
  8628     if ( cursorPoint.iY > endPoint.iY )
       
  8629         {
       
  8630         TBool exceed ( EFalse ) ;
       
  8631         TInt rest ( 0 );
       
  8632         ScrollView ( endPoint.iY - cursorPoint.iY, exceed, rest );
       
  8633         }
       
  8634     else if ( cursorPoint.iY < startPoint.iY )
       
  8635         {
       
  8636         TBool exceed ( EFalse ) ;
       
  8637         TInt rest ( 0 );
       
  8638         ScrollView ( startPoint.iY - cursorPoint.iY, exceed, rest );
       
  8639         }
       
  8640     }
  8440     
  8641     
  8441 EXPORT_C void CEikEdwin::SetCursorVisible(TBool aVisible)
  8642 EXPORT_C void CEikEdwin::SetCursorVisible(TBool aVisible)
  8442     {
  8643     {
  8443     TRAP_IGNORE( SetCursorVisibilityL( aVisible ) );
  8644     TRAP_IGNORE( SetCursorVisibilityL( aVisible ) );
  8444     }
  8645     }
  9316 	// bitmap Id, bitmap Mask Id of captioned control
  9517 	// bitmap Id, bitmap Mask Id of captioned control
  9317 	aReader.Advance( KTInt16Length + KTInt16Length );
  9518 	aReader.Advance( KTInt16Length + KTInt16Length );
  9318 	aReader.ReadTPtrC(); // Process ToolTip
  9519 	aReader.ReadTPtrC(); // Process ToolTip
  9319 	}
  9520 	}
  9320 
  9521 
       
  9522 // returns the faded color of aColor
       
  9523 // aWhiteMap and aBlackMap parameters control the amount of fading
       
  9524 TRgb FadeRgb(TRgb aColor, TUint8 aBlackMap,TUint8 aWhiteMap)
       
  9525     {
       
  9526     TUint8 fadeMapFactor = aWhiteMap - aBlackMap + 1;
       
  9527     TUint8 fadeMapOffset = aBlackMap;
       
  9528     TInt value = aColor.Internal();
       
  9529     TInt b = (((value & 0x000000ff) * fadeMapFactor) >> 8)  + fadeMapOffset;
       
  9530     TInt g = (((value & 0x0000ff00) * fadeMapFactor) >> 16) + fadeMapOffset;
       
  9531     //the multiplication by iFadeMapFactor can overflow into the sign bit, so we shift down in two steps
       
  9532     TInt r = ((((value & 0x00ff0000) >> 16) * fadeMapFactor) >> 8) + fadeMapOffset;
       
  9533     TInt a = aColor.Alpha();
       
  9534     return TRgb(r,g,b,a );
       
  9535     }
       
  9536 
       
  9537 // ---------------------------------------------------------------------------
       
  9538 // CEikEdwin::EnableT2WL
       
  9539 // ---------------------------------------------------------------------------
       
  9540 //
       
  9541 EXPORT_C void CEikEdwin::EnableT2WL( TBool aEnable )
       
  9542     {
       
  9543     if ( iEdwinExtension )
       
  9544         {
       
  9545         if ( !aEnable && iEdwinExtension->iT2WBuf )
       
  9546             {
       
  9547             delete iEdwinExtension->iT2WBuf;
       
  9548             iEdwinExtension->iT2WBuf = NULL;
       
  9549             if ( iTextView ) 
       
  9550                 {
       
  9551                 TryToDrawT2W( ETrue );
       
  9552                 }
       
  9553             }
       
  9554         else if ( aEnable && !iEdwinExtension->iT2WBuf )
       
  9555             {
       
  9556             CRepository* cenrep = NULL;
       
  9557             TInt supportT2W = 0;
       
  9558             TRAPD(error, cenrep = CRepository::NewL(KCRUidAvkon));
       
  9559             if ( error == KErrNone )
       
  9560                 {
       
  9561                 error = cenrep->Get( KAknEdwinTapToWrite, supportT2W );
       
  9562                 }
       
  9563             delete cenrep;
       
  9564             if ( supportT2W && !iEdwinExtension->iT2WBuf )
       
  9565                 {
       
  9566                 iEdwinExtension->iT2WBuf = iEikonEnv->AllocReadResourceLC( R_AVKON_TAP_TO_WRITE ); 
       
  9567                 CleanupStack::Pop( iEdwinExtension->iT2WBuf );
       
  9568                 if ( iTextView )
       
  9569                     {
       
  9570                     TryToDrawT2W();
       
  9571                     }
       
  9572                 }
       
  9573             }
       
  9574         } 
       
  9575     }
       
  9576 
       
  9577 // ---------------------------------------------------------------------------
       
  9578 // CEikEdwin::TryToDrawT2W
       
  9579 // ---------------------------------------------------------------------------
       
  9580 //
       
  9581 void CEikEdwin::TryToDrawT2W( TBool aClean )
       
  9582     {
       
  9583     CAknEdwinState* edwinState = EditorState();
       
  9584     TBool cursorVisible( EFalse );
       
  9585     if ( edwinState )
       
  9586         {
       
  9587         cursorVisible = ( edwinState->Flags() | EAknEditorFlagTextCursorVisible );
       
  9588         }
       
  9589     
       
  9590     if ( iEdwinExtension )
       
  9591         {
       
  9592         // When "tap to write" is enabled( started ) we should record the status of cursor.
       
  9593         if ( TextLength() == 0 && IsT2WEnabled() )
       
  9594             {
       
  9595             SetCursorVisible( EFalse );
       
  9596             iEdwinExtension->iT2WState |= CEikEdwinExtension::ERecordCursor;
       
  9597             if ( cursorVisible )
       
  9598                 {
       
  9599                 iEdwinExtension->iT2WState |= CEikEdwinExtension::ECursorVisible;
       
  9600                 }
       
  9601             else 
       
  9602                 {
       
  9603                 iEdwinExtension->iT2WState &= ~CEikEdwinExtension::ECursorVisible;
       
  9604                 }
       
  9605             DrawDeferred();
       
  9606             }
       
  9607         // When "tap to write" is disabled ( ended ) we need to recover the status of cursor.
       
  9608         else if ( IsFocused() && 
       
  9609                   ( iEdwinExtension->iT2WState & CEikEdwinExtension::ERecordCursor ) ) 
       
  9610             {
       
  9611             iEdwinExtension->iT2WState &= ~CEikEdwinExtension::ERecordCursor;
       
  9612             SetCursorVisible( iEdwinExtension->iT2WState & CEikEdwinExtension::ECursorVisible );
       
  9613             }
       
  9614         // When focus off, we don't need to record the status anymore. So clean it.
       
  9615         else if ( !IsFocused() ) 
       
  9616             {
       
  9617             iEdwinExtension->iT2WState &= ~CEikEdwinExtension::ERecordCursor;
       
  9618             }
       
  9619         }
       
  9620     
       
  9621     if ( aClean && TextLength() == 0 )
       
  9622         {
       
  9623         DrawDeferred();
       
  9624         }  
       
  9625     }
       
  9626 
  9321 // End of File
  9627 // End of File
  9322 
  9628