os/mm/devsoundextensions/mmextfw/custominterfaceutility/CustomInterfaceBuilder/src/CustomInterfaceCustomCommandParser.cpp
Update contrib.
2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Custom Interface CustomCommand Parser
19 #include <CustomInterfaceCustomCommandParser.h>
20 #include <MCustomInterfaceCustomCommandImplementor.h>
21 #include "CustomInterfaceBuilderTypes.h"
24 EXPORT_C CCustomInterfaceCustomCommandParser* CCustomInterfaceCustomCommandParser::NewL(MCustomInterfaceCustomCommandImplementor& aImplementor)
26 CCustomInterfaceCustomCommandParser* self = new(ELeave) CCustomInterfaceCustomCommandParser(aImplementor);
27 CleanupStack::PushL(self);
29 CleanupStack::Pop(self);
33 CCustomInterfaceCustomCommandParser::CCustomInterfaceCustomCommandParser(MCustomInterfaceCustomCommandImplementor& aImplementor) :
34 CMMFCustomCommandParserBase(KUidCustomInterfaceBuilder),
35 iImplementor(aImplementor)
39 void CCustomInterfaceCustomCommandParser::ConstructL()
43 CCustomInterfaceCustomCommandParser::~CCustomInterfaceCustomCommandParser()
47 void CCustomInterfaceCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
49 ASSERT(aMessage.Destination().InterfaceId() == KUidCustomInterfaceBuilder);
50 TRAPD(error, DoHandleRequestL(aMessage));
53 aMessage.Complete(error);
57 void CCustomInterfaceCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
59 // call required function to do the requested operation
60 switch( aMessage.Function() )
63 DoGetBuilderL(aMessage);
67 User::Leave(KErrNotSupported);
70 aMessage.Complete(KErrNone);
73 void CCustomInterfaceCustomCommandParser::DoGetBuilderL(TMMFMessage& aMessage)
75 TMMFMessageDestinationPckg handlePckg(iImplementor.GetCustomInterfaceBuilderL());
76 TInt error = aMessage.WriteDataToClient(handlePckg);
77 User::LeaveIfError(error);
81 // ========================== OTHER EXPORTED FUNCTIONS =========================