fep/aknfep/peninputplugins/peninputimepluginitut/src/pluginfepmanagerbase.cpp
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     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             TFepInputAllCandidates* pCanData = reinterpret_cast<TFepInputAllCandidates*>(aParam);
       
   216             TInt count = (*pCanData).iCandidates.Count();
       
   217 
       
   218             TInt transferSize = 2 * sizeof(TInt);
       
   219             RArray<TInt> sizeArray;
       
   220             for (TInt i = 0; i < count; i++)
       
   221                 {
       
   222                 sizeArray.Append((*pCanData).iCandidates[i].Size());
       
   223                 transferSize += sizeArray[i] + sizeof(TInt);
       
   224                 }
       
   225 
       
   226             HBufC8* buf = HBufC8::NewLC(transferSize);
       
   227             TPtr8 bufPtr = buf->Des();
       
   228 
       
   229             RDesWriteStream writeStream;
       
   230             writeStream.Open(bufPtr);
       
   231             CleanupClosePushL(writeStream);
       
   232 
       
   233             writeStream.WriteInt32L(count);
       
   234             writeStream.WriteInt32L(transferSize);
       
   235 
       
   236             for (TInt i = 0; i < count; i++)
       
   237                 {
       
   238                 writeStream.WriteInt32L(sizeArray[i]);
       
   239                 const TUint16* piData = (*pCanData).iCandidates[i].Ptr();
       
   240                 writeStream.WriteL(piData, sizeArray[i]/2);
       
   241                 }
       
   242 			
       
   243             writeStream.CommitL();
       
   244         
       
   245             SendCommandToServer( aCommandId, bufPtr );
       
   246 
       
   247             sizeArray.Close();    
       
   248 			CleanupStack::PopAndDestroy(&writeStream);
       
   249 			CleanupStack::PopAndDestroy(buf);
       
   250             
       
   251             }
       
   252             break;
       
   253         case ECmdPenInputSetPromptText:
       
   254             {
       
   255             TFepPromptText* pPromptData = 
       
   256                 reinterpret_cast<TFepPromptText*>( aParam );
       
   257                 
       
   258             TInt dataSize = sizeof( TFepPromptText );
       
   259             TInt textSize = 0;
       
   260             
       
   261             if (pPromptData->iText.Length())
       
   262                 {
       
   263                 textSize = pPromptData->iText.Size();
       
   264                 }
       
   265             
       
   266 			HBufC8* buf = HBufC8::NewLC(dataSize + textSize + 2*sizeof(TInt));
       
   267 			TPtr8 bufPtr = buf->Des();
       
   268 			
       
   269 			RDesWriteStream writeStream;
       
   270 			writeStream.Open(bufPtr);
       
   271 			CleanupClosePushL(writeStream);
       
   272 			
       
   273 			writeStream.WriteInt32L(dataSize);
       
   274 			writeStream.WriteInt32L(textSize);
       
   275 			
       
   276 			const TUint8* pData = reinterpret_cast<const TUint8*>( pPromptData );
       
   277 			writeStream.WriteL( pData, dataSize );
       
   278         	
       
   279         	if (textSize != 0)
       
   280         	    {
       
   281                 const TUint16* pText = pPromptData->iText.Ptr();
       
   282     		    writeStream.WriteL( pText, textSize/2 );
       
   283         	    }
       
   284 		    
       
   285             writeStream.CommitL();
       
   286         
       
   287             SendCommandToServer( aCommandId, bufPtr );
       
   288     
       
   289 			CleanupStack::PopAndDestroy(&writeStream);
       
   290 			CleanupStack::PopAndDestroy(buf);
       
   291             }
       
   292             break;
       
   293         case ECmdPenInputFingerMatchIndicator:
       
   294             {
       
   295             TFepIndicatorInfo* pIndicatorData = 
       
   296                 reinterpret_cast<TFepIndicatorInfo*>( aParam );
       
   297             
       
   298 			HBufC8* buf = HBufC8::NewLC(4 * sizeof(TInt));
       
   299 			TPtr8 bufPtr = buf->Des();
       
   300 			
       
   301 			RDesWriteStream writeStream;
       
   302 			writeStream.Open(bufPtr);
       
   303 			CleanupClosePushL(writeStream);
       
   304 			
       
   305             writeStream.WriteInt32L(pIndicatorData->iIndicatorImgID);
       
   306             writeStream.WriteInt32L(pIndicatorData->iIndicatorMaskID);
       
   307             writeStream.WriteInt32L(pIndicatorData->iIndicatorTextImgID);
       
   308             writeStream.WriteInt32L(pIndicatorData->iIndicatorTextMaskID);
       
   309 		    
       
   310             writeStream.CommitL();
       
   311         
       
   312             SendCommandToServer( aCommandId, bufPtr );
       
   313     
       
   314 			CleanupStack::PopAndDestroy(&writeStream);
       
   315 			CleanupStack::PopAndDestroy(buf);			
       
   316             }
       
   317             break;
       
   318         case ECmdPenInputSendEditMenuData:
       
   319             {
       
   320             TInt* commandList = reinterpret_cast<TInt*>( aParam );
       
   321             
       
   322             HBufC8* buf = HBufC8::NewLC( (*commandList+1) * sizeof(TInt));
       
   323             TPtr8 bufPtr = buf->Des();
       
   324       
       
   325             RDesWriteStream writeStream;
       
   326             writeStream.Open(bufPtr);
       
   327             CleanupClosePushL(writeStream);
       
   328       
       
   329             writeStream.WriteInt32L(*commandList);
       
   330             for (TInt i=1;i<=*commandList;i++)
       
   331                 {
       
   332                 writeStream.WriteInt32L(*(commandList+i));
       
   333                 }
       
   334         
       
   335             writeStream.CommitL();  
       
   336             
       
   337             SendCommandToServer( aCommandId, bufPtr );
       
   338             
       
   339             CleanupStack::PopAndDestroy(&writeStream);
       
   340             CleanupStack::PopAndDestroy(buf);                          
       
   341             }
       
   342             break;
       
   343             
       
   344         case ECmdPenInputSymbolOfHardKeyOne:
       
   345             {
       
   346             TFepSymbolOfHardwareOne* pIndicatorData = 
       
   347                 reinterpret_cast<TFepSymbolOfHardwareOne*>( aParam );
       
   348             
       
   349             HBufC8* buf = HBufC8::NewLC(3 * sizeof(TInt));
       
   350             TPtr8 bufPtr = buf->Des();
       
   351             
       
   352             RDesWriteStream writeStream;
       
   353             writeStream.Open(bufPtr);
       
   354             CleanupClosePushL(writeStream);
       
   355             
       
   356             writeStream.WriteInt32L(pIndicatorData->iSymbol1);
       
   357             writeStream.WriteInt32L(pIndicatorData->iSymbol2);
       
   358             writeStream.WriteInt32L(pIndicatorData->iSymbol3);
       
   359             
       
   360             writeStream.CommitL();
       
   361         
       
   362             SendCommandToServer( aCommandId, bufPtr );
       
   363     
       
   364             CleanupStack::PopAndDestroy(&writeStream);
       
   365             CleanupStack::PopAndDestroy(buf);           
       
   366             }
       
   367             break;
       
   368         default:
       
   369             SendCommandToServer( aCommandId, aParam );
       
   370             break;
       
   371         }
       
   372     }
       
   373 
       
   374 // -----------------------------------------------------------------------------
       
   375 // CPluginFepManagerBase::CloseUI
       
   376 // Close plugin layout UI.
       
   377 // (other items were commented in a header).
       
   378 // -----------------------------------------------------------------------------
       
   379 //
       
   380 void CPluginFepManagerBase::CloseUI()
       
   381     {
       
   382     iPenInputServer->ActivateLayout( EFalse ); 
       
   383     }
       
   384 
       
   385 // -----------------------------------------------------------------------------
       
   386 // CPluginFepManagerBase::ActivateUI
       
   387 // Activate plugin layout UI.
       
   388 // (other items were commented in a header).
       
   389 // -----------------------------------------------------------------------------
       
   390 //
       
   391 void CPluginFepManagerBase::ActivateUI()
       
   392     {
       
   393     iPenInputServer->ActivateLayout( ETrue );    
       
   394     }
       
   395 
       
   396 // -----------------------------------------------------------------------------
       
   397 // CPluginFepManagerBase::EditorMaxLength
       
   398 // Get max text length of layout UI ICF control.
       
   399 // (other items were commented in a header).
       
   400 // -----------------------------------------------------------------------------
       
   401 //
       
   402 TInt CPluginFepManagerBase::EditorMaxLength()
       
   403     {
       
   404     return iMaxEditorLength;
       
   405     }
       
   406 
       
   407 // -----------------------------------------------------------------------------
       
   408 // CPluginFepManagerBase::SizeChanged
       
   409 // Handle screen size changed.
       
   410 // (other items were commented in a header).
       
   411 // -----------------------------------------------------------------------------
       
   412 //
       
   413 void CPluginFepManagerBase::ResourceChanged(TInt aType)
       
   414     {
       
   415     iPenInputServer->ResourceChanged(aType);
       
   416     }
       
   417 
       
   418 // -----------------------------------------------------------------------------
       
   419 // CPluginFepManagerBase::SetNextFepUI
       
   420 // Set underlining UI.
       
   421 // (other items were commented in a header).
       
   422 // -----------------------------------------------------------------------------
       
   423 //
       
   424 void CPluginFepManagerBase::SetNextFepUI( MAknFepManagerInterface* aNextUi )
       
   425     {
       
   426     iHkbUi = aNextUi;    
       
   427     }
       
   428 
       
   429 // -----------------------------------------------------------------------------
       
   430 // CPluginFepManagerBase::SupportLanguage
       
   431 // Get support language in sepecfied mode.
       
   432 // (other items were commented in a header).
       
   433 // -----------------------------------------------------------------------------
       
   434 //
       
   435 TInt CPluginFepManagerBase::SupportLanguage( TInt /*aMode*/ ) const
       
   436     {
       
   437     return iLanguage;
       
   438     }
       
   439 
       
   440 // -----------------------------------------------------------------------------
       
   441 // CPluginFepManagerBase::SetInputLanguageL
       
   442 // Set current language.
       
   443 // (other items were commented in a header).
       
   444 // -----------------------------------------------------------------------------
       
   445 //
       
   446 void CPluginFepManagerBase::SetInputLanguageL( TLanguage aLanguage )
       
   447     {
       
   448     iLanguage = aLanguage;
       
   449     //maybe language check is needed.
       
   450     TInt lang = (TInt)aLanguage;
       
   451     ASSERT( lang >=0 );
       
   452     SendCommandToServer( ECmdPenInputLanguage, lang );       
       
   453     }
       
   454 
       
   455 // -----------------------------------------------------------------------------
       
   456 // CPluginFepManagerBase::SetFepAwareEditorText
       
   457 // Set editor text and cursor information to layout UI ICF control.
       
   458 // (other items were commented in a header).
       
   459 // -----------------------------------------------------------------------------
       
   460 //
       
   461 void CPluginFepManagerBase::SetFepAwareEditorText( 
       
   462     const TFepInputContextFieldData& /*aIcfData*/ )
       
   463     {
       
   464     }
       
   465     
       
   466 // -----------------------------------------------------------------------------
       
   467 // CPluginFepManagerBase::SetMode
       
   468 // Set layout UI mode.
       
   469 // (other items were commented in a header).
       
   470 // -----------------------------------------------------------------------------
       
   471 //
       
   472 #ifdef RD_INTELLIGENT_TEXT_INPUT          
       
   473 void CPluginFepManagerBase::SetMode( TInt aMode, TBool aPredictive, 
       
   474                                      TBool aQwertyInputMode, TInt aKeyboardType)
       
   475 #else
       
   476 void CPluginFepManagerBase::SetMode( TInt aMode, TBool aPredictive, 
       
   477                                      TBool aQwertyInputMode )
       
   478 #endif 
       
   479     {
       
   480     iHkbUi->SetMode( aMode, aPredictive, aQwertyInputMode );
       
   481     }
       
   482 
       
   483 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   484     TBool CPluginFepManagerBase::IsValidFnKeyPress() const
       
   485     {
       
   486     return EFalse;
       
   487     }
       
   488     TBool CPluginFepManagerBase::IsValidLongChrKeyPress() const
       
   489     {
       
   490     return EFalse;
       
   491     }
       
   492 #endif
       
   493 // -----------------------------------------------------------------------------
       
   494 // CPluginFepManagerBase::SetMode
       
   495 // Set layout UI current case.
       
   496 // (other items were commented in a header).
       
   497 // -----------------------------------------------------------------------------
       
   498 //
       
   499 void CPluginFepManagerBase::SetCase( TCase aCase )
       
   500     {
       
   501     iHkbUi->SetCase( aCase );
       
   502     }
       
   503 
       
   504 // -----------------------------------------------------------------------------
       
   505 // CPluginFepManagerBase::ExpireMultitapTimer
       
   506 // Compatibile with HKB UI.
       
   507 // (other items were commented in a header).
       
   508 // -----------------------------------------------------------------------------
       
   509 //
       
   510 void CPluginFepManagerBase::ExpireMultitapTimer()
       
   511     {
       
   512     }
       
   513 
       
   514 // -----------------------------------------------------------------------------
       
   515 // CPluginFepManagerBase::IsValidNumericLongKeyPress
       
   516 // Compatibile with HKB UI.
       
   517 // (other items were commented in a header).
       
   518 // -----------------------------------------------------------------------------
       
   519 //
       
   520 TBool CPluginFepManagerBase::IsValidNumericLongKeyPress( TInt /*aKey*/ ) const
       
   521     {
       
   522     return EFalse;
       
   523     }
       
   524 
       
   525 // -----------------------------------------------------------------------------
       
   526 // CPluginFepManagerBase::AddTextToUserDictionaryL
       
   527 // Compatibile with HKB UI.
       
   528 // (other items were commented in a header).
       
   529 // -----------------------------------------------------------------------------
       
   530 //
       
   531 void CPluginFepManagerBase::AddTextToUserDictionaryL( const TDesC& /*aText*/ )
       
   532     {
       
   533     }
       
   534        
       
   535 // -----------------------------------------------------------------------------
       
   536 // CPluginFepManagerBase::GetFormatOfFepInlineText
       
   537 // Compatibile with HKB UI.
       
   538 // (other items were commented in a header).
       
   539 // -----------------------------------------------------------------------------
       
   540 //
       
   541 void CPluginFepManagerBase::GetFormatOfFepInlineText( 
       
   542                                 TCharFormat& /*aFormat*/, 
       
   543                                 TInt& /*aNumberOfCharactersWithSameFormat*/, 
       
   544                                 TInt /*aPositionOfCharacter*/ ) const
       
   545     {
       
   546     }
       
   547 
       
   548 // -----------------------------------------------------------------------------
       
   549 // CPluginFepManagerBase::IsValidShiftKeyPress
       
   550 // Compatibile with HKB UI.
       
   551 // (other items were commented in a header).
       
   552 // -----------------------------------------------------------------------------
       
   553 //
       
   554 TBool CPluginFepManagerBase::IsValidShiftKeyPress() const
       
   555     {
       
   556     return EFalse;
       
   557     }
       
   558 
       
   559 // -----------------------------------------------------------------------------
       
   560 // CPluginFepManagerBase::SetEditorContext
       
   561 // Compatibile with HKB UI.
       
   562 // (other items were commented in a header).
       
   563 // -----------------------------------------------------------------------------
       
   564 //
       
   565 void CPluginFepManagerBase::SetEditorContext( TInt /*aContext*/ )
       
   566     {
       
   567     }
       
   568 
       
   569 // -----------------------------------------------------------------------------
       
   570 // CPluginFepManagerBase::SetEditorContext
       
   571 // Compatibile with HKB UI.
       
   572 // (other items were commented in a header).
       
   573 // -----------------------------------------------------------------------------
       
   574 //
       
   575 void CPluginFepManagerBase::SetStarKeyFlag( TBool /*aSet*/ )
       
   576     {
       
   577     }
       
   578 
       
   579 // -----------------------------------------------------------------------------
       
   580 // CPluginFepManagerBase::CPluginFepManagerBase
       
   581 // C++ default constructor.
       
   582 // (other items were commented in a header).
       
   583 // -----------------------------------------------------------------------------
       
   584 //
       
   585 CPluginFepManagerBase::CPluginFepManagerBase( CPenInputImePluginItut& aOwner,
       
   586                                              RPeninputServer* aPenInputServer )
       
   587     :iOwner( aOwner ), iPenInputServer( aPenInputServer )
       
   588     {
       
   589     iSuggestedRange = ERangeInvalid;
       
   590     }
       
   591 
       
   592 // -----------------------------------------------------------------------------
       
   593 // CPluginFepManagerBase::BaseConstructL
       
   594 // Symbian 2nd phase constructor.
       
   595 // (other items were commented in a header).
       
   596 // -----------------------------------------------------------------------------
       
   597 //
       
   598 void CPluginFepManagerBase::BaseConstructL()
       
   599     {
       
   600     iRepository = CRepository::NewL( KCRUidAknFep );
       
   601     }
       
   602     
       
   603 // -----------------------------------------------------------------------------
       
   604 // CPluginFepManagerBase::SetLayoutPermitedRanges
       
   605 // Set layout permited ranges.
       
   606 // (other items were commented in a header).
       
   607 // -----------------------------------------------------------------------------
       
   608 //
       
   609 void CPluginFepManagerBase::SetLayoutPermitedRanges( TInt aPermittedMode )
       
   610     {
       
   611     // Not derived from edwin
       
   612 	SendCommandToServer( ECmdPenInputPermittedRange, aPermittedMode == EAknEditorNumericInputMode  );
       
   613 	
       
   614 	/*if ( aPermittedMode == EAknEditorNumericInputMode ) 
       
   615         {
       
   616         iPermittedRange = ERangeNumber;         
       
   617         }
       
   618     else if ( aPermittedMode & EAknEditorTextInputMode )
       
   619         {
       
   620         // Derived from edwin and EAknEditorTextInputMode
       
   621         iPermittedRange = ERangeNative | 
       
   622                           ERangeNumber | 
       
   623                           ERangeEnglish | 
       
   624                           ERangeSymbol;
       
   625         }
       
   626     else if ( aPermittedMode & EAknEditorSecretAlphaInputMode ) 
       
   627         {
       
   628         // Derived from EAknEditorSecretAlphaInputMode 
       
   629         iPermittedRange = ERangeNumber |
       
   630                           ERangeEnglish | 
       
   631                           ERangeSymbol;        
       
   632         }
       
   633     else
       
   634         {
       
   635         iPermittedRange = ERangeNative | 
       
   636                           ERangeNumber | 
       
   637                           ERangeEnglish | 
       
   638                           ERangeSymbol;
       
   639         }*/
       
   640     }
       
   641     
       
   642 // -----------------------------------------------------------------------------
       
   643 // CPluginFepManagerBase::SetLayoutRange
       
   644 // Set layout primary range.
       
   645 // (other items were commented in a header).
       
   646 // -----------------------------------------------------------------------------
       
   647 //
       
   648 void CPluginFepManagerBase::SetLayoutRange( 
       
   649     const CAknEdwinState* aEditorState )
       
   650     {
       
   651     if ( aEditorState )
       
   652 	    {
       
   653 	    SendCommandToServer( ECmdPenInputRange, 
       
   654 	                         aEditorState->Flags() & EAknEditorFlagLatinInputModesOnly ); 
       
   655 	    }
       
   656     }
       
   657     
       
   658 // -----------------------------------------------------------------------------
       
   659 // CPluginFepManagerBase::SendCommandToServer
       
   660 // Send command to pen input server utility function.
       
   661 // (other items were commented in a header).
       
   662 // -----------------------------------------------------------------------------
       
   663 //
       
   664 void CPluginFepManagerBase::SendCommandToServer( TInt aCommandId )
       
   665     {
       
   666     iPenInputServer->HandleCommand( aCommandId );
       
   667     }
       
   668 
       
   669 // -----------------------------------------------------------------------------
       
   670 // CPluginFepManagerBase::SendCommandToServer
       
   671 // Send command to pen input server utility function.
       
   672 // (other items were commented in a header).
       
   673 // -----------------------------------------------------------------------------
       
   674 //
       
   675 void CPluginFepManagerBase::SendCommandToServer( TInt aCommandId, TInt aParam )
       
   676     {
       
   677     TBuf8<sizeof(TInt)> buf;
       
   678     buf.Append( (TUint8*)&aParam, sizeof(TInt) );    
       
   679     SendCommandToServer( aCommandId, buf );
       
   680     }
       
   681 
       
   682 // -----------------------------------------------------------------------------
       
   683 // CPluginFepManagerBase::SendCommandToServer
       
   684 // Send command to pen input server utility function.
       
   685 // (other items were commented in a header).
       
   686 // -----------------------------------------------------------------------------
       
   687 //
       
   688 void CPluginFepManagerBase::SendCommandToServer( TInt aCommandId, 
       
   689                                                  const TDesC8& aParam )
       
   690     {
       
   691     iPenInputServer->HandleCommand( aCommandId, aParam );        
       
   692     }
       
   693 
       
   694 // -----------------------------------------------------------------------------
       
   695 // CPluginFepManagerBase::LayoutLastUsedRange
       
   696 // Get layout UI last used range.
       
   697 // (other items were commented in a header).
       
   698 // -----------------------------------------------------------------------------
       
   699 //
       
   700 TInt CPluginFepManagerBase::LayoutLastUsedRange()
       
   701     {
       
   702     TInt value = 0;
       
   703     if ( iRepository )
       
   704         {
       
   705         iRepository->Get( KAknFepLastUsedRange, value );
       
   706         }
       
   707         
       
   708     return value;
       
   709     }
       
   710 
       
   711 // -----------------------------------------------------------------------------
       
   712 // CPluginFepManagerBase::SetLayoutPosition
       
   713 // Set layout UI position.
       
   714 // (other items were commented in a header).
       
   715 // -----------------------------------------------------------------------------
       
   716 //
       
   717 void CPluginFepManagerBase::SetLayoutPosition( const TRect& pParam )
       
   718     {
       
   719     TBuf8<sizeof( TRect )> buf;
       
   720     buf.Append( (TUint8*)&pParam, sizeof( pParam ) );
       
   721     
       
   722     SendCommandToServer( ECmdPenInputSetWindowPos, buf );
       
   723     }
       
   724 
       
   725 // -----------------------------------------------------------------------------
       
   726 // CPluginFepManagerBase::GetLocalLanguage
       
   727 // (other items were commented in a header).
       
   728 // -----------------------------------------------------------------------------
       
   729 //
       
   730 TLanguage CPluginFepManagerBase::GetLocalLanguage( 
       
   731     const CAknEdwinState* aEditorState ) const
       
   732     {
       
   733     TLanguage language = ELangTest;
       
   734     // Check for a local language override
       
   735     if ( aEditorState )
       
   736         {
       
   737         TInt aknEditorFlags = aEditorState->Flags()	;
       
   738         if ( aknEditorFlags & EAknEditorFlagLatinInputModesOnly )
       
   739             {
       
   740             language = ELangEnglish;
       
   741             }
       
   742         else
       
   743             {
       
   744             language = aEditorState->LocalLanguage();
       
   745             }
       
   746         }
       
   747 
       
   748     return language;
       
   749     }
       
   750 
       
   751  // End Of File