1.1 --- a/epoc32/include/mw/senserviceconnection.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/mw/senserviceconnection.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,17 +1,17 @@
1.4 /*
1.5 -* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
1.7 * All rights reserved.
1.8 * This component and the accompanying materials are made available
1.9 -* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* under the terms of "Eclipse Public License v1.0"
1.11 * which accompanies this distribution, and is available
1.12 -* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.13 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.14 *
1.15 * Initial Contributors:
1.16 * Nokia Corporation - initial contribution.
1.17 *
1.18 * Contributors:
1.19 *
1.20 -* Description: CSenServiceConnection offers public API for
1.21 +* Description: CSenServiceConnection offers public API for
1.22 * service consumers to access invocable services,
1.23 * as a part of the Web Services Framework (WSF).
1.24 *
1.25 @@ -25,6 +25,9 @@
1.26
1.27
1.28
1.29 +
1.30 +
1.31 +
1.32 #ifndef SEN_SERVICE_CONNECTION_H
1.33 #define SEN_SERVICE_CONNECTION_H
1.34
1.35 @@ -75,7 +78,7 @@
1.36
1.37 const TInt KErrSenAuthenticationFault = -30319;
1.38 const TInt KErrSenNoEndUserPermission = -30321;
1.39 -
1.40 +const TInt KErrSenBrandNotSupported = -30322;
1.41
1.42 const TInt KSenConnectionStatusCreateFailed = -1; // post-state
1.43 const TInt KSenConnectionStatusNew = 0; // post-state
1.44 @@ -105,6 +108,57 @@
1.45 class CSenServicePattern;
1.46 class CSenIdentityProvider;
1.47
1.48 +struct TSenDataTrafficDetails
1.49 +{
1.50 +public:
1.51 +
1.52 + TSenDataTrafficDetails():iTotalBytesSent(0),
1.53 + iTotalBytesRecieved(0)
1.54 + {
1.55 + }
1.56 +
1.57 + TBool operator==(TSenDataTrafficDetails& rhs)
1.58 + {
1.59 + if( (this->iTotalBytesSent == rhs.iTotalBytesSent) &&
1.60 + (this->iTotalBytesRecieved == rhs.iTotalBytesRecieved) )
1.61 + return ETrue;
1.62 + else
1.63 + return EFalse;
1.64 + }
1.65 +
1.66 + TSenDataTrafficDetails& operator=(TSenDataTrafficDetails& rhs)
1.67 + {
1.68 + if(*this == rhs)
1.69 + return *this;
1.70 + this->iTotalBytesSent = rhs.iTotalBytesSent;
1.71 + this->iTotalBytesRecieved = rhs.iTotalBytesRecieved;
1.72 + return *this;
1.73 + }
1.74 +
1.75 + TSenDataTrafficDetails& operator+=(TSenDataTrafficDetails& rhs)
1.76 + {
1.77 + this->iTotalBytesSent += rhs.iTotalBytesSent;
1.78 + this->iTotalBytesRecieved += rhs.iTotalBytesRecieved;
1.79 + return *this;
1.80 + }
1.81 +
1.82 + TUint iTotalBytesSent ;
1.83 + TUint iTotalBytesRecieved ;
1.84 +private:
1.85 + TAny* iReserved;
1.86 +};
1.87 +
1.88 +struct TSenDataTrafficOperations
1.89 +{
1.90 +public:
1.91 + TSenDataTrafficOperations(): iReset(EFalse)
1.92 + {
1.93 + }
1.94 + TBool iReset;
1.95 +private:
1.96 + TAny* iReserved;
1.97 +};
1.98 +
1.99 // CLASS DECLARATION
1.100
1.101 /**
1.102 @@ -1177,6 +1231,85 @@
1.103 * @param aFilesObserver Implementation of transfer progress observer.
1.104 */
1.105
1.106 + virtual void DataTrafficDetails(TSenDataTrafficDetails& aDetails,
1.107 + TSenDataTrafficOperations& aOperations) = 0;
1.108 +
1.109 + /**
1.110 + * Service Consumer can call this method to acquire a new interface,
1.111 + * which is identified by unique ID (UID).
1.112 + * @param aUID is the UID of the interface being requested
1.113 + * @return TAny* pointer to the interface, or if no interface to
1.114 + * given UID exists, function returns NULL. In typical cases, returned
1.115 + * pointer should be cast to some preknown M-class pointer (the actual
1.116 + * new interface).
1.117 + *
1.118 + * List of currently supported interfaces:
1.119 + * KSenInterfaceUidAlrServiceConnection => MSenAlrServiceConnection
1.120 + */
1.121 + virtual TAny* InterfaceByUid( TUid aUID ) = 0;
1.122 +
1.123 + /*
1.124 + * Sends a RFile Handle to the service.
1.125 + * the Identity Based Web Service Framework (which ID is "ID-WSF")
1.126 + * and the Basic Web Services Framework (which ID is "WS-I").
1.127 + * Please note, that ID-WSF does NOT support this method.
1.128 + * SendL(const TDesC8&).
1.129 + * So, currently this method is supported only in Basic Web Services framework.
1.130 + * @param aMessage The service specific message - a full SOAP envelope
1.131 + * @return Transaction ID (positive integer) or error code, if method fails.
1.132 + * Transaction ids:
1.133 + * Positive integers SendL returns transaction ID of the request,
1.134 + * which can be later on utilized inside
1.135 + * HandleMessageL and HandleErrorL methods,
1.136 + * in order to map request and its response
1.137 + * together.
1.138 + * Error codes:
1.139 + * KErrSenNotInitialized Connection has not been initialized.
1.140 + * KErrArgument RFile handle is NULL ( Specified file doesnot exist)
1.141 + * KErrSenServiceConnectionBusy Connection is already busy with another
1.142 + * request.
1.143 + * KErrConnectionInitializing Connection is still initializing and
1.144 + * cannot yet process commands.
1.145 + * KErrConnectionExpired Connection is expired and needs to be
1.146 + * renewed.
1.147 + * KErrSubmitting An internal error has occurred.
1.148 + * KErrNoMemory Not enough memory to process the
1.149 + * message.
1.150 + * Other error codes are system-wide Symbian error codes.
1.151 + */
1.152 + virtual TInt SendL(RFile& aFileHandle) = 0;
1.153 +
1.154 + /*
1.155 + * Submits a RFile Handle to the service. This is a synchronous call,
1.156 + * returning a SOAP envelope that was received from the service.
1.157 + * There are two default frameworks available:
1.158 + * @param aResponseTo This is a ref-to-pointer where response
1.159 + * from the service will be allocated. If the
1.160 + * complete server messages mode is set to OFF,
1.161 + * then only <Body> element will be returned,
1.162 + * otherwise a complete SOAP envelope.
1.163 + * The ownership of aResponse is transfered to
1.164 + * the caller.
1.165 + * @return status/error code
1.166 + * Status codes:
1.167 + * KErrNone ok
1.168 + * Error codes:
1.169 + * KErrSenNotInitialized Connection has not been initialized.
1.170 + * KErrSenServiceConnectionBusy Connection is already busy with another
1.171 + * request.
1.172 + * KErrConnectionInitializing Connection is still initializing and
1.173 + * cannot yet process commands.
1.174 + * KErrConnectionExpired Connection is expired and needs to be
1.175 + * renewed.
1.176 + * KErrSubmitting An internal error has occurred.
1.177 + * KErrNoMemory Not enough memory to process the
1.178 + * message.
1.179 + * KErrArgument RFile handle is NULL ( Specified file doesnot exist)
1.180 + * KErrSenInternal Internal state is invalid.
1.181 + * Other error codes are system-wide Symbian error codes.
1.182 + */
1.183 + virtual TInt SubmitL(RFile& aFileHandle, HBufC8*& aResponseTo) = 0;
1.184 +
1.185 protected:
1.186
1.187 /**