datacommsserver/esockserver/inc/ss_legacyinterfaces.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2005-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Legacy Node Messages
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 
       
    24 #ifndef SS_LEGACYINTERFACES_H_INCLUDED
       
    25 #define SS_LEGACYINTERFACES_H_INCLUDED
       
    26 
       
    27 
       
    28 #include <es_enum.h>
       
    29 #include <comms-infras/ss_nodeinterfaces.h>
       
    30 #include <comms-infras/ss_platsec_apiext.h>
       
    31 #include <comms-infras/ss_datamonitoringprovider.h>
       
    32 #include <comms-infras/ss_connprov.h>
       
    33 #include <elements/responsemsg.h>
       
    34 
       
    35 namespace ESock
       
    36 {
       
    37 enum TLegacyConnEnumClients
       
    38 	{
       
    39 	EAll,
       
    40 	ESocket,
       
    41 	EHostResolver,
       
    42 	EConnection
       
    43 	};
       
    44 
       
    45 /**
       
    46 API Extension for Data Access
       
    47 @internalComponent
       
    48 */
       
    49 class MLinkMCprLegacyDataAccessApiExt
       
    50     {
       
    51 public:
       
    52 	static const TInt KInterfaceId = 0x102864D8;
       
    53 
       
    54 	virtual void GetIntSettingL(const TDesC& aSettingName, TUint32& aValue, ESock::MPlatsecApiExt* aPlatsecItf) = 0;
       
    55 	virtual void GetBoolSettingL(const TDesC& aSettingName, TBool& aValue, ESock::MPlatsecApiExt* aPlatsecItf) = 0;
       
    56 	virtual void GetDes8SettingL(const TDesC& aSettingName, TDes8& aValue, ESock::MPlatsecApiExt* aPlatsecItf) = 0;
       
    57 	virtual void GetDes16SettingL(const TDesC& aSettingName, TDes16& aValue, ESock::MPlatsecApiExt* aPlatsecItf) = 0;
       
    58 	virtual void GetLongDesSettingL(const TDesC& aSettingName, HBufC*& aValue, ESock::MPlatsecApiExt* aPlatsecItf) = 0;
       
    59     };
       
    60 
       
    61 
       
    62 /**
       
    63 	API Extension for Control
       
    64 
       
    65 	@internalComponent
       
    66 */
       
    67 class MLegacyControlApiExt
       
    68     {
       
    69 public:
       
    70 	static const TInt KInterfaceId = 0x102864DB;
       
    71 
       
    72     /**
       
    73     Legacy control call
       
    74 
       
    75     @param aOptionLevel Identifier for the option level
       
    76     @param aOptionName Identifier for the option name
       
    77     @param aOption A buffer either containing the option data to be set, or to receive option data
       
    78     @param aPlatsecItf A pointer to an MPlatsecApiExt interface.
       
    79 
       
    80     @return KErrNone if the control option has been processed successfully.
       
    81     KErrNotSupported if the control option is not understood. It will be automatically forwarded down
       
    82     to the next Control Provider in this case.
       
    83     Any other system-wide error code will complete the client message with the error code returned.
       
    84     */
       
    85     virtual TInt ControlL(TUint aOptionLevel, TUint aOptionName, TDes8& aOption, MPlatsecApiExt* aPlatsecItf) = 0;
       
    86     };
       
    87 
       
    88 class CLegacyEnumerateSubConnectionsResponder;
       
    89 
       
    90 /**
       
    91 	API Extension for IsSubConnectionActive
       
    92 
       
    93 	@internalTechnology
       
    94 */
       
    95 class ALegacyEnumerateSubConnectionsApiExt : public AExtensionInterfaceThickBase
       
    96     {
       
    97 public:
       
    98 	static const TInt KInterfaceId = ELegacyEnumerateSubConnectionsApiExt;
       
    99 
       
   100     virtual void EnumerateSubConnections(CLegacyEnumerateSubConnectionsResponder*& aResponder) = 0;
       
   101 	virtual void GetSubConnectionInfo(TSubConnectionInfo &aInfo) = 0;
       
   102 	
       
   103 protected:
       
   104 	ALegacyEnumerateSubConnectionsApiExt()
       
   105 		: AExtensionInterfaceThickBase(Meta::STypeId::CreateSTypeId() /* Null value used here - internal messages */)
       
   106 		{
       
   107 		}
       
   108     };
       
   109 
       
   110 const TUint KMicrosecondsInASecond = 1000000;
       
   111 const TInt KMaxTimerPeriod = KMaxTInt32 / KMicrosecondsInASecond; //< max period of a CTimer using After()
       
   112 const TUint KActivityTimerPriority = EPriorityLow;	// Checking for connection activity is only a low priority task
       
   113 
       
   114 struct CClientRequest;
       
   115 class CLegacySubConnectionActiveResponder;
       
   116 /*
       
   117 	An extension interface supporting calls to RConnection::(IsConnectionActive()/
       
   118 	IsSubConnectionActive()).  Derives from AExtensionInterfaceThickBase to get
       
   119 	behaviour compatible with other 'real' IPC client supporting extension
       
   120 	interfaces such as data monitoring and bearer mobility.
       
   121 
       
   122 	Note: while this class derives from AExtensionInterfaceThickBase, it supplies
       
   123 	a null value for the message implementation uid. to the base constructor as
       
   124 	the mechanism for just-in-time loading of messages via ECOM is not required.
       
   125 	The messages are part of esocksvr.
       
   126 
       
   127 	@internalTechnology
       
   128 */
       
   129 class ALegacySubConnectionActiveApiExt : public AExtensionInterfaceThickBase
       
   130     {
       
   131 public:
       
   132 	static const TInt KInterfaceId = ELegacySubConnectionActiveApiExt;
       
   133 
       
   134 public:
       
   135 	IMPORT_C void CancelExtensionInterface(TSubSessionUniqueId aClientId);
       
   136     void IsSubConnectionActiveRequest(CLegacySubConnectionActiveResponder& aResponder);
       
   137     void CancelIsSubConnectionActiveRequest(TSubSessionUniqueId aClientId);
       
   138     void CheckSubConnectionActivityL(CClientRequest* aRequest);
       
   139 
       
   140 protected:
       
   141 	ALegacySubConnectionActiveApiExt(Messages::ANode* aParent)
       
   142 		: AExtensionInterfaceThickBase(Meta::STypeId::CreateSTypeId()/* Null value used here - internal messages */), iParent(aParent)
       
   143 		{
       
   144 		}
       
   145 
       
   146 	IMPORT_C virtual ~ALegacySubConnectionActiveApiExt();
       
   147 
       
   148 private:
       
   149 	Messages::ANode* iParent;
       
   150 	RPointerArray<CClientRequest> iRequests;
       
   151     };
       
   152 
       
   153 
       
   154 NONSHARABLE_CLASS(CActivityTimer) : public CTimer
       
   155 	{
       
   156 public:
       
   157 	static CActivityTimer* NewL(ALegacySubConnectionActiveApiExt& aOwner, CClientRequest* aRequest, TInt aPriority);
       
   158 	~CActivityTimer() {};
       
   159 	void RunL();
       
   160 
       
   161 private:
       
   162 	inline CActivityTimer(ALegacySubConnectionActiveApiExt& aOwner, CClientRequest* aRequest, TInt aPriority) :
       
   163 		CTimer(aPriority), iOwner(aOwner), iRequest(aRequest)
       
   164 		{
       
   165 		CActiveScheduler::Add(this);
       
   166 		}
       
   167 
       
   168 private:
       
   169 	ALegacySubConnectionActiveApiExt& iOwner;
       
   170 	CClientRequest* iRequest;
       
   171 	};
       
   172 
       
   173 
       
   174 NONSHARABLE_STRUCT(CClientRequest) : public CBase
       
   175 	{
       
   176 	CClientRequest(TSubSessionUniqueId aClientId, CLegacySubConnectionActiveResponder& aResponder)
       
   177 		: iClientId(aClientId), iResponder(&aResponder)
       
   178 		{
       
   179 		}
       
   180 
       
   181 	~CClientRequest();
       
   182 	
       
   183 	void SubConnectionActive(TBool aState);
       
   184 
       
   185 	TSubSessionUniqueId iClientId;
       
   186 	TUint iInitialSentVolume;
       
   187 	TUint iInitialReceivedVolume;
       
   188 	CActivityTimer* iTimer;
       
   189 	CLegacySubConnectionActiveResponder* iResponder;
       
   190 	};
       
   191 
       
   192 /**
       
   193 API Extension for Progress
       
   194 @internalComponent
       
   195 */
       
   196 class MLinkCprApiExt
       
   197     {
       
   198 public:
       
   199 	static const TInt KInterfaceId = 0x102864D6;
       
   200 
       
   201     typedef TPckgBuf<Elements::TStateChange> TProgressBuf;
       
   202 
       
   203     virtual void ProgressL(TProgressBuf& aBuffer) const = 0;
       
   204     virtual void LastProgressError(TProgressBuf& aBuffer) = 0;
       
   205 	virtual TInt AllSubConnectionNotificationEnable() = 0;
       
   206     };
       
   207 
       
   208 /**
       
   209 API Extension for Service Change Notification.
       
   210 @internalComponent
       
   211 */
       
   212 class MLinkCprServiceChangeNotificationApiExt
       
   213     {
       
   214 public:
       
   215 	static const TInt KInterfaceId = 0x102864DF;
       
   216 
       
   217     virtual void RequestServiceChangeNotificationL(const Messages::TNodeId& aSender, RLegacyResponseMsg& aResponse) = 0;
       
   218     virtual void CancelServiceChangeNotification(const Messages::TNodeId& aSender) = 0;
       
   219     };
       
   220 
       
   221 
       
   222 /** Utility class pairing the legacy connection info for IPC client enumeration with the connection provider that provided it
       
   223 */
       
   224 class TSourcedConnectionInfo : public TConnectionInfoV2
       
   225 	{
       
   226 public:
       
   227 	inline TSourcedConnectionInfo(TUint32 aIapId, TUint32 aNetId, TConnectionType aConnectionType, const Messages::TNodeId& aCPRId)
       
   228 		: TConnectionInfoV2(aIapId, aNetId, aConnectionType),
       
   229 		  iProvider(aCPRId)
       
   230 		{ }
       
   231 	inline const Messages::TNodeId& Provider() const
       
   232 		{ return iProvider; }
       
   233 private:
       
   234 	Messages::TNodeId iProvider;
       
   235 	};
       
   236 
       
   237 
       
   238 /**
       
   239 API Extension for Enumerating Connections.
       
   240 @internalComponent
       
   241 */
       
   242 class MLinkCprFactApiExt
       
   243     {
       
   244 public:
       
   245 	static const TInt KInterfaceId = 0x102864D7;
       
   246 
       
   247 	virtual void EnumerateConnectionsL(RPointerArray<TSourcedConnectionInfo>& aConnectionInfoPtrArray) = 0;
       
   248     };
       
   249 
       
   250 } //namespace ESock
       
   251 
       
   252 
       
   253 
       
   254 #endif
       
   255 // SS_LEGACYINTERFACES_H_INCLUDED
       
   256