epoc32/include/comms-infras/ss_datatransfer.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_datatransfer.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,141 @@
     1.4 +// Copyright (c) 2005-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 + @internalTechnology 
    1.22 +*/
    1.23 +
    1.24 +#if !defined(__SS_DATATRANSFER_H__)
    1.25 +#define __SS_DATATRANSFER_H__
    1.26 +
    1.27 +#include <e32def.h>
    1.28 +#include <e32base.h>
    1.29 +
    1.30 +/**
    1.31 + Interface that any sub-connection client wishing to get data notification must implement
    1.32 + @released Since 9.1
    1.33 + @internalTechnology
    1.34 + */
    1.35 +class MConnDataTransferNotify
    1.36 +	{
    1.37 +public:
    1.38 +	/**
    1.39 +	 Override this to receive notification for data transfered, to allow any absolute volume 
    1.40 +	 notifications that may be outstanding to be completed if the required amount of data has been 
    1.41 +	 sent/received
    1.42 +
    1.43 +	 @param aUplinkVolume The total volume of data sent on this subconnection
    1.44 +	 @param aDownlinkVolume The total volume of data received on this subconnection
    1.45 +	 @return KErrNone, or one of the system-wide error codes
    1.46 +	 @see CConnDataTransfer::DataTransferred
    1.47 +	 */
    1.48 +	virtual TInt NotifyDataTransferred(const TUint aUplinkVolume, const TUint aDownlinkVolume) = 0;
    1.49 +	
    1.50 +	/**	 	 
    1.51 +	 Override this to update the sent bytes count, and if necessary complete any outstanding RMessages
    1.52 +	 
    1.53 +	 @param aUplinkVolume The total number of bytes sent on this subconnection
    1.54 +	 @param aCurrentGranularity Requested granularity
    1.55 +	 @return KErrNone, or one of the system-wide error codes
    1.56 +	 */	 	
    1.57 +	virtual TInt NotifyDataSent(TUint aUplinkVolume, TUint aCurrentGranularity) = 0;
    1.58 +	
    1.59 +	/**
    1.60 +	 Override this to update the received bytes count, and if necessary complete any outstanding RMessages
    1.61 +
    1.62 +	 @param aDownlinkVolume The total number of bytes sent on the sub-connection
    1.63 +	 @param aCurrentGranularity The currently set granularity of notifications
    1.64 +	 */
    1.65 +	virtual TInt NotifyDataReceived(TUint aDownlinkVolume, TUint aCurrentGranularity) = 0;
    1.66 +	};
    1.67 +	
    1.68 +/**
    1.69 + Base class that any sub-connection client wishing to get sub-connection related data statitics must implement
    1.70 + @released Since 9.1
    1.71 + @internalTechnology
    1.72 + */
    1.73 +class CConnDataTransfer : public CBase
    1.74 +	{
    1.75 +protected:
    1.76 +	IMPORT_C CConnDataTransfer();
    1.77 +	
    1.78 +public:
    1.79 +	IMPORT_C TInt DataTransferred(TUint& aUplinkVolume, TUint& aDownlinkVolume);
    1.80 +	IMPORT_C TInt DataTransferredCancel();
    1.81 +	IMPORT_C TInt DataSentNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume);
    1.82 +	IMPORT_C TInt DataSentNotificationCancel();
    1.83 +	IMPORT_C TInt DataReceivedNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume);
    1.84 +	IMPORT_C TInt DataReceivedNotificationCancel();
    1.85 +
    1.86 +	IMPORT_C void RegisterClientL( MConnDataTransferNotify& aClient );
    1.87 +	IMPORT_C void DeRegisterClient( MConnDataTransferNotify& aClient );
    1.88 +	
    1.89 +protected:
    1.90 +	/**
    1.91 +	 Override this to register for data transfer notification on the sub-connection
    1.92 +	 
    1.93 +	 @param aUplinkVolume On return, contains the amount of data sent on this subconnection
    1.94 +	 @param aDownlinkVolume On return, contains the amount of data received on this subconnection
    1.95 +	 @return KErrNone if successful, otherwise one of the system-wide error codes
    1.96 +	 */
    1.97 +	virtual TInt DoDataTransferred(TUint& aUplinkVolume, TUint& aDownlinkVolume) = 0;
    1.98 +	
    1.99 +	/**
   1.100 +	 Override this to cancel a request for data transfer information
   1.101 +	 
   1.102 +	 @return ETrue to indicate that the operation is completed here
   1.103 +	 */
   1.104 +	virtual TInt DoDataTransferredCancel() = 0;
   1.105 +	
   1.106 +	/**
   1.107 +	 Override this to receive a request for a notification after a given volume of data has been sent on the sub-connection
   1.108 +	 
   1.109 +	 @param aRequestedGranularity The amount of data to be sent after which the notification will occur (but see notes); 
   1.110 +	 this is relative to the current volume of data sent
   1.111 +	 @param aRequestedNotificationVolume The absolute amount of data that should be sent before we send a notification; only used if aRequestedGranularity is zero
   1.112 +	 @return KErrNone, or one of the system-wide error codes
   1.113 +	 */
   1.114 +	virtual TInt DoDataSentNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume) = 0;
   1.115 +	
   1.116 +	/**
   1.117 +	 Override this to remove the additional notification that this request would have generated
   1.118 +	 
   1.119 +	 @return KErrNone, or one of the system-wide error codes
   1.120 +	 */
   1.121 +	virtual TInt DoDataSentNotificationCancel() = 0;
   1.122 +	
   1.123 +	/**
   1.124 +	 Override this to receive a request for a notification after a given volume of data has been received on the sub-connection
   1.125 +	 
   1.126 +	 @param aRequestedGranularity The amount of data to be received after which the notification will occur (but see notes); this is relative to the current volume of data received
   1.127 +	 @param aRequestedNotificationVolume The absolute amount of data that should be received before we send a notification; only used if aRequestedGranularity is zero
   1.128 +	 @return KErrNone, or one of the system-wide error codes
   1.129 +	 */	
   1.130 +	virtual TInt DoDataReceivedNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume) = 0;
   1.131 +	
   1.132 +	/**
   1.133 +	 Override this to remove the additional notification that this request would have generated
   1.134 +	 
   1.135 +	 @return KErrNone, or one of the system-wide error codes
   1.136 +	 */
   1.137 +	virtual TInt DoDataReceivedNotificationCancel() = 0;
   1.138 +
   1.139 +protected:
   1.140 +	RPointerArray<MConnDataTransferNotify> iClients;
   1.141 +	};
   1.142 +	
   1.143 +#endif	// __SS_DATATRANSFER_H__
   1.144 +