webengine/wmlengine/src/fbox/src/FBOXCEpoc32InputBox.cpp
changeset 1 7c90e6132015
parent 0 dd21522fd290
child 42 a1a5d4e727e8
equal deleted inserted replaced
0:dd21522fd290 1:7c90e6132015
    56 
    56 
    57 
    57 
    58 // CONSTANTS
    58 // CONSTANTS
    59 
    59 
    60 static const TInt KNumberOfLines = 1000;
    60 static const TInt KNumberOfLines = 1000;
    61 _LIT(KBlankDesC," ");
       
    62 
    61 
    63 // ================= STATIC FUNCTIONS =======================
    62 // ================= STATIC FUNCTIONS =======================
    64 TInt CEpoc32InputBox::RefreshContents( TAny* aParam )
    63 TInt CEpoc32InputBox::RefreshContents( TAny* aParam )
    65 {
    64 {
    66   CEpoc32InputBox* epoc32InputBox= (CEpoc32InputBox* )aParam ;
    65   CEpoc32InputBox* epoc32InputBox= (CEpoc32InputBox* )aParam ;
   275 
   274 
   276         return;
   275         return;
   277         }
   276         }
   278     else
   277     else
   279         {
   278         {
   280         CreateWindowL( iParent );
   279         SetContainerWindowL( *iParent );
   281         }
   280         }
   282 
   281 
   283     // Create formatted editor
   282     // Create formatted editor
   284     iEditor = new( ELeave )CWmlFormattedEditor(aIsSecret);
   283     iEditor = new( ELeave )CWmlFormattedEditor(aIsSecret);
   285 
   284 
   618             {
   617             {
   619             break;
   618             break;
   620             }
   619             }
   621          }
   620          }
   622       }
   621       }
       
   622     else
       
   623         {
       
   624          if ( iEditor )
       
   625            {
       
   626               iEditor->TextView()->FormatTextL();
       
   627            }
       
   628         }
   623     }
   629     }
   624 
   630 
   625 // ---------------------------------------------------------
   631 // ---------------------------------------------------------
   626 // CEpoc32InputBox::HandleEdwinEventL
   632 // CEpoc32InputBox::HandleEdwinEventL
   627 // Handles multi-tap input from Avkon
   633 // Handles multi-tap input from Avkon
  1314         {
  1320         {
  1315         if (iPenEnabled)
  1321         if (iPenEnabled)
  1316             {
  1322             {
  1317             return TCoeInputCapabilities(iEditor->InputCapabilities().Capabilities(),
  1323             return TCoeInputCapabilities(iEditor->InputCapabilities().Capabilities(),
  1318                     (MCoeFepAwareTextEditor*) this,
  1324                     (MCoeFepAwareTextEditor*) this,
  1319                     (MCoeCaptionRetrieverForFep*) this);
  1325                     (MCoeCaptionRetrieverForFep*) this, TUid::Uid(KFepUid), (TCoeInputCapabilities::MCoeFepSpecificExtensions*)this );
  1320             }
  1326             }
  1321         else
  1327         else
  1322             {
  1328             {
  1323             return iEditor->InputCapabilities();
  1329             return iEditor->InputCapabilities();
  1324             }
  1330             }
  1626 //
  1632 //
  1627 //
  1633 //
  1628 // -----------------------------------------------------------------------------
  1634 // -----------------------------------------------------------------------------
  1629 TInt CEpoc32InputBox::DocumentMaximumLengthForFep() const
  1635 TInt CEpoc32InputBox::DocumentMaximumLengthForFep() const
  1630 {
  1636 {
  1631     return KMaxTInt;
  1637     return iMaxLength;
  1632 }
  1638 }
  1633 
  1639 
  1634 // -----------------------------------------------------------------------------
  1640 // -----------------------------------------------------------------------------
  1635 // SetCursorSelectionForFepL
  1641 // SetCursorSelectionForFepL
  1636 //
  1642 //
  1663 // GetEditorContentForFep
  1669 // GetEditorContentForFep
  1664 //
  1670 //
  1665 //
  1671 //
  1666 // -----------------------------------------------------------------------------
  1672 // -----------------------------------------------------------------------------
  1667 void CEpoc32InputBox::GetEditorContentForFep(TDes& aEditorContent,TInt aDocumentPosition,TInt aLengthToRetrieve) const
  1673 void CEpoc32InputBox::GetEditorContentForFep(TDes& aEditorContent,TInt aDocumentPosition,TInt aLengthToRetrieve) const
  1668 {
  1674 {    
  1669     aEditorContent = KBlankDesC;
  1675     aEditorContent = KNullDesC; 
  1670     if ( iInlineEditText && aDocumentPosition >= 0 && (aDocumentPosition + aLengthToRetrieve) <= iInlineEditText->Length() )
  1676 	if ( iInlineEditText && aDocumentPosition >= 0 && (aDocumentPosition + aLengthToRetrieve) <= iInlineEditText->Length() ) 
  1671         {
  1677 	    {
  1672         aEditorContent = iInlineEditText->Des().Mid(aDocumentPosition,aLengthToRetrieve);
  1678 	    aEditorContent = iInlineEditText->Des().Mid(aDocumentPosition,aLengthToRetrieve);
  1673         }
  1679 		}
  1674 }
  1680 }
  1675 
  1681 
  1676 // -----------------------------------------------------------------------------
  1682 // -----------------------------------------------------------------------------
  1677 // GetFormatForFep
  1683 // GetFormatForFep
  1678 //
  1684 //
  1814     if ( state ) {
  1820     if ( state ) {
  1815         TRAP_IGNORE( state->ReportAknEdStateEventL( MAknEdStateObserver::EAknCursorPositionChanged ) );
  1821         TRAP_IGNORE( state->ReportAknEdStateEventL( MAknEdStateObserver::EAknCursorPositionChanged ) );
  1816     }
  1822     }
  1817 }
  1823 }
  1818 
  1824 
       
  1825 // -------------------------------------------------------------------------------
       
  1826 // IsValidCharacter :: interface method of MCoeFepSpecificExtensions
       
  1827 // 
       
  1828 // -------------------------------------------------------------------------------
       
  1829 TBool CEpoc32InputBox::IsValidCharacter(TInt aChar) 
       
  1830     {
       
  1831     // Single line input box, enter character need not be taken  
       
  1832     if ( aChar == KLineEnterChar )
       
  1833         return EFalse; 
       
  1834     return ETrue; 
       
  1835     }
  1819 
  1836 
  1820 //  End of File
  1837 //  End of File
  1821 
  1838