srsf/vcommandhandler/src/vcommandrecoghandler.cpp
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
18:cad71a31b7fc 19:e36f3802f733
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Engine to perform the action corresponding to
       
    15 *                the recognized and selected command
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include <nssvasmtag.h>
       
    21 #include <vcommandapi.h>
       
    22 #include "vcommandinternalapi.h"
       
    23 #include "rubydebug.h"
       
    24 #include "tagcommandconverter.h"
       
    25 #include "vcommandrecoghandler.h"
       
    26 
       
    27 /**
       
    28 * Factory function
       
    29 */
       
    30 CVCRecognitionHandler* CVCRecognitionHandler::NewL()
       
    31 	{
       
    32 	CVCRecognitionHandler* self = new (ELeave) CVCRecognitionHandler;
       
    33 	return self;
       
    34 	}
       
    35 
       
    36 // From MNssTagSelectHandler
       
    37 /**
       
    38 * Handle Tag Select Event - Event indicating a voice tag has been selected.
       
    39 * @param aClientTag The voice tag which has been selected. This object is
       
    40 *                   resonsible for deleting aClientTag.
       
    41 * @return void
       
    42 */
       
    43 void CVCRecognitionHandler::HandleTagSelect( MNssTag* aClientTag )
       
    44 	{
       
    45 	RUBY_DEBUG0( "CVCRecognitionHandler::HandleTagSelect start" );
       
    46 	TRAPD( err, HandleTagSelectL( *aClientTag ) );
       
    47 	if( err != KErrNone )
       
    48 		{
       
    49 		RUBY_ERROR1( "CVCRecognitionHandler::HandleTagSelectL failed with [%d] ", err );
       
    50 		}
       
    51 	
       
    52 	delete aClientTag;
       
    53 	RUBY_DEBUG0( "CVCRecognitionHandler::HandleTagSelect end" );
       
    54 	}
       
    55 	
       
    56 void CVCRecognitionHandler::HandleTagSelectL( const MNssTag& aTag )
       
    57 	{
       
    58 	RUBY_DEBUG_BLOCK( "CVCRecognitionHandler::HandleTagSelectL" );
       
    59 	CStoredVCommand* command = CTagCommandConverter::TagToCommandLC( aTag );
       
    60 	command->Runnable().ExecuteL();
       
    61 	CleanupStack::PopAndDestroy( command );
       
    62 	}
       
    63 	
       
    64 //End of file