epoc32/include/mw/msenserviceconsumer.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 msenserviceconsumer.h
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * 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
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Callback interface for service consumers        
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef M_SEN_SERVICE_CONSUMER_H
       
    19 #define M_SEN_SERVICE_CONSUMER_H
       
    20 
       
    21 const TUid KSenInterfaceUidFilesObserver            = { 0x101F9742 }; // MSenFilesObserver
       
    22 const TUid KSenInterfaceUidAuthenticationProvider   = { 0x10282C6F }; // MSenAuthenticationProvider
       
    23 // CLASS DECLARATION
       
    24 
       
    25 /**
       
    26  * Callback interface for service consumers
       
    27  */
       
    28 class MSenServiceConsumer
       
    29     {
       
    30     public: 
       
    31         
       
    32         // New functions
       
    33         
       
    34         /**
       
    35         * Callback, which is invoked when a message is received from invoked service.
       
    36         * Inside this method, it is guarenteed, that the TxnId() getter provided by
       
    37         * CSenServiceConnection class will return valid transaction ID. This allows 
       
    38         * one to map the ID of sent request, returned from CSenServiceConnection::SendL
       
    39         * with the response that is provided in this callback.
       
    40         * @param aMessage incoming message.
       
    41         */
       
    42         virtual void HandleMessageL(const TDesC8& aMessage) = 0;
       
    43 
       
    44         /**
       
    45         * Callback, which is invoked when an error message is received from invoked service.
       
    46         * Inside this method, it is guarenteed, that the TxnId() getter provided by
       
    47         * CSenServiceConnection class will return valid transaction ID. This allows 
       
    48         * one to map the ID of sent request, returned from CSenServiceConnection::SendL
       
    49         * with the response that is provided in this callback.
       
    50         * @param aErrorCode is the error code (negative number)
       
    51         * Error codes are some of the following:
       
    52         * KErrSenNotInitialized             Connection hasn't been initialized.
       
    53         * KErrConnectionInitializing        Connection is still initializing.
       
    54         * KErrSubmitting                    Submitting a message failed, 
       
    55         *                                   e.g. tried to send a NULL message.
       
    56         * KErrConnectionExpired             Connection has expired and needs to be
       
    57         *                                   renewed.
       
    58         * KErrSenSoapFault                  A SOAP fault occurred, aErrorMessage should 
       
    59         *                                   contain more detailed information.
       
    60         * KErrSenInternal                   Internal error in Web Services 
       
    61         *                                   framework
       
    62         * KErrUnknown                       An unexpected major error has occurred
       
    63         *                                   and cause is unknown.
       
    64         * Other possible error codes can be HTTP error codes or 
       
    65         * system-wide Symbian error codes.
       
    66         * @param aErrorMessage contains the error message data; with SOAP based services,
       
    67         * possibly a SOAP fault as XML.
       
    68         */
       
    69         virtual void HandleErrorL(const TInt aErrorCode, 
       
    70                                   const TDesC8& aErrorMessage) = 0;
       
    71 
       
    72         /**
       
    73         * This method is called when the status of the connection
       
    74         * to the service changes.
       
    75         * @param aStatus is connection state indicator, which
       
    76         * could be specified by the actual service invocation framework
       
    77         * implementation. The following status codes are possible for
       
    78         * any installed framework:
       
    79         * KSenConnectionStatusNew              Connection is being initialized, but not yet ready.
       
    80         * KSenConnectionStatusReady            Connection is ready to be used. For example, SubmitL()
       
    81         *                                      and SendL() methods (depending of framework) are in
       
    82         *                                      invocable state.
       
    83         * KSenConnectionStatusExpired          Connection is expired. Typically, a new connection
       
    84         *                                      needs next to be initialized in order to communicate
       
    85         *                                      with the underlying service behind this service
       
    86         *                                      connection.
       
    87         */
       
    88         virtual void SetStatus(const TInt aStatus) = 0;
       
    89     };
       
    90 
       
    91 /**
       
    92  * Callback interface for trnsfer progress observer
       
    93  */
       
    94 class MSenFilesObserver
       
    95     {
       
    96     public:
       
    97     /**
       
    98     * This method is called when new part of BLOB is sent or received.
       
    99     *
       
   100     * @param aTxnId Transaction ID.
       
   101     * @param aIncoming ETrue if it is incoming BLOB, EFalse if outgoing.
       
   102     * @param aMessage SOAP message for incoming messages with BLOBs.
       
   103     * @param aCid CID of current BLOB.
       
   104     * @param aProgress Count of sent/received BLOB bytes.
       
   105     */
       
   106     virtual void TransferProgress(TInt aTxnId, TBool aIncoming, const TDesC8& aMessage,
       
   107             const TDesC8& aCid, TInt aProgress) = 0;
       
   108     };
       
   109 class MSenExtendedConsumerInterface
       
   110     {       
       
   111     public: 
       
   112 	    inline virtual TAny* GetInterfaceByUid( TUid /* aUID */ ) { return NULL; };
       
   113     };    
       
   114 
       
   115 #endif // M_SEN_SERVICE_CONSUMER_H
       
   116 
       
   117 // End of File