Update contrib.
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "mmfdurationinfocustomcommands.h"
17 #include <mmf/common/mmfdurationinfocustomcommands.h>
18 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
19 #include <mmf/common/mmfdurationinfocustomcommandsimpl.h>
20 #include <mmf/common/mmfdurationinfocustomcommandsenums.h>
21 #include <mmf/common/mmfdrmcustomcommandsenum.h>
24 EXPORT_C CMMFDurationInfoCustomCommandParser* CMMFDurationInfoCustomCommandParser::NewL(MMMFDurationInfoCustomCommandImplementor& aImplementor)
26 return new(ELeave) CMMFDurationInfoCustomCommandParser(aImplementor);
29 EXPORT_C CMMFDurationInfoCustomCommandParser::~CMMFDurationInfoCustomCommandParser()
33 CMMFDurationInfoCustomCommandParser::CMMFDurationInfoCustomCommandParser(MMMFDurationInfoCustomCommandImplementor& aImplementor)
34 : CMMFCustomCommandParserBase(KUidInterfaceMMFDurationInfoControl),
35 iImplementor(aImplementor)
39 void CMMFDurationInfoCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
41 TInt err = KErrNotSupported;
43 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFDurationInfoControl)
45 switch (aMessage.Function())
47 case EMMFGetDurationInfo:
48 err = GetDurationInfo(aMessage);
51 err = KErrNotSupported;
56 aMessage.Complete(err);
60 TInt CMMFDurationInfoCustomCommandParser::GetDurationInfo(TMMFMessage& aMessage)
62 TInt retRes = KErrNone;
63 TPckgBuf<TMMFDurationInfo> enumPckg;
64 iImplementor.GetDurationInfo( enumPckg() );
65 aMessage.WriteDataToClient(enumPckg);
69 EXPORT_C CMMFDurationInfoCustomCommandParser2* CMMFDurationInfoCustomCommandParser2::NewL(MMMFDurationInfoCustomCommandImplementor2& aImplementor)
71 return new(ELeave) CMMFDurationInfoCustomCommandParser2(aImplementor);
74 EXPORT_C CMMFDurationInfoCustomCommandParser2::~CMMFDurationInfoCustomCommandParser2()
78 CMMFDurationInfoCustomCommandParser2::CMMFDurationInfoCustomCommandParser2(MMMFDurationInfoCustomCommandImplementor2& aImplementor)
79 : CMMFCustomCommandParserBase(KUidInterfaceMMFDurationInfoControl2),
80 iImplementor(aImplementor)
84 void CMMFDurationInfoCustomCommandParser2::HandleRequest(TMMFMessage& aMessage)
87 if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFDurationInfoControl2)
89 switch (aMessage.Function())
91 case EMMFGetDurationInfo:
92 err = GetDurationInfo(aMessage);
95 err = KErrNotSupported;
101 err = KErrNotSupported;
103 aMessage.Complete(err);
106 TInt CMMFDurationInfoCustomCommandParser2::GetDurationInfo(TMMFMessage& aMessage)
109 TPckgBuf<TMMFDurationInfo> enumPckg;
110 err = iImplementor.GetDurationInfo(enumPckg());
113 err = aMessage.WriteDataToClient(enumPckg);