epoc32/include/comms-infras/cs_api_ext.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 // Copyright (c) 1997-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 
    17 
    18 /**
    19  @file
    20  @internalTechnology
    21  @released
    22 */
    23 
    24 #ifndef CS_API_EXT_H
    25 #define CS_API_EXT_H
    26 
    27 #include <es_sock.h>
    28 #include <comms-infras/api_ext_list.h>
    29 #include <comms-infras/trbuf.h>
    30 
    31 class CCommsApiExtReqMsg;
    32 class CCommsApiExtRespMsg;
    33 
    34 class RCommsApiExtensionBase
    35 /**
    36 Base class for Comms API extensions.
    37 
    38 @internalTechnology
    39 @released
    40 */
    41 	{
    42 protected:
    43 	IMPORT_C explicit RCommsApiExtensionBase();
    44 	IMPORT_C TInt Open(RCommsSubSession& aExtensionProvider, TSupportedCommsApiExt aInterfaceId);
    45 	IMPORT_C void Close();
    46 	IMPORT_C void SendRequest(CCommsApiExtReqMsg& aRequestMsg, TDes8& aResponseBuf, TRequestStatus& aStatus);
    47 	IMPORT_C void SendMessage(CCommsApiExtReqMsg& aRequestMsg);
    48 
    49 protected:
    50 	RCommsSubSession iSubSession;
    51 	TSupportedCommsApiExt iInterfaceId;
    52 
    53 private:
    54 	RPointerArray<Elements::TRBuf8> iBuffers;
    55 	};
    56 
    57 template<TSupportedCommsApiExt T>
    58 class RCommsApiExtension : public RCommsApiExtensionBase
    59 /**
    60 Comms API extensions template. New extension APIs may derive from this template.
    61 
    62 @internalTechnology
    63 @released
    64 */
    65 	{
    66 public:
    67 	inline TInt Open(RCommsSubSession& aExtensionProvider);
    68 	};
    69 
    70 template<TSupportedCommsApiExt T>
    71 TInt RCommsApiExtension<T>::Open(RCommsSubSession& aExtensionProvider)
    72 	{
    73 	return RCommsApiExtensionBase::Open(aExtensionProvider,T);
    74 	}
    75 
    76 #endif // CS_API_EXT_H