1 // Copyright (c) 2003-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.
14 // include\mmf\common\mmfipc.h
15 // Thin interface layer to use either V1 or V2 IPC calls as appropriate
19 #ifndef __MMF_COMMON_MMFIPC_SERVER_H__
20 #define __MMF_COMMON_MMFIPC_SERVER_H__
23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
24 #include <mmf/common/mmfipc.h>
27 // The following declarations are used instead of the native ones on the particular system variant:
28 // RMmfIpcMessage replaces RMessage or RMessage2
29 // CMmfIpcServer replaces CServer or CServer2
30 // CMmfIpcSession replaces CSharableSession or CSession2
31 // They are used internally to the MMF component to provide configurability for the particular subsystem
33 #ifdef __MMF_USE_IPC_V2__
35 //typedef RMessage2 RMmfIpcMessage;
37 class CMmfIpcServer; // forward declaration
40 * derive CMmfIpcSession from CSession2 so we can bridge the differences to old CSharableSession
45 class CMmfIpcSession : public CSession2
48 virtual void CreateL(const CMmfIpcServer& aServer);
55 * derive CMmfIpcServer from CServer2 so we can bridge difference to old CServer
60 class CMmfIpcServer : public CServer2
63 virtual CMmfIpcSession* NewSessionL(const TVersion& aVersion) const=0;
64 CMmfIpcServer(TInt aPriority,TServerType aType=EUnsharableSessions);
66 // derived from CServer2
67 CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
70 #else // __MMF_USE_IPC_V2__
72 // otherwise always use V1
73 //typedef RMessage RMmfIpcMessage;
74 typedef CServer CMmfIpcServer;
75 typedef CSharableSession CMmfIpcSession;
77 #endif // __MMF_USE_IPC_V2__
80 #pragma warning( disable : 4097 ) // typedef-name used as synonym for class-name
85 * Adapt RMessage calls between IPC variants
93 static TInt Read(const RMmfIpcMessage& aMessage, TInt aParam, TDes8& aResult);
94 static TInt Write(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC8& aValue);
95 static void ReadL(const RMmfIpcMessage& aMessage, TInt aParam, TDes8& aResult);
96 static void WriteL(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC8& aValue);
99 #include <mmf/common/mmfipcserver.inl>
101 #endif // __MMF_COMMON_MMFIPC_SERVER_H__