williamr@4: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@4: // All rights reserved. williamr@4: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@4: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: // williamr@4: // Initial Contributors: williamr@4: // Nokia Corporation - initial contribution. williamr@4: // williamr@4: // Contributors: williamr@4: // williamr@4: // Description: williamr@4: // williamr@4: williamr@4: /** williamr@4: @file williamr@4: @internalTechnology williamr@4: */ williamr@4: williamr@4: #if !defined(__SS_DATATRANSFER_H__) williamr@4: #define __SS_DATATRANSFER_H__ williamr@4: williamr@4: #include williamr@4: #include williamr@4: williamr@4: /** williamr@4: Interface that any sub-connection client wishing to get data notification must implement williamr@4: @released Since 9.1 williamr@4: @internalTechnology williamr@4: */ williamr@4: class MConnDataTransferNotify williamr@4: { williamr@4: public: williamr@4: /** williamr@4: Override this to receive notification for data transfered, to allow any absolute volume williamr@4: notifications that may be outstanding to be completed if the required amount of data has been williamr@4: sent/received williamr@4: williamr@4: @param aUplinkVolume The total volume of data sent on this subconnection williamr@4: @param aDownlinkVolume The total volume of data received on this subconnection williamr@4: @return KErrNone, or one of the system-wide error codes williamr@4: @see CConnDataTransfer::DataTransferred williamr@4: */ williamr@4: virtual TInt NotifyDataTransferred(const TUint aUplinkVolume, const TUint aDownlinkVolume) = 0; williamr@4: williamr@4: /** williamr@4: Override this to update the sent bytes count, and if necessary complete any outstanding RMessages williamr@4: williamr@4: @param aUplinkVolume The total number of bytes sent on this subconnection williamr@4: @param aCurrentGranularity Requested granularity williamr@4: @return KErrNone, or one of the system-wide error codes williamr@4: */ williamr@4: virtual TInt NotifyDataSent(TUint aUplinkVolume, TUint aCurrentGranularity) = 0; williamr@4: williamr@4: /** williamr@4: Override this to update the received bytes count, and if necessary complete any outstanding RMessages williamr@4: williamr@4: @param aDownlinkVolume The total number of bytes sent on the sub-connection williamr@4: @param aCurrentGranularity The currently set granularity of notifications williamr@4: */ williamr@4: virtual TInt NotifyDataReceived(TUint aDownlinkVolume, TUint aCurrentGranularity) = 0; williamr@4: }; williamr@4: williamr@4: /** williamr@4: Base class that any sub-connection client wishing to get sub-connection related data statitics must implement williamr@4: @released Since 9.1 williamr@4: @internalTechnology williamr@4: */ williamr@4: class CConnDataTransfer : public CBase williamr@4: { williamr@4: protected: williamr@4: IMPORT_C CConnDataTransfer(); williamr@4: williamr@4: public: williamr@4: IMPORT_C TInt DataTransferred(TUint& aUplinkVolume, TUint& aDownlinkVolume); williamr@4: IMPORT_C TInt DataTransferredCancel(); williamr@4: IMPORT_C TInt DataSentNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume); williamr@4: IMPORT_C TInt DataSentNotificationCancel(); williamr@4: IMPORT_C TInt DataReceivedNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume); williamr@4: IMPORT_C TInt DataReceivedNotificationCancel(); williamr@4: williamr@4: IMPORT_C void RegisterClientL( MConnDataTransferNotify& aClient ); williamr@4: IMPORT_C void DeRegisterClient( MConnDataTransferNotify& aClient ); williamr@4: williamr@4: protected: williamr@4: /** williamr@4: Override this to register for data transfer notification on the sub-connection williamr@4: williamr@4: @param aUplinkVolume On return, contains the amount of data sent on this subconnection williamr@4: @param aDownlinkVolume On return, contains the amount of data received on this subconnection williamr@4: @return KErrNone if successful, otherwise one of the system-wide error codes williamr@4: */ williamr@4: virtual TInt DoDataTransferred(TUint& aUplinkVolume, TUint& aDownlinkVolume) = 0; williamr@4: williamr@4: /** williamr@4: Override this to cancel a request for data transfer information williamr@4: williamr@4: @return ETrue to indicate that the operation is completed here williamr@4: */ williamr@4: virtual TInt DoDataTransferredCancel() = 0; williamr@4: williamr@4: /** williamr@4: Override this to receive a request for a notification after a given volume of data has been sent on the sub-connection williamr@4: williamr@4: @param aRequestedGranularity The amount of data to be sent after which the notification will occur (but see notes); williamr@4: this is relative to the current volume of data sent williamr@4: @param aRequestedNotificationVolume The absolute amount of data that should be sent before we send a notification; only used if aRequestedGranularity is zero williamr@4: @return KErrNone, or one of the system-wide error codes williamr@4: */ williamr@4: virtual TInt DoDataSentNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume) = 0; williamr@4: williamr@4: /** williamr@4: Override this to remove the additional notification that this request would have generated williamr@4: williamr@4: @return KErrNone, or one of the system-wide error codes williamr@4: */ williamr@4: virtual TInt DoDataSentNotificationCancel() = 0; williamr@4: williamr@4: /** williamr@4: Override this to receive a request for a notification after a given volume of data has been received on the sub-connection williamr@4: williamr@4: @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: @param aRequestedNotificationVolume The absolute amount of data that should be received before we send a notification; only used if aRequestedGranularity is zero williamr@4: @return KErrNone, or one of the system-wide error codes williamr@4: */ williamr@4: virtual TInt DoDataReceivedNotificationRequest(TUint aRequestedGranularity, TUint aRequestedNotificationVolume) = 0; williamr@4: williamr@4: /** williamr@4: Override this to remove the additional notification that this request would have generated williamr@4: williamr@4: @return KErrNone, or one of the system-wide error codes williamr@4: */ williamr@4: virtual TInt DoDataReceivedNotificationCancel() = 0; williamr@4: williamr@4: protected: williamr@4: RPointerArray iClients; williamr@4: }; williamr@4: williamr@4: #endif // __SS_DATATRANSFER_H__ williamr@4: