os/mm/devsoundextensions/mmextfw/custominterfaceutility/CustomInterfaceBuilder/src/CustomInterfaceCustomCommandParser.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-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:   Custom Interface CustomCommand Parser
    15 *
    16 */
    17 
    18 
    19 #include <CustomInterfaceCustomCommandParser.h>
    20 #include <MCustomInterfaceCustomCommandImplementor.h>
    21 #include "CustomInterfaceBuilderTypes.h"
    22 
    23 
    24 EXPORT_C CCustomInterfaceCustomCommandParser* CCustomInterfaceCustomCommandParser::NewL(MCustomInterfaceCustomCommandImplementor& aImplementor)
    25 	{
    26 	CCustomInterfaceCustomCommandParser* self = new(ELeave) CCustomInterfaceCustomCommandParser(aImplementor);
    27 	CleanupStack::PushL(self);
    28 	self->ConstructL();
    29 	CleanupStack::Pop(self);
    30 	return self;
    31 	}
    32 
    33 CCustomInterfaceCustomCommandParser::CCustomInterfaceCustomCommandParser(MCustomInterfaceCustomCommandImplementor& aImplementor) :
    34 	CMMFCustomCommandParserBase(KUidCustomInterfaceBuilder),
    35 	iImplementor(aImplementor)
    36 	{
    37 	}
    38 
    39 void CCustomInterfaceCustomCommandParser::ConstructL()
    40 	{
    41 	}
    42 
    43 CCustomInterfaceCustomCommandParser::~CCustomInterfaceCustomCommandParser()
    44 	{
    45 	}
    46 
    47 void CCustomInterfaceCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
    48 	{
    49 	ASSERT(aMessage.Destination().InterfaceId() == KUidCustomInterfaceBuilder);
    50 	TRAPD(error, DoHandleRequestL(aMessage));
    51 	if ( error )
    52 		{
    53 		aMessage.Complete(error);
    54 		}
    55 	}
    56 
    57 void CCustomInterfaceCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
    58 	{
    59 	// call required function to do the requested operation
    60 	switch( aMessage.Function() )
    61 		{
    62 		case ECibGetBuilder:
    63 			DoGetBuilderL(aMessage);
    64 			break;
    65 
    66 		default:
    67 			User::Leave(KErrNotSupported);
    68 
    69 		}
    70 	aMessage.Complete(KErrNone);
    71 	}
    72 
    73 void CCustomInterfaceCustomCommandParser::DoGetBuilderL(TMMFMessage& aMessage)
    74 	{
    75 	TMMFMessageDestinationPckg handlePckg(iImplementor.GetCustomInterfaceBuilderL());
    76 	TInt error = aMessage.WriteDataToClient(handlePckg);
    77 	User::LeaveIfError(error);
    78 	}
    79 
    80 
    81 // ========================== OTHER EXPORTED FUNCTIONS =========================
    82 
    83 
    84 
    85 // End of File