os/mm/devsoundextensions/mmextfw/custominterfaceutility/CustomInterfaceBuilder/src/CustomInterfaceCustomCommandParser.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsoundextensions/mmextfw/custominterfaceutility/CustomInterfaceBuilder/src/CustomInterfaceCustomCommandParser.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,85 @@
1.4 +/*
1.5 +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: Custom Interface CustomCommand Parser
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#include <CustomInterfaceCustomCommandParser.h>
1.23 +#include <MCustomInterfaceCustomCommandImplementor.h>
1.24 +#include "CustomInterfaceBuilderTypes.h"
1.25 +
1.26 +
1.27 +EXPORT_C CCustomInterfaceCustomCommandParser* CCustomInterfaceCustomCommandParser::NewL(MCustomInterfaceCustomCommandImplementor& aImplementor)
1.28 + {
1.29 + CCustomInterfaceCustomCommandParser* self = new(ELeave) CCustomInterfaceCustomCommandParser(aImplementor);
1.30 + CleanupStack::PushL(self);
1.31 + self->ConstructL();
1.32 + CleanupStack::Pop(self);
1.33 + return self;
1.34 + }
1.35 +
1.36 +CCustomInterfaceCustomCommandParser::CCustomInterfaceCustomCommandParser(MCustomInterfaceCustomCommandImplementor& aImplementor) :
1.37 + CMMFCustomCommandParserBase(KUidCustomInterfaceBuilder),
1.38 + iImplementor(aImplementor)
1.39 + {
1.40 + }
1.41 +
1.42 +void CCustomInterfaceCustomCommandParser::ConstructL()
1.43 + {
1.44 + }
1.45 +
1.46 +CCustomInterfaceCustomCommandParser::~CCustomInterfaceCustomCommandParser()
1.47 + {
1.48 + }
1.49 +
1.50 +void CCustomInterfaceCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
1.51 + {
1.52 + ASSERT(aMessage.Destination().InterfaceId() == KUidCustomInterfaceBuilder);
1.53 + TRAPD(error, DoHandleRequestL(aMessage));
1.54 + if ( error )
1.55 + {
1.56 + aMessage.Complete(error);
1.57 + }
1.58 + }
1.59 +
1.60 +void CCustomInterfaceCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
1.61 + {
1.62 + // call required function to do the requested operation
1.63 + switch( aMessage.Function() )
1.64 + {
1.65 + case ECibGetBuilder:
1.66 + DoGetBuilderL(aMessage);
1.67 + break;
1.68 +
1.69 + default:
1.70 + User::Leave(KErrNotSupported);
1.71 +
1.72 + }
1.73 + aMessage.Complete(KErrNone);
1.74 + }
1.75 +
1.76 +void CCustomInterfaceCustomCommandParser::DoGetBuilderL(TMMFMessage& aMessage)
1.77 + {
1.78 + TMMFMessageDestinationPckg handlePckg(iImplementor.GetCustomInterfaceBuilderL());
1.79 + TInt error = aMessage.WriteDataToClient(handlePckg);
1.80 + User::LeaveIfError(error);
1.81 + }
1.82 +
1.83 +
1.84 +// ========================== OTHER EXPORTED FUNCTIONS =========================
1.85 +
1.86 +
1.87 +
1.88 +// End of File