1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/src/ControllerFramework/MMFDurationInfoCustomCommands.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,117 @@
1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include "mmfdurationinfocustomcommands.h"
1.20 +#include <mmf/common/mmfdurationinfocustomcommands.h>
1.21 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
1.22 +#include <mmf/common/mmfdurationinfocustomcommandsimpl.h>
1.23 +#include <mmf/common/mmfdurationinfocustomcommandsenums.h>
1.24 +#include <mmf/common/mmfdrmcustomcommandsenum.h>
1.25 +#endif
1.26 +
1.27 +EXPORT_C CMMFDurationInfoCustomCommandParser* CMMFDurationInfoCustomCommandParser::NewL(MMMFDurationInfoCustomCommandImplementor& aImplementor)
1.28 + {
1.29 + return new(ELeave) CMMFDurationInfoCustomCommandParser(aImplementor);
1.30 + }
1.31 +
1.32 +EXPORT_C CMMFDurationInfoCustomCommandParser::~CMMFDurationInfoCustomCommandParser()
1.33 + {
1.34 + }
1.35 +
1.36 +CMMFDurationInfoCustomCommandParser::CMMFDurationInfoCustomCommandParser(MMMFDurationInfoCustomCommandImplementor& aImplementor)
1.37 + : CMMFCustomCommandParserBase(KUidInterfaceMMFDurationInfoControl),
1.38 + iImplementor(aImplementor)
1.39 + {
1.40 + }
1.41 +
1.42 +void CMMFDurationInfoCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
1.43 + {
1.44 + TInt err = KErrNotSupported;
1.45 +
1.46 + if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFDurationInfoControl)
1.47 + {
1.48 + switch (aMessage.Function())
1.49 + {
1.50 + case EMMFGetDurationInfo:
1.51 + err = GetDurationInfo(aMessage);
1.52 + break;
1.53 + default:
1.54 + err = KErrNotSupported;
1.55 + break;
1.56 + }
1.57 + }
1.58 +
1.59 + aMessage.Complete(err);
1.60 + }
1.61 +
1.62 +
1.63 +TInt CMMFDurationInfoCustomCommandParser::GetDurationInfo(TMMFMessage& aMessage)
1.64 + {
1.65 + TInt retRes = KErrNone;
1.66 + TPckgBuf<TMMFDurationInfo> enumPckg;
1.67 + iImplementor.GetDurationInfo( enumPckg() );
1.68 + aMessage.WriteDataToClient(enumPckg);
1.69 + return retRes;
1.70 + }
1.71 +
1.72 +EXPORT_C CMMFDurationInfoCustomCommandParser2* CMMFDurationInfoCustomCommandParser2::NewL(MMMFDurationInfoCustomCommandImplementor2& aImplementor)
1.73 + {
1.74 + return new(ELeave) CMMFDurationInfoCustomCommandParser2(aImplementor);
1.75 + }
1.76 +
1.77 +EXPORT_C CMMFDurationInfoCustomCommandParser2::~CMMFDurationInfoCustomCommandParser2()
1.78 + {
1.79 + }
1.80 +
1.81 +CMMFDurationInfoCustomCommandParser2::CMMFDurationInfoCustomCommandParser2(MMMFDurationInfoCustomCommandImplementor2& aImplementor)
1.82 + : CMMFCustomCommandParserBase(KUidInterfaceMMFDurationInfoControl2),
1.83 + iImplementor(aImplementor)
1.84 + {
1.85 + }
1.86 +
1.87 +void CMMFDurationInfoCustomCommandParser2::HandleRequest(TMMFMessage& aMessage)
1.88 + {
1.89 + TInt err = KErrNone;
1.90 + if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFDurationInfoControl2)
1.91 + {
1.92 + switch (aMessage.Function())
1.93 + {
1.94 + case EMMFGetDurationInfo:
1.95 + err = GetDurationInfo(aMessage);
1.96 + break;
1.97 + default:
1.98 + err = KErrNotSupported;
1.99 + break;
1.100 + }
1.101 + }
1.102 + else
1.103 + {
1.104 + err = KErrNotSupported;
1.105 + }
1.106 + aMessage.Complete(err);
1.107 + }
1.108 +
1.109 +TInt CMMFDurationInfoCustomCommandParser2::GetDurationInfo(TMMFMessage& aMessage)
1.110 + {
1.111 + TInt err = KErrNone;
1.112 + TPckgBuf<TMMFDurationInfo> enumPckg;
1.113 + err = iImplementor.GetDurationInfo(enumPckg());
1.114 + if(err==KErrNone)
1.115 + {
1.116 + err = aMessage.WriteDataToClient(enumPckg);
1.117 + }
1.118 + return err;
1.119 + }
1.120 +