fep/aknfep/peninputplugins/peninputimepluginitut/src/pluginfepmanagerbase.cpp
branchRCL_3
changeset 44 ecbabf52600f
child 56 8152b1f1763a
equal deleted inserted replaced
43:ebd48d2de13c 44:ecbabf52600f
       
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:            Layout UI interface base class implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // System includes
       
    30 #include <w32std.h>
       
    31 #include <s32mem.h> 
       
    32 #include <aknedsts.h>               // CAknEdwinState
       
    33 #include <centralrepository.h>
       
    34 #include <peninputclient.h>
       
    35 #include <aknfeppeninputenums.h>
       
    36 #include <AknFepInternalCRKeys.h>
       
    37 #include <peninputgenericitutcustomization.h>
       
    38 
       
    39 // User includes
       
    40 #include "pluginfepmanagerbase.h"
       
    41 #include "peninputimepluginitut.h"
       
    42 
       
    43 // ======== MEMBER FUNCTIONS ========
       
    44 
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CPluginFepManagerBase::CPluginFepManagerBase
       
    48 // Destructor
       
    49 // (other items were commented in a header).
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 CPluginFepManagerBase::~CPluginFepManagerBase()
       
    53     {
       
    54     delete iRepository;
       
    55     }
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 // CPluginFepManagerBase::OnInit
       
    59 // Initalize UI.
       
    60 // (other items were commented in a header).
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 void CPluginFepManagerBase::OnInit()
       
    64     {
       
    65     }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CPluginFepManagerBase::RetrieveEditorMaxLength
       
    69 // Explicitly get ICF max length from layout UI .
       
    70 // (other items were commented in a header).
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 void CPluginFepManagerBase::RetrieveEditorMaxLength()
       
    74     {
       
    75     }
       
    76 
       
    77 // -----------------------------------------------------------------------------
       
    78 // CPluginFepManagerBase::UpdateCaseMode
       
    79 // Update local copy of case mode.
       
    80 // (other items were commented in a header).
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 void CPluginFepManagerBase::UpdateCaseMode( TInt aCaseMode )
       
    84     {
       
    85     iLastCase = aCaseMode; 
       
    86     }
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CPluginFepManagerBase::SetNumberModeKeyMappingL
       
    90 // Set layout UI current number mode.
       
    91 // (other items were commented in a header).
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 void CPluginFepManagerBase::SetNumberModeKeyMappingL( 
       
    95     TAknEditorNumericKeymap aAknEditorNumericKeymap )
       
    96     {
       
    97     SendCommandToServer( ECmdPenInputEditorNumericKeyMap, 
       
    98                          aAknEditorNumericKeymap );    
       
    99     }
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // CPluginFepManagerBase::HandleKeyL
       
   103 // Handle key event.
       
   104 // (other items were commented in a header).
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 TBool CPluginFepManagerBase::HandleKeyL( TInt aKey, TKeyPressLength aLength, TEventCode /*aEventCode*/ )
       
   108     {
       
   109     return iHkbUi->HandleKeyL( aKey, aLength );
       
   110     }
       
   111 
       
   112 // -----------------------------------------------------------------------------
       
   113 // CPluginFepManagerBase::HandleCommandL
       
   114 // Handle command come from FEP.
       
   115 // (other items were commented in a header).
       
   116 // -----------------------------------------------------------------------------
       
   117 //
       
   118 void CPluginFepManagerBase::HandleCommandL( TInt aCommandId )
       
   119     {
       
   120     SendCommandToServer( aCommandId );
       
   121     }
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 // CPluginFepManagerBase::HandleCommandL
       
   125 // Handle command come from FEP.
       
   126 // (other items were commented in a header).
       
   127 // -----------------------------------------------------------------------------
       
   128 //
       
   129 void CPluginFepManagerBase::HandleCommandL(TInt aCommandId,TInt aParam)
       
   130     {
       
   131     switch ( aCommandId )
       
   132         {
       
   133         case ECmdPenInputRange:
       
   134             {
       
   135             iHkbMode = aParam;
       
   136             }
       
   137             break;
       
   138         case ECmdPenInputPermittedRange:
       
   139             {
       
   140             iLastCase = ECaseInvalide;
       
   141             SetLayoutPermitedRanges( aParam );
       
   142             }
       
   143             break;
       
   144         case ECmdPenInputEditorState:
       
   145             {
       
   146             CAknEdwinState* state = 
       
   147                 reinterpret_cast<CAknEdwinState*>( aParam );
       
   148             SetLayoutRange( state );
       
   149             }
       
   150             break;
       
   151         case ECmdPenInputSetWindowPos:
       
   152             {
       
   153             TRect* rect = reinterpret_cast<TRect*>( aParam );
       
   154             ASSERT( rect );
       
   155             SetLayoutPosition( *rect );
       
   156             }
       
   157             break;
       
   158         case ECmdPenInputCaseMode:
       
   159             //if( aParam != iLastCase )
       
   160                 {
       
   161                 SendCommandToServer( ECmdPenInputCase, aParam );
       
   162                 iLastCase = aParam;
       
   163                 }
       
   164             break;
       
   165         case ECmdPenInputEditorCustomNumericKeyMap:
       
   166             {
       
   167             TDesC* res = (TDesC*)aParam;
       
   168             TPtrC8 param;
       
   169             param.Set((TUint8*)res->Ptr(), res->Size());
       
   170             SendCommandToServer( aCommandId, param ); 
       
   171             SetNumberModeKeyMappingL
       
   172                 ( ( TAknEditorNumericKeymap )EKeymapFromResource );                   
       
   173             }
       
   174             break;
       
   175         case ECmdPenInputSuggestRange:
       
   176             iSuggestedRange = aParam;
       
   177             if( iSuggestedRange == ERangeAccent )
       
   178                 {
       
   179                 iSuggestedRange = ERangeEnglish;
       
   180                 }
       
   181             break;
       
   182         case ECmdPenInputSendEditorTextAndCurPos:
       
   183             {
       
   184             TFepInputContextFieldData* pIcfData = 
       
   185                 reinterpret_cast<TFepInputContextFieldData*>( aParam );
       
   186             TInt dataSize = sizeof( TFepInputContextFieldData );
       
   187             TInt textSize = pIcfData->iText.Size();
       
   188             
       
   189 			HBufC8* buf = HBufC8::NewLC(dataSize + textSize + 2*sizeof(TInt));
       
   190 			TPtr8 bufPtr = buf->Des();
       
   191 			
       
   192 			RDesWriteStream writeStream;
       
   193 			writeStream.Open(bufPtr);
       
   194 			CleanupClosePushL(writeStream);
       
   195 			
       
   196 			writeStream.WriteInt32L(dataSize);
       
   197 			writeStream.WriteInt32L(textSize);
       
   198 			
       
   199 			const TUint8* pData = reinterpret_cast<const TUint8*>( pIcfData );
       
   200 			writeStream.WriteL( pData, dataSize );
       
   201         		
       
   202     		const TUint8* pText = reinterpret_cast<const TUint8*>( pIcfData->iText.Ptr() );
       
   203 		    writeStream.WriteL( pText, textSize );
       
   204 		    
       
   205             writeStream.CommitL();
       
   206         
       
   207             SendCommandToServer( aCommandId, bufPtr );
       
   208     
       
   209 			CleanupStack::PopAndDestroy(&writeStream);
       
   210 			CleanupStack::PopAndDestroy(buf);
       
   211             }
       
   212             break;
       
   213         case ECmdPenInputFingerMatchList:
       
   214             {
       
   215             TFepITICandidateList* pCanData = reinterpret_cast<TFepITICandidateList*>(aParam);
       
   216             const RArray<TPtrC>* listArray = pCanData->iItemArray2;
       
   217             TInt count = listArray->Count();
       
   218 
       
   219             TInt transferSize = 3 * sizeof(TInt);
       
   220             RArray<TInt> sizeArray;
       
   221             for (TInt i = 0; i < count; i++)
       
   222                 {
       
   223 				TInt size = (*listArray)[i].Size();
       
   224                 sizeArray.Append(size);
       
   225                 transferSize += size + sizeof(TInt);
       
   226                 }
       
   227 
       
   228             HBufC8* buf = HBufC8::NewLC(transferSize);
       
   229             TPtr8 bufPtr = buf->Des();
       
   230 
       
   231             RDesWriteStream writeStream;
       
   232             writeStream.Open(bufPtr);
       
   233             CleanupClosePushL(writeStream);
       
   234 
       
   235             writeStream.WriteInt32L(count);
       
   236             writeStream.WriteInt32L(transferSize);
       
   237             writeStream.WriteInt32L(pCanData->iLangCode);
       
   238 
       
   239             for (TInt i = 0; i < count; i++)
       
   240                 {
       
   241                 writeStream.WriteInt32L(sizeArray[i]);
       
   242                 const TUint16* piData = (*listArray)[i].Ptr();
       
   243                 writeStream.WriteL(piData, sizeArray[i] / 2);
       
   244                 }
       
   245 			
       
   246             writeStream.CommitL();
       
   247         
       
   248             SendCommandToServer( aCommandId, bufPtr );
       
   249 
       
   250             sizeArray.Close();    
       
   251 			CleanupStack::PopAndDestroy(&writeStream);
       
   252 			CleanupStack::PopAndDestroy(buf);
       
   253             
       
   254             }
       
   255             break;
       
   256         case ECmdPenInputSetPromptText:
       
   257             {
       
   258             TFepPromptText* pPromptData = 
       
   259                 reinterpret_cast<TFepPromptText*>( aParam );
       
   260                 
       
   261             TInt dataSize = sizeof( TFepPromptText );
       
   262             TInt textSize = 0;
       
   263             
       
   264             if (pPromptData->iText.Length())
       
   265                 {
       
   266                 textSize = pPromptData->iText.Size();
       
   267                 }
       
   268             
       
   269 			HBufC8* buf = HBufC8::NewLC(dataSize + textSize + 2*sizeof(TInt));
       
   270 			TPtr8 bufPtr = buf->Des();
       
   271 			
       
   272 			RDesWriteStream writeStream;
       
   273 			writeStream.Open(bufPtr);
       
   274 			CleanupClosePushL(writeStream);
       
   275 			
       
   276 			writeStream.WriteInt32L(dataSize);
       
   277 			writeStream.WriteInt32L(textSize);
       
   278 			
       
   279 			const TUint8* pData = reinterpret_cast<const TUint8*>( pPromptData );
       
   280 			writeStream.WriteL( pData, dataSize );
       
   281         	
       
   282         	if (textSize != 0)
       
   283         	    {
       
   284                 const TUint16* pText = pPromptData->iText.Ptr();
       
   285     		    writeStream.WriteL( pText, textSize/2 );
       
   286         	    }
       
   287 		    
       
   288             writeStream.CommitL();
       
   289         
       
   290             SendCommandToServer( aCommandId, bufPtr );
       
   291     
       
   292 			CleanupStack::PopAndDestroy(&writeStream);
       
   293 			CleanupStack::PopAndDestroy(buf);
       
   294             }
       
   295             break;
       
   296         case ECmdPeninputSpellICFDisplayContent:
       
   297         	{
       
   298         	TFepSpellICFDisplayContent* pContent = 
       
   299         			reinterpret_cast<TFepSpellICFDisplayContent*>( aParam );
       
   300         	
       
   301             TInt dataSize = sizeof( TFepSpellICFDisplayContent );
       
   302             TInt icfTextSize = pContent->iICFText.Size();
       
   303             TInt promptTextSize = pContent->iPromptText.Size();
       
   304         	
       
   305         	HBufC8* buf = HBufC8::NewLC( dataSize + 
       
   306         			icfTextSize + promptTextSize + 3 * sizeof(TInt));
       
   307         	TPtr8 bufPtr = buf->Des();
       
   308         				
       
   309 			RDesWriteStream writeStream;
       
   310 			writeStream.Open( bufPtr );
       
   311 			CleanupClosePushL(writeStream);
       
   312 			
       
   313 			writeStream.WriteInt32L(dataSize);
       
   314 			writeStream.WriteInt32L(icfTextSize);
       
   315 			writeStream.WriteInt32L(promptTextSize);
       
   316 			
       
   317 			const TUint8* pData = reinterpret_cast<const TUint8*>( pContent );
       
   318 			writeStream.WriteL( pData, dataSize );
       
   319 			
       
   320 			if ( icfTextSize != 0 )
       
   321 				{
       
   322 				const TUint16* pIcfText = pContent->iICFText.Ptr();
       
   323 				writeStream.WriteL( pIcfText, icfTextSize/2 );
       
   324 				}
       
   325 			
       
   326 			if ( promptTextSize != 0 )
       
   327 				{
       
   328 				const TUint16* pPromptText = pContent->iPromptText.Ptr();
       
   329 				writeStream.WriteL( pPromptText, promptTextSize/2 );
       
   330 				}
       
   331 			
       
   332 			writeStream.CommitL();
       
   333 		
       
   334 			SendCommandToServer( aCommandId, bufPtr );
       
   335 	
       
   336 			CleanupStack::PopAndDestroy(&writeStream);
       
   337 			CleanupStack::PopAndDestroy(buf);
       
   338         	}
       
   339         	break;
       
   340         case ECmdPenInputFingerMatchIndicator:
       
   341             {
       
   342             TFepIndicatorInfo* pIndicatorData = 
       
   343                 reinterpret_cast<TFepIndicatorInfo*>( aParam );
       
   344             
       
   345 			HBufC8* buf = HBufC8::NewLC(4 * sizeof(TInt));
       
   346 			TPtr8 bufPtr = buf->Des();
       
   347 			
       
   348 			RDesWriteStream writeStream;
       
   349 			writeStream.Open(bufPtr);
       
   350 			CleanupClosePushL(writeStream);
       
   351 			
       
   352             writeStream.WriteInt32L(pIndicatorData->iIndicatorImgID);
       
   353             writeStream.WriteInt32L(pIndicatorData->iIndicatorMaskID);
       
   354             writeStream.WriteInt32L(pIndicatorData->iIndicatorTextImgID);
       
   355             writeStream.WriteInt32L(pIndicatorData->iIndicatorTextMaskID);
       
   356 		    
       
   357             writeStream.CommitL();
       
   358         
       
   359             SendCommandToServer( aCommandId, bufPtr );
       
   360     
       
   361 			CleanupStack::PopAndDestroy(&writeStream);
       
   362 			CleanupStack::PopAndDestroy(buf);			
       
   363             }
       
   364             break;
       
   365         case ECmdPenInputSendEditMenuData:
       
   366             {
       
   367             TInt* commandList = reinterpret_cast<TInt*>( aParam );
       
   368             
       
   369             HBufC8* buf = HBufC8::NewLC( (*commandList+1) * sizeof(TInt));
       
   370             TPtr8 bufPtr = buf->Des();
       
   371       
       
   372             RDesWriteStream writeStream;
       
   373             writeStream.Open(bufPtr);
       
   374             CleanupClosePushL(writeStream);
       
   375       
       
   376             writeStream.WriteInt32L(*commandList);
       
   377             for (TInt i=1;i<=*commandList;i++)
       
   378                 {
       
   379                 writeStream.WriteInt32L(*(commandList+i));
       
   380                 }
       
   381         
       
   382             writeStream.CommitL();  
       
   383             
       
   384             SendCommandToServer( aCommandId, bufPtr );
       
   385             
       
   386             CleanupStack::PopAndDestroy(&writeStream);
       
   387             CleanupStack::PopAndDestroy(buf);                          
       
   388             }
       
   389             break;
       
   390             
       
   391         case ECmdPenInputSymbolOfHardKeyOne:
       
   392             {
       
   393             TFepSymbolOfHardwareOne* pIndicatorData = 
       
   394                 reinterpret_cast<TFepSymbolOfHardwareOne*>( aParam );
       
   395             
       
   396             HBufC8* buf = HBufC8::NewLC(3 * sizeof(TInt));
       
   397             TPtr8 bufPtr = buf->Des();
       
   398             
       
   399             RDesWriteStream writeStream;
       
   400             writeStream.Open(bufPtr);
       
   401             CleanupClosePushL(writeStream);
       
   402             
       
   403             writeStream.WriteInt32L(pIndicatorData->iSymbol1);
       
   404             writeStream.WriteInt32L(pIndicatorData->iSymbol2);
       
   405             writeStream.WriteInt32L(pIndicatorData->iSymbol3);
       
   406             
       
   407             writeStream.CommitL();
       
   408         
       
   409             SendCommandToServer( aCommandId, bufPtr );
       
   410     
       
   411             CleanupStack::PopAndDestroy(&writeStream);
       
   412             CleanupStack::PopAndDestroy(buf);           
       
   413             }
       
   414             break;
       
   415         default:
       
   416             SendCommandToServer( aCommandId, aParam );
       
   417             break;
       
   418         }
       
   419     }
       
   420 
       
   421 // -----------------------------------------------------------------------------
       
   422 // CPluginFepManagerBase::CloseUI
       
   423 // Close plugin layout UI.
       
   424 // (other items were commented in a header).
       
   425 // -----------------------------------------------------------------------------
       
   426 //
       
   427 void CPluginFepManagerBase::CloseUI()
       
   428     {
       
   429     if (iPenInputServer->IsVisible())
       
   430 	    {
       
   431     	iPenInputServer->ActivateLayout( EFalse ); 
       
   432 		}
       
   433     }
       
   434 
       
   435 // -----------------------------------------------------------------------------
       
   436 // CPluginFepManagerBase::ActivateUI
       
   437 // Activate plugin layout UI.
       
   438 // (other items were commented in a header).
       
   439 // -----------------------------------------------------------------------------
       
   440 //
       
   441 void CPluginFepManagerBase::ActivateUI()
       
   442     {
       
   443     if(iPenInputServer)
       
   444         {
       
   445         iPenInputServer->ActivateLayout( ETrue ); 
       
   446         }  
       
   447     }
       
   448 
       
   449 // -----------------------------------------------------------------------------
       
   450 // CPluginFepManagerBase::EditorMaxLength
       
   451 // Get max text length of layout UI ICF control.
       
   452 // (other items were commented in a header).
       
   453 // -----------------------------------------------------------------------------
       
   454 //
       
   455 TInt CPluginFepManagerBase::EditorMaxLength()
       
   456     {
       
   457     return iMaxEditorLength;
       
   458     }
       
   459 
       
   460 // -----------------------------------------------------------------------------
       
   461 // CPluginFepManagerBase::SizeChanged
       
   462 // Handle screen size changed.
       
   463 // (other items were commented in a header).
       
   464 // -----------------------------------------------------------------------------
       
   465 //
       
   466 void CPluginFepManagerBase::ResourceChanged(TInt aType)
       
   467     {
       
   468     iPenInputServer->ResourceChanged(aType);
       
   469     }
       
   470 
       
   471 // -----------------------------------------------------------------------------
       
   472 // CPluginFepManagerBase::SetNextFepUI
       
   473 // Set underlining UI.
       
   474 // (other items were commented in a header).
       
   475 // -----------------------------------------------------------------------------
       
   476 //
       
   477 void CPluginFepManagerBase::SetNextFepUI( MAknFepManagerInterface* aNextUi )
       
   478     {
       
   479     iHkbUi = aNextUi;    
       
   480     }
       
   481 
       
   482 // -----------------------------------------------------------------------------
       
   483 // CPluginFepManagerBase::SupportLanguage
       
   484 // Get support language in sepecfied mode.
       
   485 // (other items were commented in a header).
       
   486 // -----------------------------------------------------------------------------
       
   487 //
       
   488 TInt CPluginFepManagerBase::SupportLanguage( TInt /*aMode*/ ) const
       
   489     {
       
   490     return iLanguage;
       
   491     }
       
   492 
       
   493 // -----------------------------------------------------------------------------
       
   494 // CPluginFepManagerBase::SetInputLanguageL
       
   495 // Set current language.
       
   496 // (other items were commented in a header).
       
   497 // -----------------------------------------------------------------------------
       
   498 //
       
   499 void CPluginFepManagerBase::SetInputLanguageL( TLanguage aLanguage )
       
   500     {
       
   501     iLanguage = aLanguage;
       
   502     //maybe language check is needed.
       
   503     TInt lang = (TInt)aLanguage;
       
   504     ASSERT( lang >=0 );
       
   505     SendCommandToServer( ECmdPenInputLanguage, lang );       
       
   506     }
       
   507 
       
   508 // -----------------------------------------------------------------------------
       
   509 // CPluginFepManagerBase::SetFepAwareEditorText
       
   510 // Set editor text and cursor information to layout UI ICF control.
       
   511 // (other items were commented in a header).
       
   512 // -----------------------------------------------------------------------------
       
   513 //
       
   514 void CPluginFepManagerBase::SetFepAwareEditorText( 
       
   515     const TFepInputContextFieldData& /*aIcfData*/ )
       
   516     {
       
   517     }
       
   518     
       
   519 // -----------------------------------------------------------------------------
       
   520 // CPluginFepManagerBase::SetMode
       
   521 // Set layout UI mode.
       
   522 // (other items were commented in a header).
       
   523 // -----------------------------------------------------------------------------
       
   524 //
       
   525 #ifdef RD_INTELLIGENT_TEXT_INPUT          
       
   526 void CPluginFepManagerBase::SetMode( TInt aMode, TBool aPredictive, 
       
   527                                      TBool aQwertyInputMode, TInt aKeyboardType)
       
   528 #else
       
   529 void CPluginFepManagerBase::SetMode( TInt aMode, TBool aPredictive, 
       
   530                                      TBool aQwertyInputMode )
       
   531 #endif 
       
   532     {
       
   533     iHkbUi->SetMode( aMode, aPredictive, aQwertyInputMode );
       
   534     }
       
   535 
       
   536 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   537     TBool CPluginFepManagerBase::IsValidFnKeyPress() const
       
   538     {
       
   539     return EFalse;
       
   540     }
       
   541     TBool CPluginFepManagerBase::IsValidLongChrKeyPress() const
       
   542     {
       
   543     return EFalse;
       
   544     }
       
   545 #endif
       
   546 // -----------------------------------------------------------------------------
       
   547 // CPluginFepManagerBase::SetMode
       
   548 // Set layout UI current case.
       
   549 // (other items were commented in a header).
       
   550 // -----------------------------------------------------------------------------
       
   551 //
       
   552 void CPluginFepManagerBase::SetCase( TCase aCase )
       
   553     {
       
   554     iHkbUi->SetCase( aCase );
       
   555     }
       
   556 
       
   557 // -----------------------------------------------------------------------------
       
   558 // CPluginFepManagerBase::ExpireMultitapTimer
       
   559 // Compatibile with HKB UI.
       
   560 // (other items were commented in a header).
       
   561 // -----------------------------------------------------------------------------
       
   562 //
       
   563 void CPluginFepManagerBase::ExpireMultitapTimer()
       
   564     {
       
   565     }
       
   566 
       
   567 // -----------------------------------------------------------------------------
       
   568 // CPluginFepManagerBase::IsValidNumericLongKeyPress
       
   569 // Compatibile with HKB UI.
       
   570 // (other items were commented in a header).
       
   571 // -----------------------------------------------------------------------------
       
   572 //
       
   573 TBool CPluginFepManagerBase::IsValidNumericLongKeyPress( TInt /*aKey*/ ) const
       
   574     {
       
   575     return EFalse;
       
   576     }
       
   577 
       
   578 // -----------------------------------------------------------------------------
       
   579 // CPluginFepManagerBase::AddTextToUserDictionaryL
       
   580 // Compatibile with HKB UI.
       
   581 // (other items were commented in a header).
       
   582 // -----------------------------------------------------------------------------
       
   583 //
       
   584 void CPluginFepManagerBase::AddTextToUserDictionaryL( const TDesC& /*aText*/ )
       
   585     {
       
   586     }
       
   587        
       
   588 // -----------------------------------------------------------------------------
       
   589 // CPluginFepManagerBase::GetFormatOfFepInlineText
       
   590 // Compatibile with HKB UI.
       
   591 // (other items were commented in a header).
       
   592 // -----------------------------------------------------------------------------
       
   593 //
       
   594 void CPluginFepManagerBase::GetFormatOfFepInlineText( 
       
   595                                 TCharFormat& /*aFormat*/, 
       
   596                                 TInt& /*aNumberOfCharactersWithSameFormat*/, 
       
   597                                 TInt /*aPositionOfCharacter*/ ) const
       
   598     {
       
   599     }
       
   600 
       
   601 // -----------------------------------------------------------------------------
       
   602 // CPluginFepManagerBase::IsValidShiftKeyPress
       
   603 // Compatibile with HKB UI.
       
   604 // (other items were commented in a header).
       
   605 // -----------------------------------------------------------------------------
       
   606 //
       
   607 TBool CPluginFepManagerBase::IsValidShiftKeyPress() const
       
   608     {
       
   609     return EFalse;
       
   610     }
       
   611 
       
   612 // -----------------------------------------------------------------------------
       
   613 // CPluginFepManagerBase::SetEditorContext
       
   614 // Compatibile with HKB UI.
       
   615 // (other items were commented in a header).
       
   616 // -----------------------------------------------------------------------------
       
   617 //
       
   618 void CPluginFepManagerBase::SetEditorContext( TInt /*aContext*/ )
       
   619     {
       
   620     }
       
   621 
       
   622 // -----------------------------------------------------------------------------
       
   623 // CPluginFepManagerBase::SetEditorContext
       
   624 // Compatibile with HKB UI.
       
   625 // (other items were commented in a header).
       
   626 // -----------------------------------------------------------------------------
       
   627 //
       
   628 void CPluginFepManagerBase::SetStarKeyFlag( TBool /*aSet*/ )
       
   629     {
       
   630     }
       
   631 
       
   632 // -----------------------------------------------------------------------------
       
   633 // CPluginFepManagerBase::CPluginFepManagerBase
       
   634 // C++ default constructor.
       
   635 // (other items were commented in a header).
       
   636 // -----------------------------------------------------------------------------
       
   637 //
       
   638 CPluginFepManagerBase::CPluginFepManagerBase( CPenInputImePluginItut& aOwner,
       
   639                                              RPeninputServer* aPenInputServer )
       
   640     :iOwner( aOwner ), iPenInputServer( aPenInputServer )
       
   641     {
       
   642     iSuggestedRange = ERangeInvalid;
       
   643     }
       
   644 
       
   645 // -----------------------------------------------------------------------------
       
   646 // CPluginFepManagerBase::BaseConstructL
       
   647 // Symbian 2nd phase constructor.
       
   648 // (other items were commented in a header).
       
   649 // -----------------------------------------------------------------------------
       
   650 //
       
   651 void CPluginFepManagerBase::BaseConstructL()
       
   652     {
       
   653     iRepository = CRepository::NewL( KCRUidAknFep );
       
   654     }
       
   655     
       
   656 // -----------------------------------------------------------------------------
       
   657 // CPluginFepManagerBase::SetLayoutPermitedRanges
       
   658 // Set layout permited ranges.
       
   659 // (other items were commented in a header).
       
   660 // -----------------------------------------------------------------------------
       
   661 //
       
   662 void CPluginFepManagerBase::SetLayoutPermitedRanges( TInt aPermittedMode )
       
   663     {
       
   664     // Not derived from edwin
       
   665 	SendCommandToServer( ECmdPenInputPermittedRange, aPermittedMode == EAknEditorNumericInputMode  );
       
   666 	
       
   667 	/*if ( aPermittedMode == EAknEditorNumericInputMode ) 
       
   668         {
       
   669         iPermittedRange = ERangeNumber;         
       
   670         }
       
   671     else if ( aPermittedMode & EAknEditorTextInputMode )
       
   672         {
       
   673         // Derived from edwin and EAknEditorTextInputMode
       
   674         iPermittedRange = ERangeNative | 
       
   675                           ERangeNumber | 
       
   676                           ERangeEnglish | 
       
   677                           ERangeSymbol;
       
   678         }
       
   679     else if ( aPermittedMode & EAknEditorSecretAlphaInputMode ) 
       
   680         {
       
   681         // Derived from EAknEditorSecretAlphaInputMode 
       
   682         iPermittedRange = ERangeNumber |
       
   683                           ERangeEnglish | 
       
   684                           ERangeSymbol;        
       
   685         }
       
   686     else
       
   687         {
       
   688         iPermittedRange = ERangeNative | 
       
   689                           ERangeNumber | 
       
   690                           ERangeEnglish | 
       
   691                           ERangeSymbol;
       
   692         }*/
       
   693     }
       
   694     
       
   695 // -----------------------------------------------------------------------------
       
   696 // CPluginFepManagerBase::SetLayoutRange
       
   697 // Set layout primary range.
       
   698 // (other items were commented in a header).
       
   699 // -----------------------------------------------------------------------------
       
   700 //
       
   701 void CPluginFepManagerBase::SetLayoutRange( 
       
   702     const CAknEdwinState* aEditorState )
       
   703     {
       
   704     if ( aEditorState )
       
   705 	    {
       
   706 	    SendCommandToServer( ECmdPenInputRange, 
       
   707 	                         aEditorState->Flags() & EAknEditorFlagLatinInputModesOnly ); 
       
   708 	    }
       
   709     }
       
   710     
       
   711 // -----------------------------------------------------------------------------
       
   712 // CPluginFepManagerBase::SendCommandToServer
       
   713 // Send command to pen input server utility function.
       
   714 // (other items were commented in a header).
       
   715 // -----------------------------------------------------------------------------
       
   716 //
       
   717 void CPluginFepManagerBase::SendCommandToServer( TInt aCommandId )
       
   718     {
       
   719     iPenInputServer->HandleCommand( aCommandId );
       
   720     }
       
   721 
       
   722 // -----------------------------------------------------------------------------
       
   723 // CPluginFepManagerBase::SendCommandToServer
       
   724 // Send command to pen input server utility function.
       
   725 // (other items were commented in a header).
       
   726 // -----------------------------------------------------------------------------
       
   727 //
       
   728 void CPluginFepManagerBase::SendCommandToServer( TInt aCommandId, TInt aParam )
       
   729     {
       
   730     TBuf8<sizeof(TInt)> buf;
       
   731     buf.Append( (TUint8*)&aParam, sizeof(TInt) );    
       
   732     SendCommandToServer( aCommandId, buf );
       
   733     }
       
   734 
       
   735 // -----------------------------------------------------------------------------
       
   736 // CPluginFepManagerBase::SendCommandToServer
       
   737 // Send command to pen input server utility function.
       
   738 // (other items were commented in a header).
       
   739 // -----------------------------------------------------------------------------
       
   740 //
       
   741 void CPluginFepManagerBase::SendCommandToServer( TInt aCommandId, 
       
   742                                                  const TDesC8& aParam )
       
   743     {
       
   744     iPenInputServer->HandleCommand( aCommandId, aParam );        
       
   745     }
       
   746 
       
   747 // -----------------------------------------------------------------------------
       
   748 // CPluginFepManagerBase::LayoutLastUsedRange
       
   749 // Get layout UI last used range.
       
   750 // (other items were commented in a header).
       
   751 // -----------------------------------------------------------------------------
       
   752 //
       
   753 TInt CPluginFepManagerBase::LayoutLastUsedRange()
       
   754     {
       
   755     TInt value = 0;
       
   756     if ( iRepository )
       
   757         {
       
   758         iRepository->Get( KAknFepLastUsedRange, value );
       
   759         }
       
   760         
       
   761     return value;
       
   762     }
       
   763 
       
   764 // -----------------------------------------------------------------------------
       
   765 // CPluginFepManagerBase::SetLayoutPosition
       
   766 // Set layout UI position.
       
   767 // (other items were commented in a header).
       
   768 // -----------------------------------------------------------------------------
       
   769 //
       
   770 void CPluginFepManagerBase::SetLayoutPosition( const TRect& pParam )
       
   771     {
       
   772     TBuf8<sizeof( TRect )> buf;
       
   773     buf.Append( (TUint8*)&pParam, sizeof( pParam ) );
       
   774     
       
   775     SendCommandToServer( ECmdPenInputSetWindowPos, buf );
       
   776     }
       
   777 
       
   778 // -----------------------------------------------------------------------------
       
   779 // CPluginFepManagerBase::GetLocalLanguage
       
   780 // (other items were commented in a header).
       
   781 // -----------------------------------------------------------------------------
       
   782 //
       
   783 TLanguage CPluginFepManagerBase::GetLocalLanguage( 
       
   784     const CAknEdwinState* aEditorState ) const
       
   785     {
       
   786     TLanguage language = ELangTest;
       
   787     // Check for a local language override
       
   788     if ( aEditorState )
       
   789         {
       
   790         TInt aknEditorFlags = aEditorState->Flags()	;
       
   791         if ( aknEditorFlags & EAknEditorFlagLatinInputModesOnly )
       
   792             {
       
   793             language = ELangEnglish;
       
   794             }
       
   795         else
       
   796             {
       
   797             language = aEditorState->LocalLanguage();
       
   798             }
       
   799         }
       
   800 
       
   801     return language;
       
   802     }
       
   803 
       
   804  // End Of File