textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutmultilineicfeditor.cpp
branchRCL_3
changeset 19 ac7e4d1d9209
parent 15 6c2c2d3ab788
child 20 ebd48d2de13c
equal deleted inserted replaced
18:b1ea1642412e 19:ac7e4d1d9209
    44 #include "AknEdwinFormExtendedInterfaceProvider.h"
    44 #include "AknEdwinFormExtendedInterfaceProvider.h"
    45 #include "AknCompositeInlineTextSource.h"
    45 #include "AknCompositeInlineTextSource.h"
    46 #include "peninputlayoutsmiley.h"
    46 #include "peninputlayoutsmiley.h"
    47 
    47 
    48 #include <gdi.h>
    48 #include <gdi.h>
       
    49 
       
    50 #include <e32std.h>
       
    51 #include <e32const.h>
       
    52 
    49 const TInt KParagraphSeperator = 0x2029;
    53 const TInt KParagraphSeperator = 0x2029;
    50 const TInt KSecretUpdateTimer = 1000000; // 1s
    54 const TInt KSecretUpdateTimer = 1000000; // 1s
    51 const TInt KSecretInstantShowTimer = 100000; // 100ms
    55 const TInt KSecretInstantShowTimer = 100000; // 100ms
    52 
    56 
    53 const TUint16 KSegment = 0x0020;
    57 const TUint16 KSegment = 0x0020;
  1047         {
  1051         {
  1048         iFormatChange = ETrue;
  1052         iFormatChange = ETrue;
  1049         }    
  1053         }    
  1050     
  1054     
  1051     TFontSpec fontSpec;
  1055     TFontSpec fontSpec;
       
  1056     fontSpec = aFont->FontSpecInTwips();
  1052     fontSpec.iHeight = aFont->HeightInPixels();
  1057     fontSpec.iHeight = aFont->HeightInPixels();
  1053     CFont*  font;
  1058     CFont*  font;
  1054     iCoeEnv->ScreenDevice()->ReleaseFont(CONST_CAST(CFont*, iFont));
  1059     iCoeEnv->ScreenDevice()->ReleaseFont(CONST_CAST(CFont*, iFont));
  1055     iCoeEnv->ScreenDevice()->GetNearestFontInPixels((CFont*&)font,fontSpec);
  1060     iCoeEnv->ScreenDevice()->GetNearestFontInPixels((CFont*&)font,fontSpec);
  1056     
  1061     
  1065     iCharFormatMask.SetAttrib(EAttFontTypeface);
  1070     iCharFormatMask.SetAttrib(EAttFontTypeface);
  1066 
  1071 
  1067     iCharFormat.iFontSpec.iHeight = iCoeEnv->ScreenDevice()->VerticalPixelsToTwips(iFontHeight);
  1072     iCharFormat.iFontSpec.iHeight = iCoeEnv->ScreenDevice()->VerticalPixelsToTwips(iFontHeight);
  1068     iCharFormat.iFontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightNormal);
  1073     iCharFormat.iFontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightNormal);
  1069     iCharFormat.iFontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
  1074     iCharFormat.iFontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
       
  1075     iCharFormat.iFontSpec.iTypeface = iFont->FontSpecInTwips().iTypeface;
  1070 
  1076 
  1071     iRichText->ApplyCharFormatL(iCharFormat, iCharFormatMask, 0, iRichText->DocumentLength());    
  1077     iRichText->ApplyCharFormatL(iCharFormat, iCharFormatMask, 0, iRichText->DocumentLength());    
  1072     if( InlineStateOn() || AutoCompletionStateOn() )
  1078     if( InlineStateOn() || AutoCompletionStateOn() )
  1073         {
  1079         {
  1074         iCharFormatMask.ClearAll();
  1080         iCharFormatMask.ClearAll();
  1979         {
  1985         {
  1980         TInt cursorPos = iFont->TextCount(iMfneIcfData->Des(), aPt.iX - iViewRect.iTl.iX - iOffset );
  1986         TInt cursorPos = iFont->TextCount(iMfneIcfData->Des(), aPt.iX - iViewRect.iTl.iX - iOffset );
  1981         iCursorSel = TCursorSelection(cursorPos+iPromptTextLen, 
  1987         iCursorSel = TCursorSelection(cursorPos+iPromptTextLen, 
  1982                                       iCursorSel.iAnchorPos);
  1988                                       iCursorSel.iAnchorPos);
  1983         AdjustFepCursorPosForPromptText( ETrue );
  1989         AdjustFepCursorPosForPromptText( ETrue );
       
  1990         
       
  1991         TAmPmName amName(EAm);
       
  1992         TAmPmName pmName(EPm);
       
  1993         TInt offset = iMfneIcfData->Find(amName)!= KErrNotFound?
       
  1994                         iMfneIcfData->Find(amName):iMfneIcfData->Find(pmName);
       
  1995 	    //if current is 12-hour format and touch on correct position
       
  1996         if(offset != KErrNotFound &&
       
  1997            iCursorSel.LowerPos()-iPromptTextLen>= offset &&
       
  1998            iCursorSel.LowerPos()-iPromptTextLen<= offset+amName.Length())
       
  1999             {
       
  2000             UiLayout()->SignalOwner(ESignalChangeAmPm);
       
  2001             }
       
  2002 
  1984         return this;
  2003         return this;
  1985         }
  2004         }
  1986         
  2005         
  1987     if (!iPntDownOnInline)
  2006     if (!iPntDownOnInline)
  1988         {
  2007         {