1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/comms-infras/cs_api_ext.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,76 @@
1.4 +// Copyright (c) 1997-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 +
1.20 +
1.21 +/**
1.22 + @file
1.23 + @internalTechnology
1.24 + @released
1.25 +*/
1.26 +
1.27 +#ifndef CS_API_EXT_H
1.28 +#define CS_API_EXT_H
1.29 +
1.30 +#include <es_sock.h>
1.31 +#include <comms-infras/api_ext_list.h>
1.32 +#include <comms-infras/trbuf.h>
1.33 +
1.34 +class CCommsApiExtReqMsg;
1.35 +class CCommsApiExtRespMsg;
1.36 +
1.37 +class RCommsApiExtensionBase
1.38 +/**
1.39 +Base class for Comms API extensions.
1.40 +
1.41 +@internalTechnology
1.42 +@released
1.43 +*/
1.44 + {
1.45 +protected:
1.46 + IMPORT_C explicit RCommsApiExtensionBase();
1.47 + IMPORT_C TInt Open(RCommsSubSession& aExtensionProvider, TSupportedCommsApiExt aInterfaceId);
1.48 + IMPORT_C void Close();
1.49 + IMPORT_C void SendRequest(CCommsApiExtReqMsg& aRequestMsg, TDes8& aResponseBuf, TRequestStatus& aStatus);
1.50 + IMPORT_C void SendMessage(CCommsApiExtReqMsg& aRequestMsg);
1.51 +
1.52 +protected:
1.53 + RCommsSubSession iSubSession;
1.54 + TSupportedCommsApiExt iInterfaceId;
1.55 +
1.56 +private:
1.57 + RPointerArray<Elements::TRBuf8> iBuffers;
1.58 + };
1.59 +
1.60 +template<TSupportedCommsApiExt T>
1.61 +class RCommsApiExtension : public RCommsApiExtensionBase
1.62 +/**
1.63 +Comms API extensions template. New extension APIs may derive from this template.
1.64 +
1.65 +@internalTechnology
1.66 +@released
1.67 +*/
1.68 + {
1.69 +public:
1.70 + inline TInt Open(RCommsSubSession& aExtensionProvider);
1.71 + };
1.72 +
1.73 +template<TSupportedCommsApiExt T>
1.74 +TInt RCommsApiExtension<T>::Open(RCommsSubSession& aExtensionProvider)
1.75 + {
1.76 + return RCommsApiExtensionBase::Open(aExtensionProvider,T);
1.77 + }
1.78 +
1.79 +#endif // CS_API_EXT_H