epoc32/include/mw/msenserviceconsumer.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/msenserviceconsumer.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/msenserviceconsumer.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,117 @@
     1.4 -msenserviceconsumer.h
     1.5 +/*
     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 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description: Callback interface for service consumers        
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +#ifndef M_SEN_SERVICE_CONSUMER_H
    1.23 +#define M_SEN_SERVICE_CONSUMER_H
    1.24 +
    1.25 +const TUid KSenInterfaceUidFilesObserver            = { 0x101F9742 }; // MSenFilesObserver
    1.26 +const TUid KSenInterfaceUidAuthenticationProvider   = { 0x10282C6F }; // MSenAuthenticationProvider
    1.27 +// CLASS DECLARATION
    1.28 +
    1.29 +/**
    1.30 + * Callback interface for service consumers
    1.31 + */
    1.32 +class MSenServiceConsumer
    1.33 +    {
    1.34 +    public: 
    1.35 +        
    1.36 +        // New functions
    1.37 +        
    1.38 +        /**
    1.39 +        * Callback, which is invoked when a message is received from invoked service.
    1.40 +        * Inside this method, it is guarenteed, that the TxnId() getter provided by
    1.41 +        * CSenServiceConnection class will return valid transaction ID. This allows 
    1.42 +        * one to map the ID of sent request, returned from CSenServiceConnection::SendL
    1.43 +        * with the response that is provided in this callback.
    1.44 +        * @param aMessage incoming message.
    1.45 +        */
    1.46 +        virtual void HandleMessageL(const TDesC8& aMessage) = 0;
    1.47 +
    1.48 +        /**
    1.49 +        * Callback, which is invoked when an error message is received from invoked service.
    1.50 +        * Inside this method, it is guarenteed, that the TxnId() getter provided by
    1.51 +        * CSenServiceConnection class will return valid transaction ID. This allows 
    1.52 +        * one to map the ID of sent request, returned from CSenServiceConnection::SendL
    1.53 +        * with the response that is provided in this callback.
    1.54 +        * @param aErrorCode is the error code (negative number)
    1.55 +        * Error codes are some of the following:
    1.56 +        * KErrSenNotInitialized             Connection hasn't been initialized.
    1.57 +        * KErrConnectionInitializing        Connection is still initializing.
    1.58 +        * KErrSubmitting                    Submitting a message failed, 
    1.59 +        *                                   e.g. tried to send a NULL message.
    1.60 +        * KErrConnectionExpired             Connection has expired and needs to be
    1.61 +        *                                   renewed.
    1.62 +        * KErrSenSoapFault                  A SOAP fault occurred, aErrorMessage should 
    1.63 +        *                                   contain more detailed information.
    1.64 +        * KErrSenInternal                   Internal error in Web Services 
    1.65 +        *                                   framework
    1.66 +        * KErrUnknown                       An unexpected major error has occurred
    1.67 +        *                                   and cause is unknown.
    1.68 +        * Other possible error codes can be HTTP error codes or 
    1.69 +        * system-wide Symbian error codes.
    1.70 +        * @param aErrorMessage contains the error message data; with SOAP based services,
    1.71 +        * possibly a SOAP fault as XML.
    1.72 +        */
    1.73 +        virtual void HandleErrorL(const TInt aErrorCode, 
    1.74 +                                  const TDesC8& aErrorMessage) = 0;
    1.75 +
    1.76 +        /**
    1.77 +        * This method is called when the status of the connection
    1.78 +        * to the service changes.
    1.79 +        * @param aStatus is connection state indicator, which
    1.80 +        * could be specified by the actual service invocation framework
    1.81 +        * implementation. The following status codes are possible for
    1.82 +        * any installed framework:
    1.83 +        * KSenConnectionStatusNew              Connection is being initialized, but not yet ready.
    1.84 +        * KSenConnectionStatusReady            Connection is ready to be used. For example, SubmitL()
    1.85 +        *                                      and SendL() methods (depending of framework) are in
    1.86 +        *                                      invocable state.
    1.87 +        * KSenConnectionStatusExpired          Connection is expired. Typically, a new connection
    1.88 +        *                                      needs next to be initialized in order to communicate
    1.89 +        *                                      with the underlying service behind this service
    1.90 +        *                                      connection.
    1.91 +        */
    1.92 +        virtual void SetStatus(const TInt aStatus) = 0;
    1.93 +    };
    1.94 +
    1.95 +/**
    1.96 + * Callback interface for trnsfer progress observer
    1.97 + */
    1.98 +class MSenFilesObserver
    1.99 +    {
   1.100 +    public:
   1.101 +    /**
   1.102 +    * This method is called when new part of BLOB is sent or received.
   1.103 +    *
   1.104 +    * @param aTxnId Transaction ID.
   1.105 +    * @param aIncoming ETrue if it is incoming BLOB, EFalse if outgoing.
   1.106 +    * @param aMessage SOAP message for incoming messages with BLOBs.
   1.107 +    * @param aCid CID of current BLOB.
   1.108 +    * @param aProgress Count of sent/received BLOB bytes.
   1.109 +    */
   1.110 +    virtual void TransferProgress(TInt aTxnId, TBool aIncoming, const TDesC8& aMessage,
   1.111 +            const TDesC8& aCid, TInt aProgress) = 0;
   1.112 +    };
   1.113 +class MSenExtendedConsumerInterface
   1.114 +    {       
   1.115 +    public: 
   1.116 +	    inline virtual TAny* GetInterfaceByUid( TUid /* aUID */ ) { return NULL; };
   1.117 +    };    
   1.118 +
   1.119 +#endif // M_SEN_SERVICE_CONSUMER_H
   1.120 +
   1.121 +// End of File