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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #if !defined(__SS_DATATRANSFER_H__)
22 #define __SS_DATATRANSFER_H__
28 Interface that any sub-connection client wishing to get data notification must implement
32 class MConnDataTransferNotify
36 Override this to receive notification for data transfered, to allow any absolute volume
37 notifications that may be outstanding to be completed if the required amount of data has been
40 @param aUplinkVolume The total volume of data sent on this subconnection
41 @param aDownlinkVolume The total volume of data received on this subconnection
42 @return KErrNone, or one of the system-wide error codes
43 @see CConnDataTransfer::DataTransferred
45 virtual TInt NotifyDataTransferred(const TUint aUplinkVolume, const TUint aDownlinkVolume) = 0;
48 Override this to update the sent bytes count, and if necessary complete any outstanding RMessages
50 @param aUplinkVolume The total number of bytes sent on this subconnection
51 @param aCurrentGranularity Requested granularity
52 @return KErrNone, or one of the system-wide error codes
54 virtual TInt NotifyDataSent(TUint aUplinkVolume, TUint aCurrentGranularity) = 0;
57 Override this to update the received bytes count, and if necessary complete any outstanding RMessages
59 @param aDownlinkVolume The total number of bytes sent on the sub-connection
60 @param aCurrentGranularity The currently set granularity of notifications
62 virtual TInt NotifyDataReceived(TUint aDownlinkVolume, TUint aCurrentGranularity) = 0;
66 Base class that any sub-connection client wishing to get sub-connection related data statitics must implement
70 class CConnDataTransfer : public CBase
73 IMPORT_C CConnDataTransfer();
76 IMPORT_C TInt DataTransferred(TUint& aUplinkVolume, TUint& aDownlinkVolume);
77 IMPORT_C TInt DataTransferredCancel();
78 IMPORT_C TInt DataSentNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume);
79 IMPORT_C TInt DataSentNotificationCancel();
80 IMPORT_C TInt DataReceivedNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume);
81 IMPORT_C TInt DataReceivedNotificationCancel();
83 IMPORT_C void RegisterClientL( MConnDataTransferNotify& aClient );
84 IMPORT_C void DeRegisterClient( MConnDataTransferNotify& aClient );
88 Override this to register for data transfer notification on the sub-connection
90 @param aUplinkVolume On return, contains the amount of data sent on this subconnection
91 @param aDownlinkVolume On return, contains the amount of data received on this subconnection
92 @return KErrNone if successful, otherwise one of the system-wide error codes
94 virtual TInt DoDataTransferred(TUint& aUplinkVolume, TUint& aDownlinkVolume) = 0;
97 Override this to cancel a request for data transfer information
99 @return ETrue to indicate that the operation is completed here
101 virtual TInt DoDataTransferredCancel() = 0;
104 Override this to receive a request for a notification after a given volume of data has been sent on the sub-connection
106 @param aRequestedGranularity The amount of data to be sent after which the notification will occur (but see notes);
107 this is relative to the current volume of data sent
108 @param aRequestedNotificationVolume The absolute amount of data that should be sent before we send a notification; only used if aRequestedGranularity is zero
109 @return KErrNone, or one of the system-wide error codes
111 virtual TInt DoDataSentNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume) = 0;
114 Override this to remove the additional notification that this request would have generated
116 @return KErrNone, or one of the system-wide error codes
118 virtual TInt DoDataSentNotificationCancel() = 0;
121 Override this to receive a request for a notification after a given volume of data has been received on the sub-connection
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
124 @param aRequestedNotificationVolume The absolute amount of data that should be received before we send a notification; only used if aRequestedGranularity is zero
125 @return KErrNone, or one of the system-wide error codes
127 virtual TInt DoDataReceivedNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume) = 0;
130 Override this to remove the additional notification that this request would have generated
132 @return KErrNone, or one of the system-wide error codes
134 virtual TInt DoDataReceivedNotificationCancel() = 0;
137 RPointerArray<MConnDataTransferNotify> iClients;
140 #endif // __SS_DATATRANSFER_H__