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