sl@0: /* sl@0: * Copyright (c) 2003 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: sl@0: sl@0: #ifndef __TESTFRAMEWORKIPC_INL__ sl@0: #define __TESTFRAMEWORKIPC_INL__ sl@0: sl@0: sl@0: // sl@0: // RMmfSessionBaseX sl@0: // sl@0: sl@0: // Pass throughs - equiv to using... sl@0: sl@0: inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction) const sl@0: { sl@0: return RMmfSessionBase::SendReceive(aFunction); sl@0: } sl@0: sl@0: inline void RMmfSessionBaseX::SendReceive(TInt aFunction, TRequestStatus& aStatus) const sl@0: { sl@0: RMmfSessionBase::SendReceive(aFunction, aStatus); sl@0: } sl@0: sl@0: inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, TInt aParam0) const sl@0: { sl@0: return RMmfSessionBase::SendReceive(aFunction, aParam0); sl@0: } sl@0: sl@0: inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, TInt aParam0, TInt aParam1) const sl@0: { sl@0: return RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1); sl@0: } sl@0: sl@0: inline void RMmfSessionBaseX::SendReceive(TInt aFunction, TInt aParam0, TRequestStatus& aStatus) const sl@0: { sl@0: RMmfSessionBase::SendReceive(aFunction, aParam0, aStatus); sl@0: } sl@0: sl@0: inline void RMmfSessionBaseX::SendReceive(TInt aFunction, TInt aParam0, TInt aParam1, TRequestStatus& aStatus) const sl@0: { sl@0: RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1, aStatus); sl@0: } sl@0: sl@0: inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0) const sl@0: { sl@0: return RMmfSessionBase::SendReceive(aFunction, aParam0); sl@0: } sl@0: sl@0: inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0, const TDesC8& aParam1) const sl@0: { sl@0: return RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1); sl@0: } sl@0: sl@0: inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0, const TDesC8& aParam1, const TDesC8& aParam2) const sl@0: { sl@0: return RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1, aParam2); sl@0: } sl@0: sl@0: inline void RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0, TRequestStatus& aStatus) const sl@0: { sl@0: RMmfSessionBase::SendReceive(aFunction, aParam0, aStatus); sl@0: } sl@0: sl@0: inline void RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0, const TDesC8& aParam1, TRequestStatus& aStatus) const sl@0: { sl@0: RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1, aStatus); sl@0: } sl@0: sl@0: inline void RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0, const TDesC8& aParam1, const TDesC8& aParam2, TRequestStatus& aStatus) const sl@0: { sl@0: RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1, aParam2, aStatus); sl@0: } sl@0: sl@0: // New call sl@0: sl@0: inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC& aParam0, TInt aParam1) const sl@0: { sl@0: #ifdef __MMF_USE_IPC_V2__ sl@0: return RSessionBase::SendReceive(aFunction, TIpcArgs(&aParam0,aParam1)); sl@0: #else sl@0: TAny* p[KMaxMessageArguments]; sl@0: p[0] = static_cast(const_cast(&aParam0)); sl@0: p[1] = reinterpret_cast(aParam1); sl@0: p[2] = NULL; sl@0: p[3] = NULL; sl@0: return RSessionBase::SendReceive(aFunction, p); sl@0: #endif __MMF_USE_IPC_V2__ sl@0: } sl@0: sl@0: // sl@0: // MmfMEssageUtilX sl@0: // sl@0: sl@0: // Using calls sl@0: sl@0: inline TInt MmfMessageUtilX::Read(const RMmfIpcMessage& aMessage, TInt aParam, TDes8& aResult) sl@0: { sl@0: return MmfMessageUtil::Read(aMessage, aParam, aResult); sl@0: } sl@0: sl@0: inline TInt MmfMessageUtilX::Write(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC8& aValue) sl@0: { sl@0: return MmfMessageUtil::Write(aMessage, aParam, aValue); sl@0: } sl@0: sl@0: inline void MmfMessageUtilX::ReadL(const RMmfIpcMessage& aMessage, TInt aParam, TDes8& aResult) sl@0: { sl@0: MmfMessageUtil::ReadL(aMessage, aParam, aResult); sl@0: } sl@0: sl@0: inline void MmfMessageUtilX::WriteL(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC8& aValue) sl@0: { sl@0: MmfMessageUtil::WriteL(aMessage, aParam, aValue); sl@0: } sl@0: sl@0: sl@0: // New calls sl@0: sl@0: inline void MmfMessageUtilX::ReadL(const RMmfIpcMessage& aMessage, TInt aParam, TDes16& aResult) sl@0: { sl@0: #ifdef __MMF_USE_IPC_V2__ sl@0: User::LeaveIfError(aMessage.Read(aParam, aResult)); sl@0: #else sl@0: // expect aParam to be a literal - so this code should optimise out sl@0: if (aParam==0) sl@0: aMessage.ReadL(aMessage.Ptr0(), aResult); sl@0: else if (aParam==1) sl@0: aMessage.ReadL(aMessage.Ptr1(), aResult); sl@0: else if (aParam==2) sl@0: aMessage.ReadL(aMessage.Ptr2(), aResult); sl@0: else if (aParam==3) sl@0: aMessage.ReadL(aMessage.Ptr3(), aResult); sl@0: else sl@0: User::Leave(KErrArgument); sl@0: #endif __MMF_USE_IPC_V2__ sl@0: } sl@0: sl@0: inline void MmfMessageUtilX::WriteL(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC16& aValue) sl@0: { sl@0: #ifdef __MMF_USE_IPC_V2__ sl@0: User::LeaveIfError(aMessage.Write(aParam, aValue)); sl@0: #else sl@0: // expect aParam to be a literal - so this code should optimise out sl@0: if (aParam==0) sl@0: aMessage.WriteL(aMessage.Ptr0(), aValue); sl@0: else if (aParam==1) sl@0: aMessage.WriteL(aMessage.Ptr1(), aValue); sl@0: else if (aParam==2) sl@0: aMessage.WriteL(aMessage.Ptr2(), aValue); sl@0: else if (aParam==3) sl@0: aMessage.WriteL(aMessage.Ptr3(), aValue); sl@0: else sl@0: User::Leave(KErrArgument); sl@0: #endif __MMF_USE_IPC_V2__ sl@0: } sl@0: sl@0: inline TInt MmfMessageUtilX::Read(const RMmfIpcMessage& aMessage, TInt aParam, TDes16& aResult) sl@0: { sl@0: #ifdef __MMF_USE_IPC_V2__ sl@0: return aMessage.Read(aParam, aResult); sl@0: #else sl@0: TRAPD(error, ReadL(aMessage, aParam, aResult)); sl@0: return error; sl@0: #endif __MMF_USE_IPC_V2__ sl@0: } sl@0: sl@0: inline TInt MmfMessageUtilX::Write(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC16& aValue) sl@0: { sl@0: #ifdef __MMF_USE_IPC_V2__ sl@0: return aMessage.Write(aParam, aValue); sl@0: #else sl@0: TRAPD(error, WriteL(aMessage, aParam, aValue)); sl@0: return error; sl@0: #endif __MMF_USE_IPC_V2__ sl@0: } sl@0: sl@0: sl@0: sl@0: #endif // __TESTFRAMEWORKIPC_INL__