epoc32/include/comms-infras/ss_connlegacy.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/comms-infras/ss_connlegacy.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,225 @@
     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 "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.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 + @file
    1.21 + @internalComponent
    1.22 +*/
    1.23 +
    1.24 +#ifndef __SS_CONNLEGACY_H__
    1.25 +#define __SS_CONNLEGACY_H__
    1.26 +
    1.27 +#include <e32def.h>
    1.28 +#include <elements/factorynotify.h>
    1.29 +#include <es_sock.h> //TNifProgressBuf & co
    1.30 +#include <es_prot.h> //TConnStartType &co
    1.31 +#include <ss_std.h>
    1.32 +#include <comms-infras/ss_nodemessages_legacy.h>
    1.33 +#include <comms-infras/ss_nodemessages_legacy_internal.h>
    1.34 +#include <comms-infras/ss_legacyinterfaces.h>
    1.35 +
    1.36 +class TSockOpt;
    1.37 +class CActivityTimer;
    1.38 +
    1.39 +const TInt KNifEMCompatibilityLayerEntireSubConnectionUid = 0;
    1.40 +const TInt KNifEMCompatibilityLayerFakeSubConnectionId = 1;
    1.41 +
    1.42 +namespace ConnStates
    1.43 +{
    1.44 +class TProcessEnumResponse;
    1.45 +class TNoTagOrCancelAllInterfaceWorker;
    1.46 +class TCancelAllInterfaceNotificationWorker;
    1.47 +}
    1.48 +
    1.49 +namespace AllInterfaceNotificationActivity
    1.50 +{
    1.51 +class TEnqueueNotification;
    1.52 +class TSendErrorToConnection;
    1.53 +}
    1.54 +
    1.55 +namespace EnumerateConnectionsActivity
    1.56 +{
    1.57 +class TQueryTierStatus;
    1.58 +class TCacheConnectionInfo;
    1.59 +class TCompleteClient;
    1.60 +}
    1.61 +
    1.62 +namespace ESock
    1.63 +{
    1.64 +class ADataMonitoringProvider;
    1.65 +class CSubConnection;
    1.66 +class CConnManager;
    1.67 +class CConnectionProviderBase;
    1.68 +class CActivityTimer;
    1.69 +class TSelectionPrefs;
    1.70 +class TLegacyConnectionEnumRequest;
    1.71 +class CLegacySubConnectionActiveResponder;
    1.72 +
    1.73 +/**
    1.74 +Server side class representing an RConnection legacy API
    1.75 +@internalComponent
    1.76 +*/
    1.77 +NONSHARABLE_CLASS(AConnectionLegacy)
    1.78 +	{
    1.79 +	friend class CConnection;
    1.80 +	friend class CSockSession;
    1.81 +	friend class Factories::TFactoryNotify<AConnectionLegacy>;
    1.82 +	friend class CActivityTimer;
    1.83 +	friend class ConnStates::TProcessEnumResponse;
    1.84 +	friend class TLegacyConnectionEnumRequest;
    1.85 +	friend class EnumerateConnectionsActivity::TQueryTierStatus;
    1.86 +	friend class EnumerateConnectionsActivity::TCacheConnectionInfo;
    1.87 +	friend class EnumerateConnectionsActivity::TCompleteClient;
    1.88 +	friend class AllInterfaceNotificationActivity::TEnqueueNotification;
    1.89 +	friend class AllInterfaceNotificationActivity::TSendErrorToConnection;
    1.90 +	friend class ConnStates::TNoTagOrCancelAllInterfaceWorker;
    1.91 +	friend class ConnStates::TCancelAllInterfaceNotificationWorker;
    1.92 +
    1.93 +public: //So that friends of CConnection (transitions) can access it
    1.94 +	void CompleteAttachL(TSelectionPrefs& aPrefs);
    1.95 +	void CancelServiceChangeNotification(const Den::RSafeMessage& aMessage);
    1.96 +    void SubConnectionEvent(const TSubConnectionEvent& aSubConnectionEvent);
    1.97 +
    1.98 +protected:
    1.99 +    AConnectionLegacy(CConnection& aConnection) :
   1.100 +        iConnection(aConnection)
   1.101 +            {
   1.102 +            iServiceChangeNotificationPending = EFalse;
   1.103 +            }
   1.104 +
   1.105 +    ~AConnectionLegacy();
   1.106 +	TInt ProcessMessageL(const RMessage2& aMessage);
   1.107 +	void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage); //Only called from CConnection::ReceivedL
   1.108 +
   1.109 +private:
   1.110 +	// Underlying implementations of individual RConnection methods
   1.111 +	void StopL(const RMessage2& aMessage);
   1.112 +
   1.113 +	void GetIntSettingL(const Den::RSafeMessage& aMessage);
   1.114 +	void GetBoolSettingL(const Den::RSafeMessage& aMessage);
   1.115 +	void GetDes8SettingL(const Den::RSafeMessage& aMessage);
   1.116 +	void GetDes16SettingL(const Den::RSafeMessage& aMessage);
   1.117 +	void GetLongDesSettingL(const Den::RSafeMessage& aMessage);
   1.118 +	void GetConnectionInfoL(const RMessage2& aMessage);
   1.119 +
   1.120 +	void AllInterfaceNotificationL(const RMessage2& aMessage);
   1.121 +	void CompleteAllInterfaceNotificationL(TInt aError);
   1.122 +	void CancelAllInterfaceNotification();
   1.123 +
   1.124 +	void DataTransferredL(const Den::RSafeMessage& aMessage);
   1.125 +	void DataSentNotificationRequestL(const Den::RSafeMessage& aMessage);
   1.126 +	void DataSentNotificationCancel(const Den::RSafeMessage& aMessage);
   1.127 +	void DataReceivedNotificationRequestL(const Den::RSafeMessage& aMessage);
   1.128 +	void DataReceivedNotificationCancel(const Den::RSafeMessage& aMessage);
   1.129 +	void DataMonitoringNotificationRequestL(const Den::RSafeMessage& aMessage, TDataMonitoringDirection aDirection);
   1.130 +	void DataMonitoringNotificationCancel(const Den::RSafeMessage& aMessage, TDataMonitoringDirection aDirection);
   1.131 +
   1.132 +	void IsSubConnectionActiveRequestL(const Den::RSafeMessage& aMessage);
   1.133 +	void IsSubConnectionActiveCancel(const Den::RSafeMessage& aMessage);
   1.134 +
   1.135 +	void ExtractEnumInfoL(RBuf8& aBuffer, TUint aCount, TInt aSize, TUint aIndex, TDes8& aPckg);
   1.136 +	void EnumerateConnectionClientsL();
   1.137 +	void GetConnectionClientInfoL();
   1.138 +	void RequestDataPlaneEnumerationL(TLegacyConnEnumClients aClientType);
   1.139 +	void EnumerateConnectionSocketsL();
   1.140 +	void CompleteDataPlaneEnumeration(const Messages::TNodeId& aPeer, TInt aCount, HBufC8* aInfo, TInt aError);
   1.141 +	void GetConnectionSocketInfoL();
   1.142 +    void ServiceChangeNotification(TUint32 aId, const TDesC& aType);
   1.143 +	void FinalCompleteAllBlockedMessages(TInt aResult);
   1.144 +	void CancelProviderRequests();
   1.145 +
   1.146 +
   1.147 +#ifndef AVAILABILITY_READY
   1.148 +	void EnumerateConnectionsL(const RMessage2& aMessage);
   1.149 +#endif
   1.150 +
   1.151 +	// SubConnection-oriented RConnection method support
   1.152 +	void EnumerateSubConnectionsL(const Den::RSafeMessage& aMessage);
   1.153 +	void GetSubConnectionInfoL(const Den::RSafeMessage& aMessage);
   1.154 +
   1.155 +	static TBool DoesConnectionInfoExist(const TDesC8& aInfoBuf, const TConnectionClientInfo& aInfo);
   1.156 +protected:
   1.157 +	ADataMonitoringProvider* FetchConnDataMonitoringProvider() const;
   1.158 +	ADataMonitoringProvider* FetchSubConnDataMonitoringProvider() const;
   1.159 +
   1.160 +	//global notifications
   1.161 +	void InterfaceStateChangeNotification(TDesC8& aInfo);
   1.162 +	void RequestServiceChangeNotificationL(const Den::RSafeMessage& aMessage);
   1.163 +    void ControlL(TUint aOptionName, TUint aMessageId);
   1.164 +
   1.165 +	// Underlying implementations of individual RConnection methods relating to subconnections
   1.166 +    void AllSubConnectionNotificationL();
   1.167 +    void CancelAllSubConnectionNotification();
   1.168 +
   1.169 +private:
   1.170 +	RMessage2 iAllSubConnectionNotificationMessage;
   1.171 +
   1.172 +	TInterfaceChangeQueue iInterfaceChangeQueue;	// queue of interface notifications received
   1.173 +
   1.174 +	TUint iConnectionInfoCount;
   1.175 +	TUint iConnectionClientCount;
   1.176 +	RBuf8 iConnectionClientBuf;
   1.177 +	TUint iConnectionSocketCount;
   1.178 +	RBuf8 iConnectionSocketBuf;
   1.179 +	Den::RSafeMessage iEnumConnMsg;	//< During a Data plane enum holds blocked client msg
   1.180 +	TUint* iDPEnumCount;					//< During a Data plane enum points to count recipient
   1.181 +	RBuf8* iDPEnumBuf;				//< During a Data plane enum points to data buf
   1.182 +	RArray<Messages::TNodeId> iEnumConnSockCandidateSCPRs;	//< During a Data plane enum is list of SCPRs for connection
   1.183 +
   1.184 +    RMessage2* iMessage; //current message valid only within ProcessMessageL call
   1.185 +    CConnection& iConnection;
   1.186 +
   1.187 +	RPointerArray<CSubConnection> iSubConnections; //client classes servicing sub-connection
   1.188 +	                //related functionality requested via legacy RConnection API. sub-connections
   1.189 +	                //objects are owned by AConnectionLegacy instance and don't have RSubConnection
   1.190 +	                //client side.
   1.191 +	CConnManager* iConnManager; //client class servicing connection manager
   1.192 +	                //related functionality requested via legacy RConnection API. CConnManager
   1.193 +	                //object is owned by AConnectionLegacy instance and does't have RConnManager
   1.194 +	                //client side.
   1.195 +	// Flags for pending RConnection requests
   1.196 +	TBool iServiceChangeNotificationPending;
   1.197 +
   1.198 +	// IsSubConnectionActive support
   1.199 +	ADataMonitoringProvider* iConnActivityDataMonProv;
   1.200 +	ESock::CActivityTimer* iActivityTimer;
   1.201 +	TBool iClientsSubConnectionActiveState;
   1.202 +	TUint iInitialSentDataVolume;
   1.203 +	TUint iInitialReceivedDataVolume;
   1.204 +	TUint iRequestedClientActivityTimerPeriod;
   1.205 +	TBool iOutstandingIsSubConnectionActiveRequest;
   1.206 +	RMessage2 iOutstandingIsSubConnectionActiveMessage;
   1.207 +
   1.208 +	TBool iDeferredSubConnectionNotificationEnable;
   1.209 +	TSubConnectionEventQueue iSubConnectionEventQueue; // queue of subconnection events received
   1.210 +
   1.211 +	// EnumerateConnection and GetConnectionInfo use this.
   1.212 +	RPointerArray<TSourcedConnectionInfo> iConnectionInfoPtrArray;
   1.213 +
   1.214 +	// AllInterfaceNotification support
   1.215 +	RMessage2 iAllInterfaceNotificationMessage;
   1.216 +	TInterfaceChangeQueue iNotificationQueue;
   1.217 +  	Messages::TNodeId iAllInterfaceNotificationWorker;
   1.218 +  	
   1.219 +protected:
   1.220 +	static const TAnyFn iInterfaceVTableF[];
   1.221 +	};
   1.222 +
   1.223 +
   1.224 +} //namespace ESock
   1.225 +
   1.226 +#endif
   1.227 +// __SS_CONNLEGACY_H__
   1.228 +