epoc32/include/comms-infras/ss_datatransfer.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
//
williamr@4
    15
williamr@4
    16
/**
williamr@4
    17
 @file 
williamr@4
    18
 @internalTechnology 
williamr@4
    19
*/
williamr@4
    20
williamr@4
    21
#if !defined(__SS_DATATRANSFER_H__)
williamr@4
    22
#define __SS_DATATRANSFER_H__
williamr@4
    23
williamr@4
    24
#include <e32def.h>
williamr@4
    25
#include <e32base.h>
williamr@4
    26
williamr@4
    27
/**
williamr@4
    28
 Interface that any sub-connection client wishing to get data notification must implement
williamr@4
    29
 @released Since 9.1
williamr@4
    30
 @internalTechnology
williamr@4
    31
 */
williamr@4
    32
class MConnDataTransferNotify
williamr@4
    33
	{
williamr@4
    34
public:
williamr@4
    35
	/**
williamr@4
    36
	 Override this to receive notification for data transfered, to allow any absolute volume 
williamr@4
    37
	 notifications that may be outstanding to be completed if the required amount of data has been 
williamr@4
    38
	 sent/received
williamr@4
    39
williamr@4
    40
	 @param aUplinkVolume The total volume of data sent on this subconnection
williamr@4
    41
	 @param aDownlinkVolume The total volume of data received on this subconnection
williamr@4
    42
	 @return KErrNone, or one of the system-wide error codes
williamr@4
    43
	 @see CConnDataTransfer::DataTransferred
williamr@4
    44
	 */
williamr@4
    45
	virtual TInt NotifyDataTransferred(const TUint aUplinkVolume, const TUint aDownlinkVolume) = 0;
williamr@4
    46
	
williamr@4
    47
	/**	 	 
williamr@4
    48
	 Override this to update the sent bytes count, and if necessary complete any outstanding RMessages
williamr@4
    49
	 
williamr@4
    50
	 @param aUplinkVolume The total number of bytes sent on this subconnection
williamr@4
    51
	 @param aCurrentGranularity Requested granularity
williamr@4
    52
	 @return KErrNone, or one of the system-wide error codes
williamr@4
    53
	 */	 	
williamr@4
    54
	virtual TInt NotifyDataSent(TUint aUplinkVolume, TUint aCurrentGranularity) = 0;
williamr@4
    55
	
williamr@4
    56
	/**
williamr@4
    57
	 Override this to update the received bytes count, and if necessary complete any outstanding RMessages
williamr@4
    58
williamr@4
    59
	 @param aDownlinkVolume The total number of bytes sent on the sub-connection
williamr@4
    60
	 @param aCurrentGranularity The currently set granularity of notifications
williamr@4
    61
	 */
williamr@4
    62
	virtual TInt NotifyDataReceived(TUint aDownlinkVolume, TUint aCurrentGranularity) = 0;
williamr@4
    63
	};
williamr@4
    64
	
williamr@4
    65
/**
williamr@4
    66
 Base class that any sub-connection client wishing to get sub-connection related data statitics must implement
williamr@4
    67
 @released Since 9.1
williamr@4
    68
 @internalTechnology
williamr@4
    69
 */
williamr@4
    70
class CConnDataTransfer : public CBase
williamr@4
    71
	{
williamr@4
    72
protected:
williamr@4
    73
	IMPORT_C CConnDataTransfer();
williamr@4
    74
	
williamr@4
    75
public:
williamr@4
    76
	IMPORT_C TInt DataTransferred(TUint& aUplinkVolume, TUint& aDownlinkVolume);
williamr@4
    77
	IMPORT_C TInt DataTransferredCancel();
williamr@4
    78
	IMPORT_C TInt DataSentNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume);
williamr@4
    79
	IMPORT_C TInt DataSentNotificationCancel();
williamr@4
    80
	IMPORT_C TInt DataReceivedNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume);
williamr@4
    81
	IMPORT_C TInt DataReceivedNotificationCancel();
williamr@4
    82
williamr@4
    83
	IMPORT_C void RegisterClientL( MConnDataTransferNotify& aClient );
williamr@4
    84
	IMPORT_C void DeRegisterClient( MConnDataTransferNotify& aClient );
williamr@4
    85
	
williamr@4
    86
protected:
williamr@4
    87
	/**
williamr@4
    88
	 Override this to register for data transfer notification on the sub-connection
williamr@4
    89
	 
williamr@4
    90
	 @param aUplinkVolume On return, contains the amount of data sent on this subconnection
williamr@4
    91
	 @param aDownlinkVolume On return, contains the amount of data received on this subconnection
williamr@4
    92
	 @return KErrNone if successful, otherwise one of the system-wide error codes
williamr@4
    93
	 */
williamr@4
    94
	virtual TInt DoDataTransferred(TUint& aUplinkVolume, TUint& aDownlinkVolume) = 0;
williamr@4
    95
	
williamr@4
    96
	/**
williamr@4
    97
	 Override this to cancel a request for data transfer information
williamr@4
    98
	 
williamr@4
    99
	 @return ETrue to indicate that the operation is completed here
williamr@4
   100
	 */
williamr@4
   101
	virtual TInt DoDataTransferredCancel() = 0;
williamr@4
   102
	
williamr@4
   103
	/**
williamr@4
   104
	 Override this to receive a request for a notification after a given volume of data has been sent on the sub-connection
williamr@4
   105
	 
williamr@4
   106
	 @param aRequestedGranularity The amount of data to be sent after which the notification will occur (but see notes); 
williamr@4
   107
	 this is relative to the current volume of data sent
williamr@4
   108
	 @param aRequestedNotificationVolume The absolute amount of data that should be sent before we send a notification; only used if aRequestedGranularity is zero
williamr@4
   109
	 @return KErrNone, or one of the system-wide error codes
williamr@4
   110
	 */
williamr@4
   111
	virtual TInt DoDataSentNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume) = 0;
williamr@4
   112
	
williamr@4
   113
	/**
williamr@4
   114
	 Override this to remove the additional notification that this request would have generated
williamr@4
   115
	 
williamr@4
   116
	 @return KErrNone, or one of the system-wide error codes
williamr@4
   117
	 */
williamr@4
   118
	virtual TInt DoDataSentNotificationCancel() = 0;
williamr@4
   119
	
williamr@4
   120
	/**
williamr@4
   121
	 Override this to receive a request for a notification after a given volume of data has been received on the sub-connection
williamr@4
   122
	 
williamr@4
   123
	 @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
williamr@4
   124
	 @param aRequestedNotificationVolume The absolute amount of data that should be received before we send a notification; only used if aRequestedGranularity is zero
williamr@4
   125
	 @return KErrNone, or one of the system-wide error codes
williamr@4
   126
	 */	
williamr@4
   127
	virtual TInt DoDataReceivedNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume) = 0;
williamr@4
   128
	
williamr@4
   129
	/**
williamr@4
   130
	 Override this to remove the additional notification that this request would have generated
williamr@4
   131
	 
williamr@4
   132
	 @return KErrNone, or one of the system-wide error codes
williamr@4
   133
	 */
williamr@4
   134
	virtual TInt DoDataReceivedNotificationCancel() = 0;
williamr@4
   135
williamr@4
   136
protected:
williamr@4
   137
	RPointerArray<MConnDataTransferNotify> iClients;
williamr@4
   138
	};
williamr@4
   139
	
williamr@4
   140
#endif	// __SS_DATATRANSFER_H__
williamr@4
   141