textinput/peninputfingerhwrar/src/peninputfingerhwrarengine.cpp
branchRCL_3
changeset 10 6defe5d1bd39
parent 7 a47de9135b21
child 19 5e18d8c489d6
equal deleted inserted replaced
8:6ceef9a83b1a 10:6defe5d1bd39
     1 /*
     1 /*
     2 * Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    50 // destructor
    50 // destructor
    51 // ---------------------------------------------------------------------------
    51 // ---------------------------------------------------------------------------
    52 //
    52 //
    53 CPeninputFingerHwrArEngine::~CPeninputFingerHwrArEngine()
    53 CPeninputFingerHwrArEngine::~CPeninputFingerHwrArEngine()
    54     {
    54     {
    55     RProperty::Set(KCRUidAvkon, KAknKeyBoardLayout, iKeyboardType);
       
    56     
       
    57     if( iOwnPtiEngine )
    55     if( iOwnPtiEngine )
    58         {
    56         {
    59         delete iPtiEngine;
    57         delete iPtiEngine;
    60         }
    58         }
    61     delete iCustomKeymap;
    59     delete iCustomKeymap;
    87         iOwner->SetStrokeEndMark(); // make control's stroke end mark info same to engine
    85         iOwner->SetStrokeEndMark(); // make control's stroke end mark info same to engine
    88         }
    86         }
    89     
    87     
    90     aCandidates.ResetAndDestroy();
    88     aCandidates.ResetAndDestroy();
    91 
    89 
    92     TInt primaryCount = iRecognizer->Recognize( aTraceData, aCandidates ); 
    90     iRecognizer->Recognize( aTraceData, aCandidates ); 
    93 
       
    94     // filter recognized candidate, set start position for all ranges    
       
    95     TPtrC ptr( KSeparator );
       
    96     
       
    97        
       
    98     // remove uncessary primary candidate
       
    99     TInt totallyCount = aCandidates.Count();
       
   100     }
    91     }
   101     
    92     
   102 
    93 
   103  
    94  
   104 // ---------------------------------------------------------------------------
    95 // ---------------------------------------------------------------------------
   202 // Get stroke end mark from hwr engine
   193 // Get stroke end mark from hwr engine
   203 // ---------------------------------------------------------------------------------------------
   194 // ---------------------------------------------------------------------------------------------
   204 //
   195 //
   205 TPoint CPeninputFingerHwrArEngine::StrokeEndMark() const
   196 TPoint CPeninputFingerHwrArEngine::StrokeEndMark() const
   206     {
   197     {
       
   198 	TPoint strokeEndMark( KDefaultStrokeEndMarkX, KDefaultStrokeEndMarkY );
       
   199 	
   207     if ( iRecognizer )
   200     if ( iRecognizer )
   208         {
   201         {
   209         return iRecognizer->StrokeEndMark();
   202         strokeEndMark = iRecognizer->StrokeEndMark();
   210         }
   203         }
   211     else
   204     
   212         {
   205 	return strokeEndMark;
   213         return TPoint( KDefaultStrokeEndMarkX, KDefaultStrokeEndMarkY );
       
   214         }
       
   215     }
   206     }
   216 
   207 
   217 // ---------------------------------------------------------------------------------------------
   208 // ---------------------------------------------------------------------------------------------
   218 // Set primary candidate num for hwr engine
   209 // Set primary candidate num for hwr engine
   219 // ---------------------------------------------------------------------------------------------
   210 // ---------------------------------------------------------------------------------------------
   435     		aTraceData.Insert( aPnt2, i );
   426     		aTraceData.Insert( aPnt2, i );
   436     	    }
   427     	    }
   437         }
   428         }
   438     }    
   429     }    
   439     
   430     
   440 // ---------------------------------------------------------------------------
       
   441 // Reset Keyboard type to original type
       
   442 // ---------------------------------------------------------------------------
       
   443 //
       
   444 void CPeninputFingerHwrArEngine::ResetKeyboardType()
       
   445     {
       
   446     RProperty::Set(KCRUidAvkon, KAknKeyBoardLayout, iKeyboardType);
       
   447     }        
       
   448      
       
   449      
       
   450 // ---------------------------------------------------------------------------
       
   451 // Set Keyboard type to Qwerty
       
   452 // ---------------------------------------------------------------------------
       
   453 //
       
   454 void CPeninputFingerHwrArEngine::SetKeyboardToQwerty()
       
   455     {
       
   456     RProperty::Set(KCRUidAvkon, KAknKeyBoardLayout, EPtiKeyboardQwerty4x12);
       
   457     }        
       
   458 
       
   459 // ---------------------------------------------------------------------------
       
   460 // Get Keyboard type
       
   461 // ---------------------------------------------------------------------------
       
   462 //
       
   463 void CPeninputFingerHwrArEngine::GetKeyboardType()
       
   464     {
       
   465     RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, iKeyboardType);
       
   466     }        
       
   467 
       
   468 void CPeninputFingerHwrArEngine::GetTopGuideLinePos(TInt& aPos)
   431 void CPeninputFingerHwrArEngine::GetTopGuideLinePos(TInt& aPos)
   469     {
   432     {
   470     if(iRecognizer)
   433     if(iRecognizer)
   471         {
   434         {
   472         iRecognizer->GetTopGuideLinePos(aPos);
   435         iRecognizer->GetTopGuideLinePos(aPos);