sl@0: // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include "mmfdurationinfocustomcommands.h" sl@0: #include sl@0: #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #include sl@0: #include sl@0: #endif sl@0: sl@0: EXPORT_C CMMFDurationInfoCustomCommandParser* CMMFDurationInfoCustomCommandParser::NewL(MMMFDurationInfoCustomCommandImplementor& aImplementor) sl@0: { sl@0: return new(ELeave) CMMFDurationInfoCustomCommandParser(aImplementor); sl@0: } sl@0: sl@0: EXPORT_C CMMFDurationInfoCustomCommandParser::~CMMFDurationInfoCustomCommandParser() sl@0: { sl@0: } sl@0: sl@0: CMMFDurationInfoCustomCommandParser::CMMFDurationInfoCustomCommandParser(MMMFDurationInfoCustomCommandImplementor& aImplementor) sl@0: : CMMFCustomCommandParserBase(KUidInterfaceMMFDurationInfoControl), sl@0: iImplementor(aImplementor) sl@0: { sl@0: } sl@0: sl@0: void CMMFDurationInfoCustomCommandParser::HandleRequest(TMMFMessage& aMessage) sl@0: { sl@0: TInt err = KErrNotSupported; sl@0: sl@0: if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFDurationInfoControl) sl@0: { sl@0: switch (aMessage.Function()) sl@0: { sl@0: case EMMFGetDurationInfo: sl@0: err = GetDurationInfo(aMessage); sl@0: break; sl@0: default: sl@0: err = KErrNotSupported; sl@0: break; sl@0: } sl@0: } sl@0: sl@0: aMessage.Complete(err); sl@0: } sl@0: sl@0: sl@0: TInt CMMFDurationInfoCustomCommandParser::GetDurationInfo(TMMFMessage& aMessage) sl@0: { sl@0: TInt retRes = KErrNone; sl@0: TPckgBuf enumPckg; sl@0: iImplementor.GetDurationInfo( enumPckg() ); sl@0: aMessage.WriteDataToClient(enumPckg); sl@0: return retRes; sl@0: } sl@0: sl@0: EXPORT_C CMMFDurationInfoCustomCommandParser2* CMMFDurationInfoCustomCommandParser2::NewL(MMMFDurationInfoCustomCommandImplementor2& aImplementor) sl@0: { sl@0: return new(ELeave) CMMFDurationInfoCustomCommandParser2(aImplementor); sl@0: } sl@0: sl@0: EXPORT_C CMMFDurationInfoCustomCommandParser2::~CMMFDurationInfoCustomCommandParser2() sl@0: { sl@0: } sl@0: sl@0: CMMFDurationInfoCustomCommandParser2::CMMFDurationInfoCustomCommandParser2(MMMFDurationInfoCustomCommandImplementor2& aImplementor) sl@0: : CMMFCustomCommandParserBase(KUidInterfaceMMFDurationInfoControl2), sl@0: iImplementor(aImplementor) sl@0: { sl@0: } sl@0: sl@0: void CMMFDurationInfoCustomCommandParser2::HandleRequest(TMMFMessage& aMessage) sl@0: { sl@0: TInt err = KErrNone; sl@0: if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFDurationInfoControl2) sl@0: { sl@0: switch (aMessage.Function()) sl@0: { sl@0: case EMMFGetDurationInfo: sl@0: err = GetDurationInfo(aMessage); sl@0: break; sl@0: default: sl@0: err = KErrNotSupported; sl@0: break; sl@0: } sl@0: } sl@0: else sl@0: { sl@0: err = KErrNotSupported; sl@0: } sl@0: aMessage.Complete(err); sl@0: } sl@0: sl@0: TInt CMMFDurationInfoCustomCommandParser2::GetDurationInfo(TMMFMessage& aMessage) sl@0: { sl@0: TInt err = KErrNone; sl@0: TPckgBuf enumPckg; sl@0: err = iImplementor.GetDurationInfo(enumPckg()); sl@0: if(err==KErrNone) sl@0: { sl@0: err = aMessage.WriteDataToClient(enumPckg); sl@0: } sl@0: return err; sl@0: } sl@0: